You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ts-jest with cleared cache is reading package.json in node_modules over and over - start takes forever #16703
I just updated to ts-jest@23.10.5 from somewhere around ~23.1.3 which increased the runtime of my test suite from 10ish seconds [on the first run / with cleared cache] to over 40 seconds - with cache around 2.5s.
It's possible that this is a ts-jest (or even typescript) issue BUT after I created a demo-repository I realized that the problem went away after I removed ionic from the project.
So ionic probably has something to do with it.
Ionic version:
[x] 4.x
Current behavior:
The initial start of jest takes around 30 seconds on an almost empty repository with ionic included.
Expected behavior:
The initial start of jest shouldn't take that long.
Steps to reproduce:
Have js files that need to be processed by ts-jest (as they contain import statements) being present in one of the modules you import
have ts-jest@>=23.10.1
import the IonicModule in one of you angular modules
git clone git@gitlab.com:Farbdose/ts-jest-multiple-fileread.git
npm install && npm run test
Other information:
You can find the original issue at kulshekhar/ts-jest#908
Possibly related #15695: I had to use the fix described there to actually get jest running at all.
Ionic info:
[WARN] You are not in an Ionic project directory. Project context may be missing.
Ionic:
ionic (Ionic CLI) : 4.3.1
System:
NodeJS : v8.11.2
npm : 6.1.0
OS : Linux 4.15
Update: I played a bit around and wrote a very basic [destructive] cache into getPackageJsonInfo see here ...which got the time down to around 24s again.
The interesting thing though is, that after that I got a much clearer cpu profile: CPU-20181218T162138.zip
Update3:@paulstelzer This was caused by a combination of uncached file reads and now by default enabled language services in ts-jest. It has nothing to do with ionic, ionic was just the package with the most require-statements / separate modules in node_modules.
@paulstelzer I think the only thing you could have realistically done is what you alread did: remove the icons from the build chain. ts-jest was probably reading the package.json again and again for each icon...
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.
Activity
Farbdose commentedon Dec 18, 2018
Update: I played a bit around and wrote a very basic [destructive] cache into
getPackageJsonInfosee here ...which got the time down to around 24s again.The interesting thing though is, that after that I got a much clearer cpu profile:
CPU-20181218T162138.zip
Farbdose commentedon Dec 20, 2018
Update2: I updated the demo repository to ionic 4.0.0-rc.0 and typescript to 3.2.2.
It now takes around 45 seconds in the gitlab build pipeline so if anybody wants to try his luck, you are welcome.
Farbdose commentedon Jan 9, 2019
Update3: @paulstelzer This was caused by a combination of uncached file reads and now by default enabled language services in ts-jest. It has nothing to do with ionic, ionic was just the package with the most require-statements / separate modules in node_modules.
paulstelzer commentedon Jan 9, 2019
so this can be closed now?
Farbdose commentedon Jan 9, 2019
@paulstelzer yes
paulstelzer commentedon Jan 9, 2019
Thank you for the resarch :)
Farbdose commentedon Jan 9, 2019
@paulstelzer I think the only thing you could have realistically done is what you alread did: remove the icons from the build chain. ts-jest was probably reading the package.json again and again for each icon...
ionitron-bot commentedon Feb 8, 2019
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.