question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a version comment to the mockServiceWorker.js

See original GitHub issue

Is 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kettanaitocommented, Jun 16, 2021

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.

0reactions
ibratoevcommented, Jun 16, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found