refactor(compiler): support local compilation for @defer blocks#53591
Closed
AndrewKushnir wants to merge 9 commits intoangular:mainfrom
Closed
refactor(compiler): support local compilation for @defer blocks#53591AndrewKushnir wants to merge 9 commits intoangular:mainfrom
AndrewKushnir wants to merge 9 commits intoangular:mainfrom
Conversation
2 tasks
98906ee to
170527b
Compare
170527b to
d53f5b9
Compare
alxhub
reviewed
Jan 8, 2024
packages/compiler-cli/src/ngtsc/annotations/component/src/handler.ts
Outdated
Show resolved
Hide resolved
alxhub
reviewed
Jan 8, 2024
alxhub
reviewed
Jan 8, 2024
packages/compiler-cli/src/ngtsc/annotations/component/src/handler.ts
Outdated
Show resolved
Hide resolved
alxhub
approved these changes
Jan 8, 2024
d53f5b9 to
faea33e
Compare
Contributor
Author
This commit updates a few places to extract the logic into a separate functions which will be reused in a few places in followup commits.
This commit updates typechecker to store full Pipe metadata in internal data strctures, so that this information is available to more places in the code, which will be updated in a followup commit.
…ide a defer block This commit updates the logic to expose an internal API on the `R3BoundTarget` to check if an element belongs to any defer block.
…ps in `@defer` for local compilation mode This commit adds an internal config option to enforce explicit deps in `@defer` for local compilation mode.
…deps config This commit updates the `DeferredSymbolTracker` class to take info account the `onlyExplicitDeferDependencyImports` flag. The `DeferredSymbolTracker` class also exposes a new API to register import declarations as explicitly deferred, which will be used in followup commits.
This commit updates the logic to add support for internal `deferredImports` field in compiler.
…and `deferredImports` This commit updates the typechecker logic to prevent same deps in `imports` and `deferredImports`.
… compilation This commit updates the logic of the `TemplateDefinitionBuilder` to support local compilation and generate a single dependency function for all explicitly deferred deps within a component.
This commit adds tests to cover local compilation support for `@defer` blocks.
atscott
pushed a commit
that referenced
this pull request
Jan 10, 2024
…deps config (#53591) This commit updates the `DeferredSymbolTracker` class to take info account the `onlyExplicitDeferDependencyImports` flag. The `DeferredSymbolTracker` class also exposes a new API to register import declarations as explicitly deferred, which will be used in followup commits. PR Close #53591
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…angular#53591) This commit updates a few places to extract the logic into a separate functions which will be reused in a few places in followup commits. PR Close angular#53591
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…angular#53591) This commit updates typechecker to store full Pipe metadata in internal data strctures, so that this information is available to more places in the code, which will be updated in a followup commit. PR Close angular#53591
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ide a defer block (angular#53591) This commit updates the logic to expose an internal API on the `R3BoundTarget` to check if an element belongs to any defer block. PR Close angular#53591
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ps in `@defer` for local compilation mode (angular#53591) This commit adds an internal config option to enforce explicit deps in `@defer` for local compilation mode. PR Close angular#53591
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…deps config (angular#53591) This commit updates the `DeferredSymbolTracker` class to take info account the `onlyExplicitDeferDependencyImports` flag. The `DeferredSymbolTracker` class also exposes a new API to register import declarations as explicitly deferred, which will be used in followup commits. PR Close angular#53591
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ngular#53591) This commit updates the logic to add support for internal `deferredImports` field in compiler. PR Close angular#53591
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…and `deferredImports` (angular#53591) This commit updates the typechecker logic to prevent same deps in `imports` and `deferredImports`. PR Close angular#53591
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
… compilation (angular#53591) This commit updates the logic of the `TemplateDefinitionBuilder` to support local compilation and generate a single dependency function for all explicitly deferred deps within a component. PR Close angular#53591
ChellappanRajan
pushed a commit
to ChellappanRajan/angular
that referenced
this pull request
Jan 23, 2024
…ion (angular#53591) This commit adds tests to cover local compilation support for `@defer` blocks. PR Close angular#53591
dylhunn
added a commit
to dylhunn/angular
that referenced
this pull request
Jan 24, 2024
In angular#53591, Andrew added local compliation support for defer blocks. However, this requires the ability to emit pre-generated static defer deps functions. We now also support that feature in Template Pipeline.
|
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. |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This commit updates Angular compiler to support local compilation mode for
@deferblocks.In local compilation mode, compiler can only rely on the information present in a currently processed file. As a result, compiler can not detect which components/directives/pipes belong to a particular
@deferblock (because that requires selector matching and selector info from other files where those classes are defined) and thus which classes can be defer-loaded. Because of this, no dependency functions are being generated for@deferblocks in the local compilation mode.Also, this commit brings extra configuration and logic to make
@deferblocks compatible with more constrained local compilation mode internally.Overall, this change does not affect the behavior and APIs of
@deferblocks externally (outside of Google's codebase) when using regular (full) compilation mode.Does this PR introduce a breaking change?