Parcel HMR API isn't following established (e.g. Webpack) conventions.
🤔 Expected Behavior
at least module.hot.accept should follow Webpack HMR API whereby the function is meant to stop the propagation of changes, either asking for current module to be re-executed on change (kind of the current behaviour) or setting a callback to explicitly handle a child module update,
which means entry point should not re-execute unless it calls module.hot.accept(); default behaviour should be for the page to simply reload,
I believe HMR shouldn't automatically re-execute modules but only invalidate the chain of modules from changed to accepter,
for each module change, all the parent (up to entry point) modules are forcefully re-executed,
it's impossible to capture child module changes to handle in-place re-execution,
this behaviour can result typically in modules (typically entry point) being re-executed several times if multiple updates happen simulateously (bug #2488).
🙋 feature request
Parcel HMR API isn't following established (e.g. Webpack) conventions.
🤔 Expected Behavior
module.hot.accept
should follow Webpack HMR API whereby the function is meant to stop the propagation of changes, either asking for current module to be re-executed on change (kind of the current behaviour) or setting a callback to explicitly handle a child module update,module.hot.accept()
; default behaviour should be for the page to simply reload,😯 Current Behavior
💁 Possible Solution
🔦 Context
💻 Examples