Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the service worker #2

Open
levino opened this issue Jun 30, 2020 · 6 comments
Open

Remove the service worker #2

levino opened this issue Jun 30, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@levino
Copy link
Member

levino commented Jun 30, 2020

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 ?

@levino levino added the enhancement New feature or request label Jun 30, 2020
@monotv
Copy link

monotv commented Jun 30, 2020

@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

@levino
Copy link
Member Author

levino commented Jun 30, 2020

Out it goes!

@levino
Copy link
Member Author

levino commented Jun 30, 2020

@jakobkolb Was this project created with react-create-app@^2? Is the service worker not opt in? Did you opt into it? Why?

@levino
Copy link
Member Author

levino commented Jun 30, 2020

I see. It is off:

serviceWorker.unregister()

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.

@jakobkolb
Copy link
Contributor

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.

@levino
Copy link
Member Author

levino commented Jun 30, 2020

@jakobkolb see my last comment which basically answered my question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants