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

Angular 12 @Use statement causing slow compilation. #22676

Closed
ganySA opened this issue May 12, 2021 · 14 comments · Fixed by #22687
Closed

Angular 12 @Use statement causing slow compilation. #22676

ganySA opened this issue May 12, 2021 · 14 comments · Fixed by #22687
Assignees
Labels
area: theming P2 The issue is important to a large percentage of users, with a workaround

Comments

@ganySA
Copy link

ganySA commented May 12, 2021

Please see the link angular/angular-cli#20713

The new theme API is really slow slow and problematic.

It seems related by the move to @use '~@angular/material'
statements. My compilation time with CLI has increased 5x, i am also experiencing node memory issues. Reverting back to 11 does not have this issue.

I have engaged with the CLI team but it seems this issue is material related.

@ganySA ganySA added the needs triage This issue needs to be triaged by the team label May 12, 2021
@crisbeto
Copy link
Member

crisbeto commented May 12, 2021

We noticed something similar while we were testing out the migration, but the issues usually went away once we migrated all remaining imports of @angular/material/theming to @angular/material. Can you check if you have any remaining usages of @import '~@angular/material/theming' in your codebase that might not have been caught by the migration?

@jelbourn jelbourn changed the title bug(COMPONENT): Angular 12 @Use statement causing slow compilation. Angular 12 @Use statement causing slow compilation. May 12, 2021
@jelbourn
Copy link
Member

jelbourn commented May 12, 2021

Chatting with the CLI team, it seems like the webpack Sass loader is (at least) a part of the problem here, since it doesn't do any caching of module resolution, causing it to re-resolve the same modules over and over. The CLI team is looking into improving Sass loading.

@jelbourn jelbourn added area: theming P2 The issue is important to a large percentage of users, with a workaround and removed needs triage This issue needs to be triaged by the team labels May 12, 2021
@alan-agius4
Copy link
Contributor

Chatting with the CLI team, it seems like the webpack Sass loader is (at least) a big part of the problem here, since it doesn't do any cache of module resolution, causing it to re-resolve the same modules over and over. The CLI team is looking into fixing the loader.

Actually most of the resolutions (the relative once) happens inside dart-sass and therefore we cannot cache them. That said we are looking into improving the sass compilation times in general by using the sync version of dart-sass angular/angular-cli#20740

@jelbourn
Copy link
Member

Got it, I likely misunderstood Keen yesterday.

I chatted with @crisbeto just now and he's going to look into also cutting down the number of module resolutions in general.

For anyone coming to this issue: we're hoping to land improvements in a patch release follow-up to 12.0.0.

@crisbeto crisbeto self-assigned this May 12, 2021
@Splaktar
Copy link
Member

Can you please provide the exact version of Angular Material and Angular CDK that

  • is in use now
  • was used to run the initial migration

12.0.0-rc.3 included a number of improvements to the Sass migration as mentioned in https://github.com/angular/components/blob/12.0.x/CHANGELOG.md#1200-rc3-resin-ensign-2021-05-11

Did you run https://sass-lang.com/documentation/cli/migrator on your project at all?

@ganySA
Copy link
Author

ganySA commented May 12, 2021

Hi
I used version 12.0.0-rc.2 and ran ng g @angular/material:themingApi
I now use 12.0.0-rc.3.

I did not use the sass migrator at all.

@crisbeto
Copy link
Member

That's where things could've been messed up. Between rc.2 and rc.3 we fixed several cases that the migration didn't catch and we moved it from ng generate to ng update. It might be worth trying again once v12 final comes out later today.

@jelbourn
Copy link
Member

I chatted with the Sass team a bit today too, and they have sass/sass#2745 which tracks not caching stuff between compilations. They're going to starting investigating to see how much work it would be to add support for more caching.

@jelbourn
Copy link
Member

@ganySA are you able to share a reproduction? It would be useful for someone on the Sass team to see a real-world scenario related to sass/sass#2745

crisbeto added a commit to crisbeto/material2 that referenced this issue May 13, 2021
…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.
@ganySA
Copy link
Author

ganySA commented May 13, 2021

@jelbourn let me know who and i can share the repo they can then build. Do you need it pre update or post?

@alan-agius4
Copy link
Contributor

@crisbeto, I don't think the mentioned PR solved this issue. @ganySA is using the new API, ie: @use ~@angular/material

Timings using the new API (v12.0.0-rc.2)

File Compilation Duration
src/app/modules/components/confirmation-dialog/confirmation-dialog.component.scss 198.585ms
src/app/modules/components/business-selector/business-selector.component.scss 226.805ms
src/app/modules/components/calendar-view-selector/calendar-view-selector.component.scss 113.614ms
src/app/modules/components/appointment-tags/appointment-tag.component.scss 116.932ms
src/app/app.component.scss 605.148ms
src/app/layout/layout.component.scss 605.658ms
src/app/modules/components/location-list/location-list.component.scss 190.462ms
src/app/modules/components/loading-indicator/loading-indicator.component.scss 181.293ms
src/app/modules/components/status-reason-selector/status-reason.component.scss 312.058ms
src/app/modules/components/time-input/time-input.component.scss 213.569ms
src/app/modules/components/calendar-navigator/calendar-navigator.component.scss 382.951ms
src/app/modules/components/calendar-datepicker-mobile/calendar-datepicker-mobile.component.scss 262.115ms
src/app/modules/components/staff-schedule-online/staff-schedule-online.component.scss 279.454ms
src/app/modules/components/business-image-upload/business-image-upload.component.scss 330.490ms
src/app/modules/components/telephone-input/telephone-input.component.scss 706.046ms
src/app/modules/components/staff-list/staff-list.component.scss 158.073ms
src/app/modules/components/staff-schedule-online/new-popup/new-popup.component.scss 326.035ms
src/app/modules/components/service-list/service-list.component.scss 332.479ms
src/styles/vendors.scss 151.641ms
src/styles/styles.scss 415.450ms
src/app/modules/secure/calendar/scheduler/scheduler.component.scss 20.837ms
src/app/modules/secure/client/client.component.scss 45.149ms
src/app/modules/secure/calendar/calendar.component.scss 55.514ms
src/app/modules/secure/user/user.component.scss 15.825ms
src/app/modules/secure/notifications/notification.component.scss 65.766ms
src/app/modules/secure/business/business.component.scss 70.902ms
src/app/modules/secure/calendar/edit-appointment/edit-appointment.component.scss 93.290ms
src/app/modules/secure/calendar/calendar-popup-new/calendar-popup-new.component.scss 206.218ms
src/app/modules/secure/calendar/calendar-settings/calendar-settings.component.scss 97.512ms
src/app/modules/secure/calendar/date-selector/date-selector.component.scss 362.114ms
src/app/modules/secure/calendar/calendar-popup/calendar-popup.component.scss 435.449ms
src/app/modules/secure/calendar/date-selector-mobile/date-selector-mobile.component.scss 133.737ms
src/app/modules/secure/calendar/duplicate-check/duplicate-check.component.scss 108.342ms
src/app/modules/secure/calendar/client-mini-details/client-mini-details.component.scss 149.841ms
src/app/modules/secure/calendar/color-picker/color-picker.component.scss 125.083ms
src/app/modules/secure/calendar/calendar-datepicker/calendar-datepicker.component.scss 117.458ms
src/app/modules/secure/user/business-hours/business-hours.component.scss 21.889ms
src/app/modules/secure/locations/add/location.add.component.scss 23.833ms
src/app/modules/secure/staff/add/staff.add.component.scss 21.454ms
src/app/modules/secure/locations/edit/location.edit.component.scss 26.471ms
src/app/modules/secure/business/business-hours/business-hours.component.scss 16.122ms
src/app/modules/secure/staff/edit/staff.edit.component.scss 21.279ms
src/app/modules/secure/notifications/smsconfig/sms-config.component.scss 151.573ms
src/app/modules/secure/notifications/notification-setup/notifications-setup.component.scss 152.955ms
src/app/modules/secure/services/add/services.add.component.scss 65.949ms
src/app/modules/secure/services/edit/services.edit.component.scss 79.619ms
src/app/modules/secure/notifications/emailconfig/email-config.component.scss 92.453ms
src/app/modules/secure/sharing/add/sharing.add.component.scss 52.050ms
src/app/modules/secure/sharing/edit/sharing.edit.component.scss 52.332ms
src/app/modules/secure/tags/add/tags.add.component.scss 83.224ms
src/app/modules/secure/tags/edit/tags.edit.component.scss 89.021ms
src/app/modules/secure/invoice/list/list.component.scss 71.595ms
src/app/modules/secure/invoice/wizard/wizard.invoice.new.component.scss 93.790ms
src/app/modules/secure/invoice/print/invoice.print.component.scss 119.982ms
src/app/modules/secure/invoice/add/invoice.add.component.scss 131.744ms
src/app/modules/secure/invoice/edit/invoice.edit.component.scss 169.018ms
src/app/modules/secure/dashboards/finance/finance.component.scss 38.295ms
src/app/modules/secure/dashboards/analytics/analytics.component.scss 37.294ms
src/app/modules/components/app-avatar-icon/avatar-icon/avatar-icon.component.scss 145.442ms
src/app/modules/secure/client/tabs/client-details-tab/client-details-tab.component.scss 163.914ms
src/app/modules/secure/business/tabs/billing/billing.component.scss 34.583ms
src/app/modules/components/invoice-components/invoice-status-chip/invoice-status-chip.component.scss 24.063ms
src/app/modules/components/invoice-components/invoice-status-selector/invoice-status-selector.component.scss 14.705ms
src/app/modules/secure/invoice/components/invoice-line-items-medical/invoice-line-items-medical.component.scss 14.502ms
src/app/modules/secure/invoice/components/invoice-line-items-standard/invoice-line-items-standard.component.scss 100.924ms
src/app/modules/secure/user/tabs/basic/user-basic-tab.component.scss 33629.968ms
src/app/modules/secure/business/tabs/basic/basic.component.scss 33630.795ms
src/app/modules/landing/home/home.component.scss 38404.535ms
src/app/modules/auth/forgot-password/forgot-password.component.scss 39747.032ms
src/app/modules/auth/reset-password/reset-password.component.scss 39744.085ms
src/app/modules/auth/unlock-session/unlock-session.component.scss 39297.822ms
src/app/modules/auth/zoom-register/zoom-register.component.scss 38550.229ms
src/app/modules/secure/contacts/contacts.component.scss 38307.074ms
src/app/modules/secure/locations/locations.component.scss 38105.035ms
src/app/modules/secure/staff/staff.component.scss 38104.543ms
src/app/modules/secure/services/services.component.scss 38053.263ms
src/app/modules/secure/sharing/sharing.component.scss 38052.244ms
src/app/modules/secure/invoice/invoice.component.scss 37910.515ms
src/app/modules/secure/tags/tags.component.scss 37874.639ms
src/app/modules/auth/confirmation-required/confirmation-required.component.scss 39770.821ms
src/app/modules/auth/sign-up/sign-up.component.scss 39420.359ms
src/app/modules/auth/sign-out/sign-out.component.scss 39345.798ms
src/app/modules/auth/sign-in/sign-in.component.scss 39348.430ms
src/app/layout/layouts/empty/empty.component.scss 42415.832ms
src/app/modules/pages/coming-soon/coming-soon.component.scss 38610.130ms
src/app/modules/components/client-search-box/client-search-box.component.scss 40448.352ms
src/app/modules/secure/calendar/search-box/search-box.component.scss 36134.033ms
src/app/modules/secure/example/example.component.scss 38421.690ms
src/app/modules/secure/calendar/calendar-selector/calendar-selector.component.scss 36248.072ms
src/app/modules/pages/maintenance/maintenance.component.scss 38570.811ms
src/app/modules/pages/errors/error-404/error-404.component.scss 38554.954ms
src/app/modules/pages/errors/error-500/error-500.component.scss 38553.552ms
src/app/modules/secure/client/tabs/messages/messages.component.scss 34230.820ms
src/app/modules/secure/business/tabs/features/features.component.scss 33859.935ms
src/app/modules/secure/calendar/client-fields/client-fields.component.scss 36342.120ms
src/app/modules/secure/client/tabs/appointments/appointments.component.scss 34247.793ms
src/app/modules/pages/help-center/guides/category/category.component.scss 38687.341ms
src/@calendar5/components/card/card.component.scss 42434.489ms
src/app/modules/secure/dashboards/crypto/crypto.component.scss 34497.085ms
src/app/modules/pages/help-center/faqs/faqs.component.scss 38779.186ms
src/app/modules/secure/invoice/components/add-invoice-item/add-invoice-item.component.scss 33814.726ms
src/app/modules/secure/calendar/client-form-search/client-form-search.component.scss 36463.357ms
src/app/modules/pages/help-center/support/support.component.scss 38808.181ms
src/app/modules/components/status-reason-selector/status-reason.dialog.component.scss 42313.379ms
src/app/modules/pages/help-center/guides/guides.component.scss 38910.350ms
src/@calendar5/components/navigation/horizontal/horizontal.component.scss 42559.517ms
src/app/modules/secure/calendar/recurrence/recurrence.component.scss 36499.784ms
src/app/layout/layouts/vertical/classic/classic.component.scss 42690.839ms
src/app/modules/pages/help-center/guides/guide/guide.component.scss 38959.869ms
src/app/modules/pages/help-center/help-center.component.scss 39065.089ms
src/app/modules/components/invoice-components/invoice-list/invoice-list.component.scss 34193.163ms
src/app/modules/secure/contacts/list/list.component.scss 38443.885ms
src/app/modules/secure/tags/list/list.component.scss 35588.145ms
src/app/modules/secure/locations/list/list.component.scss 36520.808ms
src/app/layout/layouts/vertical/basic/basic.component.scss 42850.519ms
src/app/modules/secure/services/list/list.component.scss 35997.477ms
src/app/modules/secure/sharing/list/list.component.scss 35789.004ms
src/app/modules/secure/staff/list/list.component.scss 36378.323ms
src/app/layout/common/shortcuts/shortcuts.component.scss 42949.068ms
src/app/layout/common/notifications/notifications.component.scss 43029.700ms
src/app/layout/common/messages/messages.component.scss 43256.641ms
src/app/modules/pages/pricing/simple/simple.component.scss 39143.596ms
src/app/modules/pages/pricing/single/single.component.scss 39133.973ms
src/app/modules/pages/pricing/modern/modern.component.scss 39195.011ms
src/app/layout/common/search/search.component.scss 43135.907ms
src/app/modules/pages/pricing/table/table.component.scss 39152.263ms
src/app/layout/common/user/user.component.scss 43100.358ms
src/app/modules/secure/contacts/details/details.component.scss 38779.435ms
src/@calendar5/components/navigation/vertical/vertical.component.scss 43053.855ms
src/@calendar5/components/message/message.component.scss 43156.939ms
src/@calendar5/styles/main.scss 48927.366ms

Timings using the old API (v11.2.12)

File Compilation Duration
src/app/app.component.scss 46.809ms
src/app/layout/layout.component.scss 4.297ms
src/app/modules/components/confirmation-dialog/confirmation-dialog.component.scss 2.285ms
src/app/modules/components/calendar-navigator/calendar-navigator.component.scss 10.733ms
src/app/modules/components/business-selector/business-selector.component.scss 1.758ms
src/app/modules/components/telephone-input/telephone-input.component.scss 124.812ms
src/app/modules/components/status-reason-selector/status-reason.component.scss 9.786ms
src/app/modules/components/location-list/location-list.component.scss 2.804ms
src/app/modules/components/business-image-upload/business-image-upload.component.scss 7.583ms
src/app/modules/components/loading-indicator/loading-indicator.component.scss 2.042ms
src/app/modules/components/calendar-datepicker-mobile/calendar-datepicker-mobile.component.scss 7.349ms
src/app/modules/components/time-input/time-input.component.scss 2.419ms
src/app/modules/components/calendar-view-selector/calendar-view-selector.component.scss 1.479ms
src/app/modules/components/appointment-tags/appointment-tag.component.scss 1.544ms
src/app/modules/components/staff-schedule-online/staff-schedule-online.component.scss 6.648ms
src/app/modules/components/staff-schedule-online/new-popup/new-popup.component.scss 89.017ms
src/app/modules/components/staff-list/staff-list.component.scss 4.024ms
src/app/modules/components/service-list/service-list.component.scss 2.427ms
src/styles/styles.scss 55.603ms
src/styles/vendors.scss 3.815ms
src/styles/tailwind.scss 1.791ms
src/app/modules/secure/calendar/calendar.component.scss 2.497ms
src/app/modules/secure/user/user.component.scss 1.663ms
src/app/modules/secure/calendar/scheduler/scheduler.component.scss 1.848ms
src/app/modules/secure/client/client.component.scss 2.327ms
src/app/modules/secure/business/business.component.scss 1.932ms
src/app/modules/secure/notifications/notification.component.scss 2.207ms
src/app/modules/secure/calendar/calendar-popup-new/calendar-popup-new.component.scss 58.354ms
src/app/modules/secure/calendar/edit-appointment/edit-appointment.component.scss 7.838ms
src/app/modules/secure/calendar/calendar-popup/calendar-popup.component.scss 46.232ms
src/app/modules/secure/calendar/calendar-settings/calendar-settings.component.scss 1.715ms
src/app/modules/secure/calendar/date-selector/date-selector.component.scss 47.810ms
src/app/modules/secure/calendar/date-selector-mobile/date-selector-mobile.component.scss 1.751ms
src/app/modules/secure/calendar/color-picker/color-picker.component.scss 5.296ms
src/app/modules/secure/calendar/client-mini-details/client-mini-details.component.scss 2.980ms
src/app/modules/secure/calendar/duplicate-check/duplicate-check.component.scss 2.031ms
src/app/modules/secure/calendar/calendar-datepicker/calendar-datepicker.component.scss 4.748ms
src/app/modules/secure/locations/edit/location.edit.component.scss 1.666ms
src/app/modules/secure/user/business-hours/business-hours.component.scss 1.176ms
src/app/modules/secure/locations/add/location.add.component.scss 1.831ms
src/app/modules/secure/staff/add/staff.add.component.scss 1.666ms
src/app/modules/secure/staff/edit/staff.edit.component.scss 1.685ms
src/app/modules/secure/business/business-hours/business-hours.component.scss 1.345ms
src/app/modules/secure/notifications/notification-setup/notifications-setup.component.scss 1.915ms
src/app/modules/secure/notifications/sms config/sms
src/app/modules/secure/notifications/emailconfig/email-config.component.scss 3.880ms
src/app/modules/secure/services/add/services.add.component.scss 1.736ms
src/app/modules/secure/services/edit/services.edit.component.scss 1.592ms
src/app/modules/secure/sharing/add/sharing.add.component.scss 1.823ms
src/app/modules/secure/sharing/edit/sharing.edit.component.scss 2.737ms
src/app/modules/secure/tags/edit/tags.edit.component.scss 1.699ms
src/app/modules/secure/tags/add/tags.add.component.scss 1.518ms
src/app/modules/secure/invoice/add/invoice.add.component.scss 10.742ms
src/app/modules/secure/invoice/list/list.component.scss 1.490ms
src/app/modules/secure/invoice/edit/invoice.edit.component.scss 10.130ms
src/app/modules/secure/invoice/wizard/wizard.invoice.new.component.scss 2.317ms
src/app/modules/secure/invoice/print/invoice.print.component.scss 8.090ms
src/app/modules/secure/dashboards/finance/finance.component.scss 1.044ms
src/app/modules/secure/dashboards/analytics/analytics.component.scss 1.082ms
src/app/modules/components/app-avatar-icon/avatar-icon/avatar-icon.component.scss 1.582ms
src/app/modules/secure/client/tabs/client-details-tab/client-details-tab.component.scss 1.365ms
src/app/modules/secure/business/tabs/billing/billing.component.scss 21.069ms
src/app/modules/components/invoice-components/invoice-status-chip/invoice-status-chip.component.scss 0.962ms
src/@calendar5/styles/main.scss 7662.387ms
src/app/layout/common/messages/messages.component.scss 9515.654ms
src/app/layout/common/notifications/notifications.component.scss 9564.043ms
src/app/layout/layouts/empty/empty.component.scss 9604.045ms
src/app/layout/common/search/search.component.scss 9668.171ms
src/app/layout/common/shortcuts/shortcuts.component.scss 9720.754ms
src/app/layout/layouts/vertical/basic/basic.component.scss 9770.425ms
src/app/layout/layouts/vertical/classic/classic.component.scss 9821.069ms
src/app/layout/common/user/user.component.scss 9872.937ms
src/@calendar5/components/message/message.component.scss 9952.090ms
src/@calendar5/components/navigation/horizontal/horizontal.component.scss 9996.202ms
src/@calendar5/components/navigation/vertical/vertical.component.scss 10080.984ms
src/@calendar5/components/card/card.component.scss 10061.433ms
src/app/modules/components/status-reason-selector/status-reason.dialog.component.scss 9779.124ms
src/app/modules/components/client-search-box/client-search-box.component.scss 9458.264ms
src/app/modules/auth/confirmation-required/confirmation-required.component.scss 9362.934ms
src/app/modules/auth/forgot-password/forgot-password.component.scss 9415.086ms
src/app/modules/auth/reset-password/reset-password.component.scss 9459.439ms
src/app/modules/auth/sign-in/sign-in.component.scss 9482.154ms
src/app/modules/auth/sign-up/sign-up.component.scss 9278.656ms
src/app/modules/auth/sign-out/sign-out.component.scss 9325.830ms
src/app/modules/auth/unlock-session/unlock-session.component.scss 9340.142ms
src/app/modules/auth/zoom-register/zoom-register.component.scss 9385.328ms
src/app/modules/landing/home/home.component.scss 9430.176ms
src/app/modules/pages/coming-soon/coming-soon.component.scss 9480.061ms
src/app/modules/pages/help-center/help-center.component.scss 9521.732ms
src/app/modules/pages/help-center/faqs/faqs.component.scss 9565.895ms
src/app/modules/pages/help-center/guides/guides.component.scss 9608.744ms
src/app/modules/pages/help-center/guides/guide/guide.component.scss 9655.414ms
src/app/modules/pages/help-center/guides/category/category.component.scss 9701.526ms
src/app/modules/pages/help-center/support/support.component.scss 9748.477ms
src/app/modules/pages/maintenance/maintenance.component.scss 9788.122ms
src/app/modules/pages/errors/error-500/error-500.component.scss 9837.430ms
src/app/modules/pages/errors/error-404/error-404.component.scss 9887.756ms
src/app/modules/pages/pricing/modern/modern.component.scss 9948.380ms
src/app/modules/pages/pricing/simple/simple.component.scss 10005.418ms
src/app/modules/pages/pricing/single/single.component.scss 10059.928ms
src/app/modules/pages/pricing/table/table.component.scss 10118.435ms
src/app/modules/secure/example/example.component.scss 10165.198ms
src/app/modules/secure/contacts/contacts.component.scss 10209.935ms
src/app/modules/secure/locations/locations.component.scss 10151.022ms
src/app/modules/secure/staff/staff.component.scss 10211.805ms
src/app/modules/secure/services/services.component.scss 10214.692ms
src/app/modules/secure/sharing/sharing.component.scss 10240.624ms
src/app/modules/secure/invoice/invoice.component.scss 10288.405ms
src/app/modules/secure/tags/tags.component.scss 10337.390ms
src/app/modules/secure/contacts/list/list.component.scss 10394.523ms
src/app/modules/secure/contacts/details/details.component.scss 10454.328ms
src/app/modules/secure/calendar/calendar-selector/calendar-selector.component.scss 9957.412ms
src/app/modules/secure/calendar/client-form-search/client-form-search.component.scss 10009.363ms
src/app/modules/secure/calendar/client-fields/client-fields.component.scss 10049.484ms
src/app/modules/secure/calendar/search-box/search-box.component.scss 10033.728ms
src/app/modules/secure/calendar/recurrence/recurrence.component.scss 10086.442ms
src/app/modules/secure/locations/list/list.component.scss 10088.285ms
src/app/modules/secure/staff/list/list.component.scss 10089.279ms
src/app/modules/secure/services/list/list.component.scss 9898.622ms
src/app/modules/secure/sharing/list/list.component.scss 9878.165ms
src/app/modules/secure/tags/list/list.component.scss 9850.385ms
src/app/modules/secure/dashboards/crypto/crypto.component.scss 9672.222ms
src/app/modules/secure/client/tabs/messages/messages.component.scss 9472.671ms
src/app/modules/secure/client/tabs/appointments/appointments.component.scss 9501.908ms
src/app/modules/secure/business/tabs/basic/basic.component.scss 9358.097ms
src/app/modules/secure/user/tabs/basic/user-basic-tab.component.scss 9334.046ms
src/app/modules/secure/business/tabs/features/features.component.scss 9381.294ms
src/app/modules/components/invoice-components/invoice-list/invoice-list.component.scss 9392.315ms
src/app/modules/secure/invoice/components/add-invoice-item/add-invoice-item.component.scss 9410.101ms

@crisbeto
Copy link
Member

crisbeto commented May 13, 2021

@alan-agius4 are there any leftover references to @angular/material/theming? They are the ones that would really slow down the compilation. I've submitted #22687 to make things better. For reference, I did some timings myself yesterday against the material.angular.io repo. This is for a full production build:

// Main branch at v11
Build 1: 39s
Build 2: 38s
Build 3: 39s

// Main branch at v12 with @use migration, but other @import statements are untouched.
Build 1: 57s
Build 2: 55s
Build 3: 54s

@alan-agius4
Copy link
Contributor

@crisbeto no there are no references to @angular/material/theming.

crisbeto added a commit to crisbeto/material2 that referenced this issue May 15, 2021
…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 added a commit to crisbeto/material2 that referenced this issue May 17, 2021
…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 added a commit to crisbeto/material2 that referenced this issue May 17, 2021
…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.
andrewseguin pushed a commit that referenced this issue May 18, 2021
…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 #22676.
andrewseguin pushed a commit that referenced this issue May 18, 2021
…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 #22676.
@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
area: theming P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet
5 participants