-
Notifications
You must be signed in to change notification settings - Fork 309
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
[Bug (Angular 13)]: Transforming @angular/
modules is slow
#1141
Comments
I think in this case we can use Edited: we will go with |
ahnpnl
added
🐛 Bug
Confirmed
Bug is confirmed
and removed
Bug Report
Needs Triage
labels
Nov 6, 2021
2 tasks
@ahnpnl can you publish a new RC for this change? |
11.0.0-rc.2 is out now. |
Wow @ahnpnl, fantastic job! Thank you so much! 🎉 We'll test it out! 😄 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
11.0.0-rc.1
Steps to reproduce
https://github.com/FrozenPandaz/nx-bugs/blob/ng13-jest/apps/app1/jest.config.js#L14
git checkout ng13-jest
jest apps/app1
apps/app1/jest.config.js
.. There's 3 lines with different transformers formjs
filesjest-preset-angular
console.time
into the transformer and analyze the timingsExpected behavior
Transforming Angular is unfortunate... but ideally.. it should be faster than it is..
Actual behavior
Here are some logs from my machine with a fast processor (Ryzen 9 3900X)
Analysis
jest-preset-angular
transform is good for source code.. but for the.mjs
files shipped by Angular.. we shouldn't need a full typescript compilation to transform it to be compatible withjest
.For starters,
babel
can be used to downlevel the modules. Unfortunately.. this doesn't actually cut down on the time that much..To be ambitious...
swc
can be used... and this cuts down on the time tremendouslyTimings
Using jest-preset-angular
Using Babel
Using SWC
Additional context
Hey all, we've been testing the RC of
jest-preset-angular
with Angular 13 support and noticed that transforming the@angular
packages is really slow.. adding around 6s just to transform Angular (for each project)Environment
Suggest Solution
There's already a separate block for
.mjs
files... I see it does a light typescript compilation.. what about switching it over to... eitherbabel
or ambitiously...swc
?Alternatively.. is there an even cheaper typescript transpilation that we can do?
The text was updated successfully, but these errors were encountered: