-
Notifications
You must be signed in to change notification settings - Fork 24.7k
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
fix(compiler-cli): handle default imports in defer blocks #53695
Conversation
return ts.isImportSpecifier(node) ? node.parent!.parent!.parent! : | ||
ts.isNamespaceImport(node) ? node.parent.parent : | ||
null; | ||
let parent = node.parent; |
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 could've special-cased default imports here like we had it before, but I think that this is a bit more robust.
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.
Looks great, thanks for the fix 👍
As discussed offline, we are marking this PR as blocked for now to land PR #53591, which refactors/moves those parts of the logic, so it'd be harder to rebase.
11a2ebb
to
1da4f7c
Compare
These changes should be unblocked now. |
packages/compiler-cli/src/ngtsc/annotations/component/src/handler.ts
Outdated
Show resolved
Hide resolved
Fixes that `@defer` blocks weren't recognizing default imports and generating the proper code for them. Default symbols need to be accessed through the `default` property in the `import` statement, rather than by their name.
1da4f7c
to
b0d55b2
Compare
Fixes that `@defer` blocks weren't recognizing default imports and generating the proper code for them. Default symbols need to be accessed through the `default` property in the `import` statement, rather than by their name. PR Close #53695
This PR was merged into the repository by commit 95dcf5f. |
…ls in defer blocks This commit addresses a problem with PR angular#53695 that introduced support for default imports, where the actual dynamic import used in the defer loading function continued to use the symbol name, instead of `.default` for the dynamic import. This issue went unnoticed in the testcase because a proper instance was being generated for the `ɵsetClassMetadataAsync` function, but not the generated dependency loader function. Fixes angular#54491
…ls in defer blocks This commit addresses a problem with PR angular#53695 that introduced support for default imports, where the actual dynamic import used in the defer loading function continued to use the symbol name, instead of `.default` for the dynamic import. This issue went unnoticed in the testcase because a proper instance was being generated for the `ɵsetClassMetadataAsync` function, but not the generated dependency loader function. Fixes angular#54491
…ls in defer blocks (#54495) This commit addresses a problem with PR #53695 that introduced support for default imports, where the actual dynamic import used in the defer loading function continued to use the symbol name, instead of `.default` for the dynamic import. This issue went unnoticed in the testcase because a proper instance was being generated for the `ɵsetClassMetadataAsync` function, but not the generated dependency loader function. Fixes #54491 PR Close #54495
…ls in defer blocks (#54495) This commit addresses a problem with PR #53695 that introduced support for default imports, where the actual dynamic import used in the defer loading function continued to use the symbol name, instead of `.default` for the dynamic import. This issue went unnoticed in the testcase because a proper instance was being generated for the `ɵsetClassMetadataAsync` function, but not the generated dependency loader function. Fixes #54491 PR Close #54495
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. |
Fixes that
@defer
blocks weren't recognizing default imports and generating the proper code for them. Default symbols need to be accessed through thedefault
property in theimport
statement, rather than by their name.