-
Notifications
You must be signed in to change notification settings - Fork 26.5k
refactor(compiler): support local compilation for @defer blocks #53591
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
Closed
AndrewKushnir
wants to merge
9
commits into
angular:main
from
AndrewKushnir:defer_local_compilation_1
Closed
refactor(compiler): support local compilation for @defer blocks #53591
AndrewKushnir
wants to merge
9
commits into
angular:main
from
AndrewKushnir:defer_local_compilation_1
Conversation
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
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
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.
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 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
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 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
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 2024
…ngular#53591) This commit updates the logic to add support for internal `deferredImports` field in compiler. PR Close angular#53591
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 2024
…and `deferredImports` (angular#53591) This commit updates the typechecker logic to prevent same deps in `imports` and `deferredImports`. PR Close angular#53591
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 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
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 2024
…ion (angular#53591) This commit adds tests to cover local compilation support for `@defer` blocks. PR Close angular#53591
rlmestre
pushed a commit
to rlmestre/angular
that referenced
this pull request
Jan 26, 2024
…ar#54043) 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. PR Close angular#54043
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 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
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 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
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 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
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 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
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 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
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 2024
…ngular#53591) This commit updates the logic to add support for internal `deferredImports` field in compiler. PR Close angular#53591
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 2024
…and `deferredImports` (angular#53591) This commit updates the typechecker logic to prevent same deps in `imports` and `deferredImports`. PR Close angular#53591
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 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
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 2024
…ion (angular#53591) This commit adds tests to cover local compilation support for `@defer` blocks. PR Close angular#53591
amilamen
pushed a commit
to amilamen/angular
that referenced
this pull request
Jan 26, 2024
…ar#54043) 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. PR Close angular#54043
nikvarma
pushed a commit
to nikvarma/angular
that referenced
this pull request
Jan 31, 2024
…ar#54043) 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. PR Close angular#54043
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
action: merge
The PR is ready for merge by the caretaker
area: compiler
Issues related to `ngc`, Angular's template compiler
area: core
Issues related to the framework runtime
core: defer
Issues related to @defer blocks.
merge: caretaker note
Alert the caretaker performing the merge to check the PR for an out of normal action needed or note
target: rc
This PR is targeted for the next release-candidate
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
@defer
blocks.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
@defer
block (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@defer
blocks in the local compilation mode.Also, this commit brings extra configuration and logic to make
@defer
blocks compatible with more constrained local compilation mode internally.Overall, this change does not affect the behavior and APIs of
@defer
blocks externally (outside of Google's codebase) when using regular (full) compilation mode.Does this PR introduce a breaking change?