Replies: 2 comments 1 reply
-
|
I just want to give my +1 to this issue. I'm having a use case, where I would like to run a custom React renderer that does heavy computations inside a web worker. If we could have Hot Module Reloading for web workers, my "custom" react components would behave just like the React-DOM-ones. Not having HMR would be a bit of a deal breaker for this. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
+1 there should at least be a simple documented way to achieve this |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature you'd like to request
With Webpack 5, creating web workers is a breeze. However, turns out they aren't a subject to self-refresh on change. Or, at least, I think they fail to do so by design.
Imagine I'm spawning a web worker somehow. Say, inside a
useEffectof a component. The purpose of that webworker could be drawing something on an offscreen canvas.During development, I want to tweak the
NiceDrawings.ts(and its dependencies!) and I want fast refresh to identify the worker as a dependency of my react component, so it can re-instantiate the worker.However, it doesn't happen. Fast refresh happens, but the
useEffectdoesn't fire.Describe the solution you'd like
Workers might start not only in
useEffect, so ideally I would want to have finer control over this, just like the old times withmodule.hot.accept(deps). Maybe a compile directive, i.e.Describe alternatives you've considered
Some other way of importing the worker, e.g.
Beta Was this translation helpful? Give feedback.
All reactions