@angular/material entry-point causes very slow builds with Ivy
See original GitHub issueReproduction
Steps to reproduce:
yarn global add @angular-cli@next
ng new foo --enable-ivy
ng add @angular/material
ng generate @angular/material:nav my-navbar
ng build
Expected Behavior
What behavior were you expecting to see?
ngcc
will compile just a handful of entrypoints needed for the navbar. This should take just a few seconds.
Actual Behavior
What behavior did you actually see?
ngcc
compiles all entrypoints within the @angular/material package as well as some/all entry-points within @angular/cdk package.
This delays the initial build by as much as 2 minutes.
Environment
- Angular: 8.1.0-next.0
- CDK/Material: 8.0.2
- Browser(s):
- Operating System (e.g. Windows, macOS, Ubuntu):
Proposed solution
- update schematics to use deep secondary entry-points instead of the main entry point
import { MatToolbarModule, MatButtonModule, MatSidenavModule, MatIconModule, MatListModule } from '@angular/material';
- execute migration to secondary entry-points and remove the @angular/material entry-point
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (6 by maintainers)
Top Results From Across the Web
Angular with Ivy — Build performance review
Ivy helps with both builds, saving 1 minute of build time — that's a nice improvement. Moreover, it reduces gap:
Read more >Upgrade from Angular 8 to v12 causing "Generating browser ...
Here is the error that ng serve is spitting out. I get the same error for ng build as well. ⠋ Generating browser...
Read more >Improve SPA performance by splitting your Angular libraries in ...
Since they can be used in many places, performance is a critical aspect. A library that doesn't perform can slow down multiple applications!...
Read more >Glossary - Angular
Angular has its own vocabulary. Most Angular terms are common English words or computing terms that have a specific meaning within the Angular...
Read more >What's new in Angular CLI 8.2? | Ninja Squad
You may wonder why this is interesting . Well, with the former configuration and under certain conditions, the TypeScript compiler would ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The related deprecation guidelines were discussed in today’s sync.
Perhaps since these are not changes to the APIs and only changes to the paths of the imports, this may not require 2 majors before removal?
The schematics have been already updated to use the secondary entry-points. For reference: https://github.com/angular/components/commit/b823dbd8b66db47e5f7d0a646020e9f77e87c270