{"id":19614331,"url":"https://github.com/fpapado/pingpong-elm-version","last_synced_at":"2026-06-10T04:31:41.617Z","repository":{"id":96505047,"uuid":"112090894","full_name":"fpapado/pingpong-elm-version","owner":"fpapado","description":null,"archived":false,"fork":false,"pushed_at":"2017-11-26T14:47:54.000Z","size":118,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T17:47:37.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fpapado.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-11-26T14:47:40.000Z","updated_at":"2017-11-26T14:47:55.000Z","dependencies_parsed_at":"2023-04-30T19:01:29.660Z","dependency_job_id":null,"html_url":"https://github.com/fpapado/pingpong-elm-version","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fpapado/pingpong-elm-version","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Fpingpong-elm-version","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Fpingpong-elm-version/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Fpingpong-elm-version/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Fpingpong-elm-version/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fpapado","download_url":"https://codeload.github.com/fpapado/pingpong-elm-version/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Fpingpong-elm-version/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34137570,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T10:51:12.513Z","updated_at":"2026-06-10T04:31:41.600Z","avatar_url":"https://github.com/fpapado.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"This project is bootstrapped with [Create Elm App](https://github.com/halfzebra/create-elm-app).\n\nBelow you will find some information on how to perform basic tasks.  \nYou can find the most recent version of this guide [here](https://github.com/halfzebra/create-elm-app/blob/master/template/README.md).\n\n## Table of Contents\n- [Sending feedback](#sending-feedback)\n- [Folder structure](#folder-structure)\n- [Installing Elm packages](#installing-elm-packages)\n- [Installing JavaScript packages](#installing-javascript-packages)\n- [Available scripts](#available-scripts)\n  - [elm-app build](#elm-app-build)\n  - [elm-app start](#elm-app-start)\n  - [elm-app install](#elm-app-install)\n  - [elm-app test](#elm-app-test)\n  - [elm-app eject](#elm-app-eject)\n  - [elm-app \u003celm-platform-comand\u003e](#elm-app-elm-platform-comand)\n    - [package](#package)\n    - [repl](#repl)\n    - [make](#make)\n    - [reactor](#reactor)\n- [Turning on/off Elm Debugger](#turning-onoff-elm-debugger)\n- [Dead code elimination](#dead-code-elimination)\n- [Changing the Page `\u003ctitle\u003e`](#changing-the-page-title)\n- [Adding a Stylesheet](#adding-a-stylesheet)\n- [Post-Processing CSS](#post-processing-css)\n- [Using elm-css](#using-elm-css)\n- [Adding Images and Fonts](#adding-images-and-fonts)\n- [Using the `public` Folder](#using-the-public-folder)\n  - [Changing the HTML](#changing-the-html)\n  - [Adding Assets Outside of the Module System](#adding-assets-outside-of-the-module-system)\n  - [When to Use the `public` Folder](#when-to-use-the-public-folder)\n- [Setting up API Proxy](#setting-up-api-proxy)\n- [Running tests](#running-tests)\n  - [Dependencies in Tests](#dependencies-in-tests)\n  - [Continuous Integration](#continuous-integration)\n- [Making a Progressive Web App](#making-a-progressive-web-app)\n  - [Opting Out of Caching](#opting-out-of-caching)\n  - [Offline-First Considerations](#offline-first-considerations)\n  - [Progressive Web App Metadata](#progressive-web-app-metadata)\n- [Deployment](#deployment)\n  - [Static Server](#static-server)\n  - [GitHub Pages](#github-pages)\n- [IDE setup for Hot Module Replacement](#ide-setup-for-hot-module-replacement)\n\n## Sending feedback\n\nYou are very welcome with any [feedback](https://github.com/halfzebra/create-elm-app/issues)\n\n## Installing Elm packages\n\n```sh\nelm-app install \u003cpackage-name\u003e\n```\n\nOther `elm-package` commands are also [available.](#package)\n\n## Installing JavaScript packages\n\nTo use JavaScript packages from npm, you'll need to add a `package.json`, install the dependencies, and you're ready to go.\n\n```sh\nnpm init -y # Add package.json\nnpm install --save-dev pouchdb-browser # Install library from npm\n```\n\n```js\n// Use in your JS code\nimport PouchDB from 'pouchdb-browser';\nconst db = new PouchDB('mydb');\n```\n\n## Folder structure\n\n```\nmy-app/\n├── .gitignore\n├── README.md\n├── elm-package.json\n├── elm-stuff\n├── public\n│   ├── favicon.ico\n│   ├── index.html\n│   ├── logo.svg\n│   └── manifest.json\n├── src\n│   ├── Main.elm\n│   ├── index.js\n│   ├── main.css\n│   └── registerServiceWorker.js\n└── tests\n    ├── Tests.elm\n    └── elm-package.json\n```\n\nFor the project to build, these files must exist with exact filenames:\n\n- `public/index.html` is the page template;\n- `public/favicon.ico` is the icon you see in the browser tab;\n- `src/index.js` is the JavaScript entry point.\n\nYou can delete or rename the other files.\n\nYou may create subdirectories inside src.\n\n## Available scripts\nIn the project directory you can run:\n### `elm-app build`\nBuilds the app for production to the `build` folder.  \n\nThe build is minified, and the filenames include the hashes.  \nYour app is ready to be deployed!\n\n### `elm-app start`\nRuns the app in the development mode.  \nOpen [http://localhost:3000](http://localhost:3000) to view it in the browser.\n\nThe page will reload if you make edits.  \nYou will also see any lint errors in the console.\n\n### `elm-app install`\n\nAn alias for [`elm-app package install`](#package)\n\n### `elm-app test`\nRun tests with [node-test-runner](https://github.com/rtfeldman/node-test-runner/tree/master)\n\nYou can make test runner watch project files by running:\n```sh\nelm-app test --watch\n```\n\n### `elm-app eject`\n\n**Note: this is a one-way operation. Once you `eject`, you can’t go back!**\n\nIf you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time.\n\nInstead, it will copy all the configuration files and the transitive dependencies (Webpack, Elm Platform, etc.) right into your project, so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point, you’re on your own.\n\nYou don’t have to use 'eject' The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However, we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.\n\n### `elm-app \u003celm-platform-comand\u003e`\n\nCreate Elm App does not rely on the global installation of Elm Platform, but you still can use its local Elm Platform to access default command line tools:\n\n#### `package`\n\nAlias for [elm-package](http://guide.elm-lang.org/get_started.html#elm-package)\n\nUse it for installing Elm packages from [package.elm-lang.org](http://package.elm-lang.org/)\n\n#### `repl`\n\nAlias for [elm-repl](http://guide.elm-lang.org/get_started.html#elm-repl)\n\n#### `make`\n\nAlias for  [elm-make](http://guide.elm-lang.org/get_started.html#elm-make)\n\n#### `reactor`\n\nAlias for  [elm-reactor](http://guide.elm-lang.org/get_started.html#elm-reactor)\n\n\n## Turning on/off Elm Debugger\n\nBy default, in production (`elm-app build`) the Debugger is turned off and in development mode (`elm-app start`) it's turned on.\n\nTo turn on/off Elm Debugger explicitly, set `ELM_DEBUGGER` environment variable to `true` or `false` respectively.\n\n## Dead code elimination\n\nCreate Elm App comes with an opinionated setup for dead code elimination which is disabled by default, because it may break your code.\n\nYou can enable it by setting `DEAD_CODE_ELIMINATION` environment variable to `true`\n\n## Changing the base path of the assets in the HTML\n\nBy default, assets will be linked from the HTML to the root url. For example `/css/style.css`.\n\nIf you deploy to a path that is not the root, you can change the `PUBLIC_URL` environment variable to properly reference your assets in the compiled assets. For example: `PUBLIC_URL=./ elm-app build`.\n\n## Changing the Page `\u003ctitle\u003e`\n\nYou can find the source HTML file in the `public` folder of the generated project. You may edit the `\u003ctitle\u003e` tag in it to change the title from “Elm App” to anything else.\n\nNote that normally you wouldn’t edit files in the `public` folder very often. For example, [adding a stylesheet](#adding-a-stylesheet) is done without touching the HTML.\n\nIf you need to dynamically update the page title based on the content, you can use the browser [`document.title`](https://developer.mozilla.org/en-US/docs/Web/API/Document/title) API and [ports.](https://guide.elm-lang.org/interop/javascript.html#ports)\n\n## Adding a Stylesheet\n\nThis project setup uses [Webpack](https://webpack.js.org/) for handling all assets. Webpack offers a custom way of “extending” the concept of `import` beyond JavaScript. To express that a JavaScript file depends on a CSS file, you need to **import the CSS from the JavaScript file**:\n\n### `main.css`\n\n```css\nbody {\n  padding: 20px;\n}\n```\n\n### `index.js`\n\n```js\nimport './main.css'; // Tell Webpack to pick-up the styles from base.css\n```\n\n## Post-Processing CSS\n\nThis project setup minifies your CSS and adds vendor prefixes to it automatically through [Autoprefixer](https://github.com/postcss/autoprefixer) so you don’t need to worry about it.\n\nFor example, this:\n\n```css\n.container {\n  display: flex;\n  flex-direction: row;\n  align-items: center;\n}\n```\n\nbecomes this:\n\n```css\n.container {\n  display: -webkit-box;\n  display: -ms-flexbox;\n  display: flex;\n}\n```\n\nIn development, expressing dependencies this way allows your styles to be reloaded on the fly as you edit them. In production, all CSS files will be concatenated into a single minified `.css` file in the build output.\n\nYou can put all your CSS right into `src/main.css`. It would still be imported from `src/index.js`, but you could always remove that import if you later migrate to a different build tool.\n\n## Using elm-css\n\n### Step 1: Install [elm-css](https://github.com/rtfeldman/elm-css) npm package\n\n```sh\nnpm install elm-css -g\n```\n\n### Step 2: Install Elm dependencies\n\n```sh\nelm-app install rtfeldman/elm-css\nelm-app install rtfeldman/elm-css-helpers\n```\n\n### Step 3: Create the stylesheet file\n\nCreate an Elm file at `src/Stylesheets.elm` (The name of this file cannot be changed).\n\n```elm\nport module Stylesheets exposing (main, CssClasses(..), CssIds(..), helpers)\n\nimport Css exposing (..)\nimport Css.Elements exposing (body, li)\nimport Css.Namespace exposing (namespace)\nimport Css.File exposing (..)\nimport Html.CssHelpers exposing (withNamespace)\n\n\nport files : CssFileStructure -\u003e Cmd msg\n\n\ncssFiles : CssFileStructure\ncssFiles =\n    toFileStructure [ ( \"src/style.css\", Css.File.compile [ css ] ) ]\n\n\nmain : CssCompilerProgram\nmain =\n    Css.File.compiler files cssFiles\n\n\ntype CssClasses\n    = NavBar\n\n\ntype CssIds\n    = Page\n\n\nappNamespace =\n    \"App\"\n\n\nhelpers =\n    withNamespace appNamespace\n\n\ncss =\n    (stylesheet \u003c\u003c namespace appNamespace)\n    [ body\n        [ overflowX auto\n        , minWidth (px 1280)\n        ]\n    , id Page\n        [ backgroundColor (rgb 200 128 64)\n        , color (hex \"CCFFFF\")\n        , width (pct 100)\n        , height (pct 100)\n        , boxSizing borderBox\n        , padding (px 8)\n        , margin zero\n        ]\n    , class NavBar\n        [ margin zero\n        , padding zero\n        , children\n            [ li\n                [ (display inlineBlock) |\u003e important\n                , color primaryAccentColor\n                ]\n            ]\n        ]\n    ]\n\n\nprimaryAccentColor =\n    hex \"ccffaa\"\n```\n\n### Steap 4: Compiling the stylesheet\n\nTo compile the CSS file, just run\n\n```sh\nelm-css src/Stylesheets.elm\n```\n\nThis will generate a file called `style.css`\n\n### Step 5: Import the compiled CSS file\n\nAdd the following line to your `src/index.js`:\n\n```js\nimport './style.css';\n```\n\n### Step 6: Using the stylesheet in your Elm code\n\n```elm\nimport Stylesheets exposing (helpers, CssIds(..), CssClasses(..))\n\n\nview model =\n    div [ helpers.id Page ]\n        [ div [ helpers.class [ NavBar ] ]\n            [ text \"Your Elm App is working!\" ]\n        ]\n```\n\nPlease note that `Stylesheets.elm` exposes `helpers` record, which contains functions for creating id and class attributes.\n\nYou can also destructure `helpers` to make your view more readable:\n\n```elm\n{ id, class } =\n    helpers\n```\n\n## Adding Images and Fonts\n\nWith Webpack, using static assets like images and fonts works similarly to CSS.\n\nBy requiring an image in JavaScript code, you tell Webpack to add a file to the build of your application. The variable will contain a unique path to the said file.\n\nHere is an example:\n\n```js\nimport logoPath from './logo.svg'; // Tell Webpack this JS file uses this image\nimport { Main } from './Main.elm';\n\nMain.embed(\n    document.getElementById('root'),\n    logoPath // Pass image path as a flag for Html.programWithFlags\n  );\n```\n\nLater on, you can use the image path in your view for displaying it in the DOM.\n\n```elm\nview : Model -\u003e Html Msg\nview model =\n    div []\n        [ img [ src model.logo ] []\n        , div [] [ text model.message ]\n        ]\n```\n\n## Using the `public` Folder\n\n### Changing the HTML\n\nThe `public` folder contains the HTML file so you can tweak it, for example, to [set the page title](#changing-the-page-title).\nThe `\u003cscript\u003e` tag with the compiled code will be added to it automatically during the build process.\n\n### Adding Assets Outside of the Module System\n\nYou can also add other assets to the `public` folder.\n\nNote that we normally encourage you to `import` assets in JavaScript files instead.\nFor example, see the sections on [adding a stylesheet](#adding-a-stylesheet) and [adding images and fonts](#adding-images-fonts-and-files).\nThis mechanism provides a few benefits:\n\n* Scripts and stylesheets get minified and bundled together to avoid extra network requests.\n* Missing files cause compilation errors instead of 404 errors for your users.\n* Result filenames include content hashes, so you don’t need to worry about browsers caching their old versions.\n\nHowever, there is a **escape hatch** that you can use to add an asset outside of the module system.\n\nIf you put a file into the `public` folder, it will **not** be processed by Webpack. Instead, it will be copied into the build folder untouched.   To reference assets in the `public` folder, you need to use a special variable called `PUBLIC_URL`.\n\nInside `index.html`, you can use it like this:\n\n```html\n\u003clink rel=\"shortcut icon\" href=\"%PUBLIC_URL%/favicon.ico\"\u003e\n```\n\nOnly files inside the `public` folder will be accessible by `%PUBLIC_URL%` prefix. If you need to use a file from `src` or `node_modules`, you’ll have to copy it there to explicitly specify your intention to make this file a part of the build.\n\nWhen you run `elm-app build`, Create Elm App will substitute `%PUBLIC_URL%` with a correct absolute path, so your project works even if you use client-side routing or host it at a non-root URL.\n\nIn Elm code, you can use `%PUBLIC_URL%` for similar purposes:\n\n```elm\n// Note: this is an escape hatch and should be used sparingly!\n// Normally we recommend using `import`  and `Html.programWithFlags` for getting \n// asset URLs as described in “Adding Images and Fonts” above this section.\nimg [ src \"%PUBLIC_URL%/logo.svg\" ] []\n```\n\nIn JavaScript code, you can use `process.env.PUBLIC_URL` for similar purposes:\n\n```js\nconst logo = `\u003cimg src=${process.env.PUBLIC_URL + '/img/logo.svg'} /\u003e`;\n```\n\nKeep in mind the downsides of this approach:\n\n* None of the files in `public` folder get post-processed or minified.\n* Missing files will not be called at compilation time, and will cause 404 errors for your users.\n* Result filenames won’t include content hashes so you’ll need to add query arguments or rename them every time they change.\n\n### When to Use the `public` Folder\n\nNormally we recommend importing [stylesheets](#adding-a-stylesheet), [images, and fonts](#adding-images-fonts-and-files) from JavaScript.\nThe `public` folder is used as a workaround for some less common cases:\n\n* You need a file with a specific name in the build output, such as [`manifest.webmanifest`](https://developer.mozilla.org/en-US/docs/Web/Manifest).\n* You have thousands of images and need to dynamically reference their paths.\n* You want to include a small script like [`pace.js`](http://github.hubspot.com/pace/docs/welcome/) outside of the bundled code.\n* Some library may be incompatible with Webpack and you have no other option but to include it as a `\u003cscript\u003e` tag.\n\nNote that if you add a `\u003cscript\u003e` that declares global variables, you also need to read the next section on using them.\n\n\n## Setting up API Proxy\nTo forward the API ( REST ) calls to backend server, add a proxy to the `elm-package.json` in the top level json object.\n\n```json\n{\n    ...\n    \"proxy\" : \"http://localhost:1313\",\n    ...\n}\n```\n\nMake sure the XHR requests set the `Content-type: application/json` and `Accept: application/json`.\nThe development server has heuristics, to handle its own flow, which may interfere with proxying of \nother html and javascript content types.\n\n```sh\n curl -X GET -H \"Content-type: application/json\" -H \"Accept: application/json\"  http://localhost:3000/api/list\n```\n\n## Running Tests\n\nCreate Elm App uses [elm-test](https://github.com/rtfeldman/node-test-runner) as its test runner.\n\n### Dependencies in Tests\n\nTo use packages in tests, you also need to install them in `tests` directory.\n\n```bash\nelm-app test --add-dependencies elm-package.json \n```\n\n### Continuous Integration\n\n#### Travis CI\n\n1. Following the [Travis Getting started](https://docs.travis-ci.com/user/getting-started/) guide for syncing your GitHub repository with Travis.  You may need to initialize some settings manually in your [profile](https://travis-ci.org/profile) page.\n1. Add a `.travis.yml` file to your git repository.\n\n```yaml\nlanguage: node_js\n\nsudo: required\n\nnode_js:\n  - '7'\n\ninstall:\n  - npm i create-elm-app -g\n\nscript: elm-app test\n```\n\n1. Trigger your first build with a git push.\n1. [Customize your Travis CI Build](https://docs.travis-ci.com/user/customizing-the-build/) if needed.\n\n## Making a Progressive Web App\n\nBy default, the production build is a fully functional, offline-first\n[Progressive Web App](https://developers.google.com/web/progressive-web-apps/).\n\nProgressive Web Apps are faster and more reliable than traditional web pages, and provide an engaging mobile experience:\n\n * All static site assets are cached so that your page loads fast on subsequent visits, regardless of network connectivity (such as 2G or 3G). Updates are downloaded in the background.\n * Your app will work regardless of network state, even if offline. This means your users will be able to use your app at 10,000 feet and on the Subway.\n * On mobile devices, your app can be added directly to the user's home screen, app icon and all. You can also re-engage users using web **push notifications**. This eliminates the need for the app store.\n\nThe [`sw-precache-webpack-plugin`](https://github.com/goldhand/sw-precache-webpack-plugin)\nis integrated into production configuration,\nand it will take care of generating a service worker file that will automatically\nprecache all of your local assets and keep them up to date as you deploy updates.\nThe service worker will use a [cache-first strategy](https://developers.google.com/web/fundamentals/instant-and-offline/offline-cookbook/#cache-falling-back-to-network)\nfor handling all requests for local assets, including the initial HTML, ensuring\nthat your web app is reliably fast, even on a slow or unreliable network.\n\n### Opting Out of Caching\n\nIf you would prefer not to enable service workers prior to your initial\nproduction deployment, then remove the call to `serviceWorkerRegistration.register()`\nfrom [`src/index.js`](src/index.js).\n\nIf you had previously enabled service workers in your production deployment and\nhave decided that you would like to disable them for all your existing users,\nyou can swap out the call to `serviceWorkerRegistration.register()` in\n[`src/index.js`](src/index.js) with a call to `serviceWorkerRegistration.unregister()`.\nAfter the user visits a page that has `serviceWorkerRegistration.unregister()`,\nthe service worker will be uninstalled. Note that depending on how `/service-worker.js` is served,\nit may take up to 24 hours for the cache to be invalidated.\n\n### Offline-First Considerations\n\n1. Service workers [require HTTPS](https://developers.google.com/web/fundamentals/getting-started/primers/service-workers#you_need_https),\nalthough to facilitate local testing, that policy\n[does not apply to `localhost`](http://stackoverflow.com/questions/34160509/options-for-testing-service-workers-via-http/34161385#34161385).\nIf your production web server does not support HTTPS, then the service worker\nregistration will fail, but the rest of your web app will remain functional.\n\n1. Service workers are [not currently supported](https://jakearchibald.github.io/isserviceworkerready/)\nin all web browsers. Service worker registration [won't be attempted](src/registerServiceWorker.js)\non browsers that lack support.\n\n1. The service worker is only enabled in the [production environment](#deployment),\ne.g. the output of `npm run build`. It's recommended that you do not enable an\noffline-first service worker in a development environment, as it can lead to\nfrustration when previously cached assets are used and do not include the latest\nchanges you've made locally.\n\n1. If you *need* to test your offline-first service worker locally, build\nthe application (using `npm run build`) and run a simple http server from your\nbuild directory. After running the build script, `create-react-app` will give\ninstructions for one way to test your production build locally and the [deployment instructions](#deployment) have\ninstructions for using other methods. *Be sure to always use an\nincognito window to avoid complications with your browser cache.*\n\n1. If possible, configure your production environment to serve the generated\n`service-worker.js` [with HTTP caching disabled](http://stackoverflow.com/questions/38843970/service-worker-javascript-update-frequency-every-24-hours).\nIf that's not possible—[GitHub Pages](#github-pages), for instance, does not\nallow you to change the default 10 minute HTTP cache lifetime—then be aware\nthat if you visit your production site, and then revisit again before\n`service-worker.js` has expired from your HTTP cache, you'll continue to get\nthe previously cached assets from the service worker. If you have an immediate\nneed to view your updated production deployment, performing a shift-refresh\nwill temporarily disable the service worker and retrieve all assets from the\nnetwork.\n\n1. Users aren't always familiar with offline-first web apps. It can be useful to\n[let the user know](https://developers.google.com/web/fundamentals/instant-and-offline/offline-ux#inform_the_user_when_the_app_is_ready_for_offline_consumption)\nwhen the service worker has finished populating your caches (showing a \"This web\napp works offline!\" message) and also let them know when the service worker has\nfetched the latest updates that will be available the next time they load the\npage (showing a \"New content is available; please refresh.\" message). Showing\nthis messages is currently left as an exercise to the developer, but as a\nstarting point, you can make use of the logic included in [`src/registerServiceWorker.js`](src/registerServiceWorker.js), which\ndemonstrates which service worker lifecycle events to listen for to detect each\nscenario, and which as a default, just logs appropriate messages to the\nJavaScript console.\n\n1. By default, the generated service worker file will not intercept or cache any\ncross-origin traffic, like HTTP [API requests](#integrating-with-an-api-backend),\nimages, or embeds loaded from a different domain. If you would like to use a\nruntime caching strategy for those requests, you can [`eject`](#npm-run-eject)\nand then configure the\n[`runtimeCaching`](https://github.com/GoogleChrome/sw-precache#runtimecaching-arrayobject)\noption in the `SWPrecacheWebpackPlugin` section of\n[`webpack.config.prod.js`](../config/webpack.config.prod.js).\n\n### Progressive Web App Metadata\n\nThe default configuration includes a web app manifest located at\n[`public/manifest.json`](public/manifest.json), that you can customize with\ndetails specific to your web application.\n\nWhen a user adds a web app to their homescreen using Chrome or Firefox on\nAndroid, the metadata in [`manifest.json`](public/manifest.json) determines what\nicons, names, and branding colors to use when the web app is displayed.\n[The Web App Manifest guide](https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/)\nprovides more context about what each field means, and how your customizations\nwill affect your users' experience.\n\n## Deployment\n\n\n`elm-app build` creates a `build` directory with a production build of your app. Set up your favourite HTTP server so that a visitor to your site is served `index.html`, and requests to static paths like `/static/js/main.\u003chash\u003e.js` are served with the contents of the `/static/js/main.\u003chash\u003e.js` file.\n\n### Static Server\n\nFor environments using [Node](https://nodejs.org/), the easiest way to handle this would be to install [serve](https://github.com/zeit/serve) and let it handle the rest:\n\n```sh\nnpm install -g serve\nserve -s build\n```\n\nThe last command shown above will serve your static site on the port **5000**. Like many of [serve](https://github.com/zeit/serve)’s internal settings, the port can be adjusted using the `-p` or `--port` flags.\n\nRun this command to get a full list of the options available:\n\n```sh\nserve -h\n```\n\n### GitHub Pages\n\n#### Step 1: Add `homepage` to `elm-package.json`\n\n**The step below is important!**\u003cbr\u003e\n**If you skip it, your app will not deploy correctly.**\n\nOpen your `elm-package.json` and add a `homepage` field:\n\n```js\n  \"homepage\": \"https://myusername.github.io/my-app\",\n```\n\nCreate Elm App uses the `homepage` field to determine the root URL in the built HTML file.\n\n#### Step 2: Deploy the site by running `gh-pages -d build`\n\nThen run:\n\n```sh\ngh-pages -d build\n```\n\n#### Step 3: Ensure your project’s settings use `gh-pages`\n\nFinally, make sure **GitHub Pages** option in your GitHub project settings is set to use the `gh-pages` branch:\n\n\u003cimg src=\"http://i.imgur.com/HUjEr9l.png\" width=\"500\" alt=\"gh-pages branch setting\"\u003e\n\n#### Step 4: Optionally, configure the domain\n\nYou can configure a custom domain with GitHub Pages by adding a `CNAME` file to the `public/` folder.\n\n#### Notes on client-side routing\n\nGitHub Pages doesn’t support routers that use the HTML5 `pushState` history API under the hood (for example, React Router using `browserHistory`). This is because when there is a fresh page load for a url like `http://user.github.io/todomvc/todos/42`, where `/todos/42` is a frontend route, the GitHub Pages server returns 404 because it knows nothing of `/todos/42`. If you want to add a router to a project hosted on GitHub Pages, here are a couple of solutions:\n\n* You could switch from using HTML5 history API to routing with hashes.\n* Alternatively, you can use a trick to teach GitHub Pages to handle 404 by redirecting to your `index.html` page with a special redirect parameter. You would need to add a `404.html` file with the redirection code to the `build` folder before deploying your project, and you’ll need to add code handling the redirect parameter to `index.html`. You can find a detailed explanation of this technique [in this guide](https://github.com/rafrex/spa-github-pages).\n\n## IDE setup for Hot Module Replacement\n\nRemember to disable [safe write](https://webpack.github.io/docs/webpack-dev-server.html#working-with-editors-ides-supporting-safe-write) if you are using VIM or IntelliJ IDE, such as WebStorm.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpapado%2Fpingpong-elm-version","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffpapado%2Fpingpong-elm-version","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpapado%2Fpingpong-elm-version/lists"}