Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7498 from webpack/bugfix/hmr-parent-import
add parents correctly when creating namespace objects
- Loading branch information
Showing
4 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = 1; | ||
--- | ||
module.exports = 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { load } from "./parent-file"; | ||
import update from "../../update"; | ||
|
||
it("should bubble update from a nested dependency", () => { | ||
return load().then(value => { | ||
expect(value).toBe(1); | ||
return new Promise((resolve, reject) => { | ||
module.hot.accept("./parent-file", () => { | ||
resolve(load().then(value => { | ||
expect(value).toBe(2); | ||
})); | ||
}); | ||
NEXT(update(reject)); | ||
}); | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export function load() { | ||
return import("./file").then(file => file.default); | ||
} |