Add a version comment to the mockServiceWorker.js
See original GitHub issueIs your feature request related to a problem? Please describe.
When the mockServiceWorker.js
in the public folder is updated it is not clear if this is by mistake or an upgrade to a new version.
Describe the solution you’d like
Add a comment near the top of the mockServiceWorker.js
file with the npm package version that produced the file in the public
directory. This would make it more discoverable which version of the file you have and it will be easier when updating.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Type-safe API mocking with Mock Service Worker and ...
Type-safe API mocking with Mock Service Worker and TypeScript ... Mock Service Worker is a seamless API mocking library for browser and Node.js....
Read more >Getting started with Mock Service Worker - LogRocket Blog
In this tutorial, we'll learn about Mock Service Worker and how we can use it to mock network requests. We'll build a chat...
Read more >How can I prevent mockServiceWorker.js from being added to ...
Hi. I have initialised the mock service worker for browser integration in my React app and is in the public folder.
Read more >Mock Service Worker Tutorial | How to Mock Network Requests
Mock Service Worker makes the testing and development story very simple by mocking requests at ... It gives a very fast feedback look...
Read more >msw mockServiceWorker.js resource remains in a"pending ...
I am using msw to mock fetch API request in my project, I check the network tab and the mockServiceWorker.js resource remains in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Agree. At the moment we still recommend committing the worker script to VCS to give the developer the power over that script. It’s just a JavaScript module like any other. This transparency is a vital part of the security view on MSW.
That’s a good question. I guess I would prefer to have the script explicitly visible in the public directory. But I see the other way working fine for some situations as well. Don’t have a strong preference at the moment so, maybe, supporting both should be fine until a “best” practice is more clearly established, if ever.