feat(compiler-cli): run JIT transform on classes with jit: true opt-out - #56892
Closed
devversion wants to merge 3 commits into
Closed
devversion wants to merge 3 commits into
devversion wants to merge 3 commits into
Conversation
devversion
force-pushed
the
run-jit-transform
branch
3 times, most recently
from
July 8, 2024 13:37
f17c64e to
a053bd3
Compare
devversion
marked this pull request as ready for review
July 8, 2024 15:24
Member
Author
|
Note: Tooling approval not needed as the signature of the function did not change. |
crisbeto
approved these changes
Jul 10, 2024
pkozlowski-opensource
approved these changes
Jul 10, 2024
…-out Currently when compiling code with the Angular compiler, all classes with Angular decorators are compiled with AOT. This includes type checking, scope collection etc. This may not be desirable for all components, e.g. dynamic components, or test components w/ `TestBed.configureTestingModule` (if compiled with ngtsc). Those components can opt out of AOT on a per component-basis via `jit: true`. This is helpful as it allows incremental migrations/refactorings to AOT. Whether we want to keep this capability long-term is something to be discussed separately. For now though, we should fix that components compiled with `jit: true` actually work as expected. Currently this **not the case** as soon as the new initializer APIs are used— as those do no longer declare class metadata with decorators. This commit runs the JIT transform on JIT-opted classes. Related: https://docs.google.com/document/d/1ox4atCJldWWDXlaYgwM-hU8BNsTpKNW7gx8OfZ0HtRY/edit?resourcekey=0-G1haTNYtD-dN0vNRkQ8_OQ&tab=t.0
This commit moves the JIT transforms into the ngtsc folder. They existed outside of ngtsc mostly as an historic artifact— and now with compiler relying on them even more deeply, it makes sense to move them into `ngtsc/transform`.
…ue` opt-out Address feedback
devversion
force-pushed
the
run-jit-transform
branch
from
July 10, 2024 11:58
a053bd3 to
c5fed09
Compare
Member
|
This PR was merged into the repository by commit 7f550ea. The changes were merged into the following branches: main |
pkozlowski-opensource
pushed a commit
that referenced
this pull request
Jul 10, 2024
This commit moves the JIT transforms into the ngtsc folder. They existed outside of ngtsc mostly as an historic artifact— and now with compiler relying on them even more deeply, it makes sense to move them into `ngtsc/transform`. PR Close #56892
|
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.
Currently when compiling code with the Angular compiler, all classes
with Angular decorators are compiled with AOT. This includes type
checking, scope collection etc.
This may not be desirable for all components, e.g. dynamic components,
or test components w/
TestBed.configureTestingModule(if compiled with ngtsc).Those components can opt out of AOT on a per component-basis via
jit: true.This is helpful as it allows incremental migrations/refactorings to AOT.
Whether we want to keep this capability long-term is something to be discussed separately.
For now though, we should fix that components compiled with
jit: trueactually work as expected. Currently this not the case as soon as
the new initializer APIs are used— as those do no longer declare class
metadata with decorators.
This commit runs the JIT transform on JIT-opted classes.