-
-
Notifications
You must be signed in to change notification settings - Fork 618
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: circular dependencies rebuild panic (#3001)
* fix: circular dependencies rebuild panic * add changeset * test: add test case for hmr circular dependencies
- Loading branch information
1 parent
1907257
commit ada51e2
Showing
7 changed files
with
45 additions
and
20 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@rspack/binding": patch | ||
--- | ||
|
||
fix: circular dependencies rebuild panic |
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,2 @@ | ||
import "./b"; | ||
export default "a.js"; |
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,2 @@ | ||
import "./a"; | ||
export default "b.js"; |
4 changes: 4 additions & 0 deletions
4
packages/rspack/tests/hotCases/runtime/hmr-circular/changed-file.js
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,4 @@ | ||
// TODO: remove this file after cache. | ||
const path = require("path"); | ||
|
||
module.exports = [path.resolve(__dirname, "./entry.js")]; |
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,4 @@ | ||
import './a'; | ||
export default "entry.js" | ||
--- | ||
export default "new_entry.js" |
10 changes: 10 additions & 0 deletions
10
packages/rspack/tests/hotCases/runtime/hmr-circular/index.js
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,10 @@ | ||
import entry from "./entry"; | ||
|
||
it("should not throw error when hmr remove circular dependencies", done => { | ||
expect(entry).toBe("entry.js"); | ||
module.hot.accept("./entry", () => { | ||
expect(entry).toBe("new_entry.js"); | ||
done(); | ||
}); | ||
NEXT(require("../../update")(done)); | ||
}); |