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 scope and injector issues in local compilation mode #51819
Conversation
...piler-cli/test/compliance/test_cases/r3_compiler_compliance/ng_modules/empty_fields.local.js
Outdated
Show resolved
Hide resolved
...er-cli/test/compliance/test_cases/r3_compiler_compliance/ng_modules/imports_exports.local.js
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/annotations/component/src/handler.ts
Outdated
Show resolved
Hide resolved
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 conceptually. just some comments + from Kristiyan
...er-cli/test/compliance/test_cases/r3_compiler_compliance/ng_modules/imports_exports.local.js
Outdated
Show resolved
Hide resolved
00f91b7
to
7e768ea
Compare
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. Not sure if it's necessary to address the nit (new presubmit etc)-no need to request re-review from my end
packages/compiler-cli/src/ngtsc/annotations/ng_module/src/handler.ts
Outdated
Show resolved
Hide resolved
…e when imports/exports are non-array expressions Current implementation assumes that NgModule imports/exports fields are always arrays and thus it concats them for the injector definition. But this is not always the case and imports/exports could be non-arrays such as const variable. Such pattern happens in g3 and so must be addressed.
…n local compilation mode Currently the compiler in local mode assumes that the standalone component imports are array expressions. This is not always true as they can be const variables as well. This change allow non-array expressions for standalone component imports field and passes that expression to the downstream tools such as deps tracker to compute the component's deps in runtime.
…cal compilation mode Standalone component need to include the imported NgModules as part of their dependencies in order to be able to use the injection tokens coming from these NgModules. To do so, in this change the imported NgModules are included in the standalone component compilation scope.
7e768ea
to
6431238
Compare
This PR was merged into the repository by commit b44533b. |
…n local compilation mode (#51819) Currently the compiler in local mode assumes that the standalone component imports are array expressions. This is not always true as they can be const variables as well. This change allow non-array expressions for standalone component imports field and passes that expression to the downstream tools such as deps tracker to compute the component's deps in runtime. PR Close #51819
…cal compilation mode (#51819) Standalone component need to include the imported NgModules as part of their dependencies in order to be able to use the injection tokens coming from these NgModules. To do so, in this change the imported NgModules are included in the standalone component compilation scope. PR Close #51819
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. |
…e when imports/exports are non-array expressions (angular#51819) Current implementation assumes that NgModule imports/exports fields are always arrays and thus it concats them for the injector definition. But this is not always the case and imports/exports could be non-arrays such as const variable. Such pattern happens in g3 and so must be addressed. PR Close angular#51819
…n local compilation mode (angular#51819) Currently the compiler in local mode assumes that the standalone component imports are array expressions. This is not always true as they can be const variables as well. This change allow non-array expressions for standalone component imports field and passes that expression to the downstream tools such as deps tracker to compute the component's deps in runtime. PR Close angular#51819
…cal compilation mode (angular#51819) Standalone component need to include the imported NgModules as part of their dependencies in order to be able to use the injection tokens coming from these NgModules. To do so, in this change the imported NgModules are included in the standalone component compilation scope. PR Close angular#51819
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information