Open levino opened 4 years ago
@Levino I have no opinion on that, never worked with it. But if I had to judge by the docs it is opt-in with Create React App 2 anyways because of the problems you mentioned. They specifically recommend to not enable an offline-first service worker in development because of possible caching issues.
See: https://create-react-app.dev/docs/making-a-progressive-web-app/#offline-first-considerations
Out it goes!
@jakobkolb Was this project created with react-create-app@^2
? Is the service worker not opt in? Did you opt into it? Why?
I see. It is off: https://github.com/hardforkio/react-app-template/blob/c974cb96a4a9db60b4ba2c59d26c670aed0f2889/src/index.tsx#L17 We would need to change this to
serviceWorker.register()
to opt-in.
Even if so, I vote to delete the file and all mention of the service worker. It is just noise and dangerous dead code for me.
I didn't know about versions 1 vs 2 of create react app, but since v.2 is the default, I used that. I also didn't opt into the serviceWorker.
@jakobkolb see my last comment which basically answered my question.
Remove the service worker code and all mention of it in the codebase.
~Former version: I hate the service worker for react apps, I only had cache issues. What is your opinion on this @monotv ?~