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
Add --reload flag #2677
Add --reload flag #2677
Conversation
Is this an alternative to #2676? |
I'm not sure if this is actually useful with that other one merged. |
Actually, that one doesn't work in 100% of cases. |
I do think page reloading should probably be the default unless you accept the HMR update, as proposed by #2676. HMR not working seems to be more common than working. You need to write your code in a specific way in order for HMR to work most of the time. I think if you don't opt in then we should just reload the page by default. |
With current React/Preact code, it works perfectly as it is right now (re-executing JS). What would I have to do the reenable that? ReactDOM.render(<App/>, document.body);
if(module.hot){
module.hot.accept(() => "dummy");
} |
Sometimes, in very simple apps, yes. But if you do anything more complicated, like have global state in redux, etc., then it won't always work properly. Yeah, you'd need to do what you said above. You can just I believe this is also required by webpack, or it will just reload the page, so we'd be matching their behavior. |
👍 -> #2676 |
↪️ Pull Request
Add a flag to always fully reload the page.
Closes #289
After merging:
🚨 Test instructions
parcel index.html --reload
will fully reload the page if some JS is changed (instead of merely re-executing it).✔️ PR Todo