Skip to content

Commit f0a76f1

Browse files
iansuyoyota
authored andcommitted
Remove server worker registration from default templates (facebook#9349)
1 parent b39df24 commit f0a76f1

File tree

2 files changed

+0
-16
lines changed

2 files changed

+0
-16
lines changed

packages/cra-template/template/src/index.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import ReactDOM from "react-dom"
33
import "typeface-roboto"
44
import App from "./App"
55
import ErrorBoundary from "./ErrorBoundary"
6-
import * as serviceWorkerRegistration from './serviceWorkerRegistration';
76
import reportWebVitals from './reportWebVitals';
87

98
const Root = () => (
@@ -16,11 +15,6 @@ const Root = () => (
1615

1716
ReactDOM.render(<Root />, document.getElementById("root"))
1817

19-
// If you want your app to work offline and load faster, you can change
20-
// unregister() to register() below. Note this comes with some pitfalls.
21-
// Learn more about service workers: https://cra.link/PWA
22-
serviceWorkerRegistration.unregister();
23-
2418
// If you want to start measuring performance in your app, pass a function
2519
// to log results (for example: reportWebVitals(console.log))
2620
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals

packages/cra-template/template/src/serviceWorkerRegistration.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
<<<<<<< HEAD
21
/* eslint-disable */
3-
=======
42
// This optional code is used to register a service worker.
53
// register() is not called by default.
64

@@ -13,7 +11,6 @@
1311
// To learn more about the benefits of this model and instructions on how to
1412
// opt-in, read https://cra.link/PWA
1513

16-
>>>>>>> 9123aae7 (Move shortlinks to cra.link (#8957))
1714
const isLocalhost = Boolean(
1815
window.location.hostname === "localhost" ||
1916
// [::1] is the IPv6 localhost address.
@@ -46,17 +43,10 @@ export function register(config) {
4643
// service worker/PWA documentation.
4744
navigator.serviceWorker.ready.then(() => {
4845
console.log(
49-
<<<<<<< HEAD
50-
"This web app is being served cache-first by a service " +
51-
"worker. To learn more, visit https://bit.ly/CRA-PWA"
52-
)
53-
})
54-
=======
5546
'This web app is being served cache-first by a service ' +
5647
'worker. To learn more, visit https://cra.link/PWA'
5748
);
5849
});
59-
>>>>>>> 9123aae7 (Move shortlinks to cra.link (#8957))
6050
} else {
6151
// Is not localhost. Just register service worker
6252
registerValidSW(swUrl, config)

0 commit comments

Comments
 (0)