-
-
Notifications
You must be signed in to change notification settings - Fork 268
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nextjs-mf): improve hot reloading (#3001)
- Loading branch information
1 parent
3d6b72c
commit 1478f50
Showing
14 changed files
with
257 additions
and
163 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 @@ | ||
--- | ||
"@module-federation/nextjs-mf": patch | ||
--- | ||
- Added `globalThis.moduleGraphDirty = true` to mark the module graph as dirty when an error is detected. | ||
- Replaced `new Function('return globalThis')()` with a direct reference to `globalThis`. |
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 @@ | ||
--- | ||
"@module-federation/node": patch | ||
--- | ||
|
||
Add global flag `moduleGraphDirty` to control forced revalidation in hot-reload. | ||
|
||
- Introduced new global variable `moduleGraphDirty`. | ||
- Initialized `moduleGraphDirty` to `false` in the global scope. | ||
- Modified `revalidate` function to check `moduleGraphDirty` flag. | ||
- Forces revalidation if `moduleGraphDirty` is `true`. |
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,14 @@ | ||
--- | ||
"@module-federation/node": minor | ||
--- | ||
|
||
Enhanced hot-reload functionality with module decaching and improved type safety. | ||
|
||
- Added `callsite` package for resolving module paths. | ||
- Implemented `decache` and `searchCache` functions to remove modules from cache safely. | ||
- Ensure proper handling of relative module paths. | ||
- Avoid issues with native modules during decaching. | ||
- Refactored hot-reload logic to use the new decache functionality. | ||
- Improved type definitions and type safety throughout `hot-reload.ts`. | ||
- Properly typed function return values. | ||
- Added TypeScript annotations for better clarity. |
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,8 @@ | ||
--- | ||
"@module-federation/nextjs-mf": minor | ||
--- | ||
|
||
Added the UniverseEntryChunkTrackerPlugin to track entry chunks in the server plugin. | ||
|
||
- Applied UniverseEntryChunkTrackerPlugin in the applyServerPlugins function. | ||
- This change aims to enhance tracking of entry chunks in the server environment for hot reloading prod instances |
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
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
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
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.