Skip to content
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

fix(material/core): reduce the number of module resolutions required for the legacy theming bundle #22687

Merged
merged 2 commits into from
May 18, 2021

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented May 13, 2021

Currently the legacy material/theming bundle is set up to forward a few top-level .import files. The problem is that those files have been auto-generated to be backwards-compatible even for deep imports which means that they have a lot of overlapping @forward and @import statements. This results in a significant increase in build times for consumers still using the old bundle.

These changes address the issue by introducing new shallower *-legacy-index.scss files which only export the APIs from the specific package and which in turn are re-exported through the top-level material/theming file. The change appears to cut the down the production build time on material.angular.io before the @use migration by more than 60%.

Fixes #22676.

@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release labels May 13, 2021
@crisbeto crisbeto requested a review from jelbourn May 13, 2021 07:41
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 13, 2021
@crisbeto crisbeto force-pushed the theming-module-resolution branch from d0bf2ce to 660aef4 Compare May 13, 2021 07:45
Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, outstanding! combined with Charles changes on CLI this will probably get everyone back to what it was before.

Caretaker note: This may require some build updates

@jelbourn jelbourn added action: merge The PR is ready for merge by the caretaker P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful and removed P2 The issue is important to a large percentage of users, with a workaround labels May 13, 2021
@jelbourn jelbourn added the merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note label May 13, 2021
@crisbeto crisbeto force-pushed the theming-module-resolution branch 2 times, most recently from 071c2cd to 152fd96 Compare May 17, 2021 20:15
crisbeto added 2 commits May 17, 2021 22:17
…for the legacy theming bundle

Currently the legacy `material/theming` bundle is set up to forward a few top-level `.import` files. The problem is that those files have been auto-generated to be backwards-compatible even for deep imports which means that they have a lot of overlapping `@forward` and `@import` statements. This results in a significant increase in build times for consumers still using the old bundle.

These changes address the issue by introducing new shallower `*-legacy-index.scss` files which only export the APIs from the specific package and which in turn are re-exported through the top-level `material/theming` file. The change appears to cut the down the production build time on material.angular.io before the @use migration by more than 60%.

Fixes angular#22676.
@crisbeto crisbeto force-pushed the theming-module-resolution branch from 152fd96 to 0b48af9 Compare May 17, 2021 20:17
@andrewseguin andrewseguin merged commit 3027f8c into angular:master May 18, 2021
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jun 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Angular 12 @Use statement causing slow compilation.
4 participants