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

Hot reload only reload one line of parents #3112

Closed
hlehmann opened this issue May 30, 2019 · 3 comments · Fixed by #7514
Closed

Hot reload only reload one line of parents #3112

hlehmann opened this issue May 30, 2019 · 3 comments · Fixed by #7514
Labels

Comments

@hlehmann
Copy link

hlehmann commented May 30, 2019

🐛 bug report

It appear that hot reload only refresh one line of dependant modules instead of all of dependant modules

💻 Code Sample

// index.js
const render = async () => {
  const {App} = await import("./app");
  ReactDom.render(<App />, document.getElementById("app"));
}

render()
module.hot.accept(render)

// app.js
import "a";
import "b";

export const App = () => null;

// a.js
import {cpt} from "c";
console.log("a", cpt);

// b.js
import {cpt} from "c";
console.log("b", cpt);

// c.js
export const cpt = 1;

🤔 Expected Behavior

When cpt value is changed (to 2 for example) we expect to get the following logs
a 2
b 2

😯 Current Behavior

But we get only
b 2

🌍 Your Environment

Software Version(s)
Parcel 1.12.3
Node 12.3.0
yarn 1.16.0
ubuntu 18.4
@mischnic
Copy link
Member

If thats really all code, then HMR should only cause a full page reload.
To opt into the JS hot module replacement, you need to call module.hot.accept();

@hlehmann
Copy link
Author

hlehmann commented Jun 5, 2019

@mischnic Yes sorry I didn't put the first file. I have updated my code issue accordingly.

@mischnic mischnic added the HMR Hot Module Reloading label Jun 5, 2019
@github-actions
Copy link

github-actions bot commented Jul 9, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 14 days if no further activity occurs.

@github-actions github-actions bot added the Stale Inactive issues label Jul 9, 2020
@mischnic mischnic reopened this Jul 23, 2020
@mischnic mischnic added 🐛 Bug and removed ❔ Question Stale Inactive issues labels Jul 23, 2020
@github-actions github-actions bot added the Stale Inactive issues label Jan 20, 2021
@mischnic mischnic added ✨ Parcel 2 and removed Stale Inactive issues labels Jan 20, 2021
@parcel-bundler parcel-bundler deleted a comment from github-actions bot Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants