Skip to content
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

Update hmr.md #463

Closed
wants to merge 2 commits into from
Closed

Update hmr.md #463

wants to merge 2 commits into from

Conversation

louh
Copy link

@louh louh commented Jun 24, 2019

Clarify that HMR is now opt-in. See parcel-bundler/parcel#2676 (comment)

Clarify that HMR is now opt-in. See parcel-bundler/parcel#2676 (comment)
@vercel
Copy link

vercel bot commented Jun 24, 2019

This pull request is automatically deployed with Now.
To access deployments, click Details below or on the icon next to each push.

Hot Module Replacement (HMR) improves the development experience by automatically updating modules in the browser at runtime without needing a whole page refresh. This means that application state can be retained as you change small things. Parcel's HMR implementation supports both JavaScript and CSS assets out of the box. HMR is automatically disabled when bundling in production mode.
Hot Module Replacement (HMR) improves the development experience by automatically updating modules in the browser at runtime without needing a whole page refresh. This means that application state can be retained as you change small things. Parcel's HMR implementation supports both JavaScript and CSS assets.

As of version 1.12.x, the default implementation has changed to fully refresh the page when files change. You can opt-in to enable true HMR by calling `module.hot.accept()` in your app. HMR is automatically disabled when bundling in production mode.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The last sentence can be a bit deceiving, you definitely need an enclosing if(module.hot).... otherwise there will be an error in production that module.hot is undefined .
"1.12.x" isn't really a version, the change was in 1.12.0.

@DeMoorJasper
Copy link
Member

Apparently the original branch this PR is comparing to dissapeared, so we can't merge this...

@DeMoorJasper DeMoorJasper mentioned this pull request Oct 6, 2019
@louh
Copy link
Author

louh commented Oct 7, 2019

Oh! I must've cleaned house and forgot that this PR was still extant. Thanks for setting it up separately. Sorry about the inconvenience 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants