-
Notifications
You must be signed in to change notification settings - Fork 12k
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
feat(@schematic/angular): enable ivy in tests #15044
Conversation
This relates to #14547. With this option your are indeed optioning in to use ngcc but ts transpiration still happens using tsc and not ngtsc. Is this what we want? Ie, still using JIT builds during tests? Should we have an AOT option to run tests in ivy and transpile using ngtsc, or always AOT, or always JIT? |
Yes, we still want unit tests to run with JIT. We just want to ensure that ngcc is ran if needed. For instance if you make a new project and run tests before build. Or if you have some angular libs only on test. As to having the flag on the spec tsconfig or root tsconfig.... if we have them in individual tsconfigs it will be harder for the user to opt-in or opt back out. And in general we don't really expend a lot of testing in making sure mixed Ivy/VE environments are working properly. So maybe we should instead have it only on the workspace tsconfig and be done with it. That way it's a single config change. If you really need to have a non-Ivy project, you can opt-out in their leaf tsconfigs too. At this point I'm kicking myself for not thinking about this earlier. https://angular.io/guide/ivy would also need to change to mention the workspace tsconfig. |
I do agree with having the option in the workspace tsconfig. Another option would be to have the Though with the first approach, a user is not creating an ivy application but rather an ivy workspace. Ie: the Adding the option in the workspace config will also break |
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.
@cexbrayat, we will go ahead with this.
Can you please fix the commit msg scope to @schematics/angular
?
Thanks.
If a project is generated with `enableIvy`, this commit adds the necessary configuration to `tsconfig.spec.json` to then run the tests with Ivy. Note that the CLI already does the correct work (runs `ngcc` and then runs the tests).
f1ba186
to
17bf7ee
Compare
@alan-agius4 👍 Done |
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. |
If a project is generated with
enableIvy
, this commit adds the necessary configuration totsconfig.spec.json
to then run the tests with Ivy. Note that the CLI already does the correct work (runsngcc
and then runs the tests).cc @filipesilva as we talked about it on Slack