-
Notifications
You must be signed in to change notification settings - Fork 27k
feat(compiler-cli): run JIT transform on classes with jit: true opt-out #56892
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
Conversation
f17c64e to
a053bd3
Compare
|
Note: Tooling approval not needed as the signature of the function did not change. |
packages/compiler-cli/src/ngtsc/annotations/common/src/jit_declaration_registry.ts
Outdated
Show resolved
Hide resolved
packages/compiler-cli/src/ngtsc/annotations/directive/src/handler.ts
Outdated
Show resolved
Hide resolved
…-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
a053bd3 to
c5fed09
Compare
|
This PR was merged into the repository by commit 7f550ea. The changes were merged into the following branches: main |
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. |
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.