question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@angular/material entry-point causes very slow builds with Ivy

See original GitHub issue

Reproduction

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:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
Splaktarcommented, Jul 11, 2019

The related deprecation guidelines were discussed in today’s sync.

Deprecation period: When an API or a feature is deprecated, it will still be present in the next two major releases. After that, deprecated APIs and features will be candidates for removal.

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?

1reaction
devversioncommented, Jul 11, 2019

The schematics have been already updated to use the secondary entry-points. For reference: https://github.com/angular/components/commit/b823dbd8b66db47e5f7d0a646020e9f77e87c270

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found