Skip to content

Commit 3c70340

Browse files
jeffposnickTimer
authored andcommitted
Updates to README to reflect Workbox usage (facebook#5111)
* Updates to README to reflect Workbox usage. * Update README.md * Update README.md
1 parent 72d4ab0 commit 3c70340

File tree

2 files changed

+4
-22
lines changed

2 files changed

+4
-22
lines changed

README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ Builds the app for production to the `build` folder.<br>
117117
It correctly bundles React in production mode and optimizes the build for the best performance.
118118

119119
The build is minified and the filenames include the hashes.<br>
120-
By default, it also [includes a service worker](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#making-a-progressive-web-app) so that your app loads from local cache on future visits.
121120

122121
Your app is ready to be deployed.
123122

@@ -189,7 +188,7 @@ Your environment will have everything you need to build a modern single-page Rea
189188
* A fast interactive unit test runner with built-in support for coverage reporting.
190189
* A live development server that warns about common mistakes.
191190
* A build script to bundle JS, CSS, and images for production, with hashes and sourcemaps.
192-
* An offline-first [service worker](https://developers.google.com/web/fundamentals/getting-started/primers/service-workers) and a [web app manifest](https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/), meeting all the [Progressive Web App](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#making-a-progressive-web-app) criteria.
191+
* An offline-first [service worker](https://developers.google.com/web/fundamentals/getting-started/primers/service-workers) and a [web app manifest](https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/), meeting all the [Progressive Web App](https://github.com/facebook/create-react-app/blob/master/packages/react-scripts/template/README.md#making-a-progressive-web-app) criteria. (*Note: Using the service worker is opt-in as of `react-scripts@2.0.0` and higher*)
193192
* Hassle-free updates for the above tools with a single dependency.
194193

195194
Check out [this guide](https://github.com/nitishdayal/cra_closer_look) for an overview of how these tools fit together.

packages/react-scripts/template/README.md

+3-20
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ You can find the most recent version of this guide [here](https://github.com/fac
8383
- [Static Server](#static-server)
8484
- [Other Solutions](#other-solutions)
8585
- [Serving Apps with Client-Side Routing](#serving-apps-with-client-side-routing)
86-
- [Service Worker Considerations](#service-worker-considerations)
8786
- [Building for Relative Paths](#building-for-relative-paths)
8887
- [Customizing Environment Variables for Arbitrary Build Environments](#customizing-environment-variables-for-arbitrary-build-environments)
8988
- [Azure](#azure)
@@ -1753,9 +1752,9 @@ Offline-first Progressive Web Apps are faster and more reliable than traditional
17531752

17541753
- 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.
17551754
- 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.
1756-
- 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.
1755+
- On mobile devices, your app can be added directly to the user's home screen, app icon and all. This eliminates the need for the app store.
17571756

1758-
The [`sw-precache-webpack-plugin`](https://github.com/goldhand/sw-precache-webpack-plugin)
1757+
The [`workbox-webpack-plugin`](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin)
17591758
is integrated into production configuration,
17601759
and it will take care of generating a service worker file that will automatically
17611760
precache all of your local assets and keep them up to date as you deploy updates.
@@ -1793,17 +1792,6 @@ following into account:
17931792
instructions for using other methods. _Be sure to always use an
17941793
incognito window to avoid complications with your browser cache._
17951794

1796-
1. If possible, configure your production environment to serve the generated
1797-
`service-worker.js` [with HTTP caching disabled](http://stackoverflow.com/questions/38843970/service-worker-javascript-update-frequency-every-24-hours).
1798-
If that's not possible—[GitHub Pages](#github-pages), for instance, does not
1799-
allow you to change the default 10 minute HTTP cache lifetime—then be aware
1800-
that if you visit your production site, and then revisit again before
1801-
`service-worker.js` has expired from your HTTP cache, you'll continue to get
1802-
the previously cached assets from the service worker. If you have an immediate
1803-
need to view your updated production deployment, performing a shift-refresh
1804-
will temporarily disable the service worker and retrieve all assets from the
1805-
network.
1806-
18071795
1. Users aren't always familiar with offline-first web apps. It can be useful to
18081796
[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)
18091797
when the service worker has finished populating your caches (showing a "This web
@@ -1818,12 +1806,7 @@ following into account:
18181806

18191807
1. By default, the generated service worker file will not intercept or cache any
18201808
cross-origin traffic, like HTTP [API requests](#integrating-with-an-api-backend),
1821-
images, or embeds loaded from a different domain. If you would like to use a
1822-
runtime caching strategy for those requests, you can [`eject`](#npm-run-eject)
1823-
and then configure the
1824-
[`runtimeCaching`](https://github.com/GoogleChrome/sw-precache#runtimecaching-arrayobject)
1825-
option in the `SWPrecacheWebpackPlugin` section of
1826-
[`webpack.config.prod.js`](../config/webpack.config.prod.js).
1809+
images, or embeds loaded from a different domain.
18271810

18281811
### Progressive Web App Metadata
18291812

0 commit comments

Comments
 (0)