Skip to content

Commit 5db2cde

Browse files
Fix Typos and Other Mistakes (ionic-team#2011)
* Fix Typos and Other Mistakes * Update pwa.md Co-authored-by: jaredcbaum <[email protected]>
1 parent 679ec24 commit 5db2cde

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docs/react/pwa.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ sidebar_label: Progressive Web Apps
99

1010
The two main requirements of a PWA are a <a href="https://developers.google.com/web/fundamentals/primers/service-workers/" target="_blank">Service Worker</a> and a <a href="https://developers.google.com/web/fundamentals/web-app-manifest/" target="_blank">Web Manifest</a>. While it's possible to add both of these to an app manually, a base project from Create React App (CRA) and the Ionic CLI provides this already.
1111

12-
In the `index.ts` for your app, there is a call to a `serviceWorker.unregister()` function. The base CRA provides has service workers as an opt-in feature, so it must be enabled.
13-
To enabled, call `serviceWorker.register()`.
12+
In the `index.ts` for your app, there is a call to a `serviceWorker.unregister()` function. The base that CRA provides has service workers as an opt-in feature, so it must be enabled. To enable, call `serviceWorker.register()`.
1413

1514
```ts
1615
import React from 'react';
@@ -29,20 +28,20 @@ serviceWorker.register();
2928

3029

3130

32-
Once this package has been added run `ionic build` and the `build` directory will be ready to deploy as a PWA.
31+
Once this package has been added, run `ionic build` and the `build` directory will be ready to deploy as a PWA.
3332

3433
> By default, react apps package comes with the Ionic logo for the app icons. Be sure to update the manifest to use the correct app name and also replace the icons.
3534
3635

37-
> Note: Features like Service Workers and many JavaScript APIs (such as geolocation) require the app be hosted in a secure context. When deploying an app through a hosting service, be aware that HTTPS will be required to take full advantage of Service Workers.
36+
> Note: Features like Service Workers and many JavaScript APIs (such as geolocation) require the app to be hosted in a secure context. When deploying an app through a hosting service, be aware that HTTPS will be required to take full advantage of Service Workers.
3837
3938

4039

4140
## Service Worker configuration
4241

4342
By default, CRA/React Scripts come with a preconfigured Service Worker setup based on [Workbox's Webpack plugin](https://developers.google.com/web/tools/workbox/modules/workbox-webpack-plugin). This utilises a cache-first strategy, meaning that your app will load from a cache, even if the network returns a newer version of the app.
4443

45-
Because of the nature or CRA/React Scripts, the configuration for this is internal to React Scripts, meaning that is cannot be customized without ejecting from React Scripts. Currently, the Ionic CLI does not support an ejected React App, so if this action is taken, you'll need to use npm/yarn scripts instead of the Ionic CLI.
44+
Because of the nature of CRA/React Scripts, the configuration for this is internal to React Scripts, meaning that it cannot be customized without ejecting from React Scripts. Currently, the Ionic CLI does not support an ejected React App, so if this action is taken, you'll need to use npm/yarn scripts instead of the Ionic CLI.
4645

4746

4847
## Deploying

0 commit comments

Comments
 (0)