-
-
Notifications
You must be signed in to change notification settings - Fork 301
fix: normalize bundler runtime import paths #1997
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
Merged
ScriptedAlchemy
merged 4 commits into
module-federation:main
from
jonthomp:fix/normalize-bundler-runtime-import-paths
Feb 1, 2024
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a2c79d9
fix: normalize bundler runtime import paths
jonthomp 55d5480
Merge branch 'module-federation:main' into fix/normalize-bundler-runt…
jonthomp d2b1d7e
fix: rejoin webpack path so it includes drive and path on windows
jonthomp 18dad3d
Merge branch 'main' into fix/normalize-bundler-runtime-import-paths
ScriptedAlchemy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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/enhanced': patch | ||
--- | ||
|
||
normalize bundler runtime import paths |
This file contains hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use path.normalize here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah can we look at that? otherwise theres also a normalize webpack path function in this codebase it think, for us to resolve the right webpack.
@2heal1 is that right or should we implement this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did try a path.normalize in the normalizWebpackPath util but it apparently was not working, I'll have another look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've just double checked, normalizeWebpackPath isn't used for these paths, they're @module-federation modules not webpack.
path.normalize considers the path as already being valid so makes no changes. We tried some different methods but this is the only way we could generate paths that also work on Windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gotcha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, i miss to test the function in Windows, much appreciated for modifying this @jonthomp !
And i need to test the modify can be worked as expect in our codebase. I will test it today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@2heal1 happy to help!
Sorry I also missed the remaining Windows fix that we have in a patch. I have now added it to this PR.
On Windows, the line
webpackLocationWithDetail.split(':').slice(0, -2)[0]
returnsC
because the path is split into['C', 'some\path\to\webpack']