-
Notifications
You must be signed in to change notification settings - Fork 27k
Generate HMR initializer code #58150
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
Conversation
josephperrott
left a comment
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.
LGTM
Reviewed-for: bazel
josephperrott
left a comment
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.
LGTM
(forgot to choose approve)
Reviewed-for: bazel
Adds the logic that will generate the `import` expression that will initializer HMR for a specific component.
ceff38e to
f1a5492
Compare
f1a5492 to
64b99bb
Compare
Adds the logic to the compiler that will output the HMR initializer code for each component, if enabled.
…-insensitive platforms We're using `path.relative` to compute a relative path between a `SourceFile` and the one of the `rootDirs`. The problem is that the `rootDirs` get passed through `getCanonicalFileName` which lowercases the path in some platforms, while `SourceFile.fileName` is always case-insensitive. This yields a path outside of the project which we were ignoring. This change passes the `SourceFile.fileName` before passing it through `path.relative` to ensure that we get a valid result.
64b99bb to
4f68307
Compare
|
This PR was merged into the repository by commit fb44323. The changes were merged into the following branches: main |
Adds the logic to the compiler that will output the HMR initializer code for each component, if enabled. PR Close #58150
…-insensitive platforms (#58150) We're using `path.relative` to compute a relative path between a `SourceFile` and the one of the `rootDirs`. The problem is that the `rootDirs` get passed through `getCanonicalFileName` which lowercases the path in some platforms, while `SourceFile.fileName` is always case-insensitive. This yields a path outside of the project which we were ignoring. This change passes the `SourceFile.fileName` before passing it through `path.relative` to ensure that we get a valid result. PR Close #58150
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Includes a couple of commits that enable the compiler to output calls that will enable HMR for component classes, as well as fix for file paths in
setClassDebugInfo.refactor(compiler): add logic to generate the HMR initializer
Adds the logic that will generate the
importexpression that will initializer HMR for a specific component.refactor(compiler-cli): output HMR initializer code
Adds the logic to the compiler that will output the HMR initializer code for each component, if enabled.
fix(compiler-cli): incorrectly generating relative file paths on case-insensitive platforms
We're using
path.relativeto compute a relative path between aSourceFileand the one of therootDirs. The problem is that therootDirsget passed throughgetCanonicalFileNamewhich lowercases the path in some platforms, whileSourceFile.fileNameis always case-insensitive. This yields a path outside of the project which we were ignoring.This change passes the
SourceFile.fileNamebefore passing it throughpath.relativeto ensure that we get a valid result.