-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(material/core): reduce the number of module resolutions required …
…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.
- Loading branch information
1 parent
4cf7716
commit 8eb702e
Showing
115 changed files
with
345 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@forward 'autocomplete-theme' hide color, theme, typography; | ||
@forward 'autocomplete-theme' as mat-autocomplete-* hide mat-autocomplete-density; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
@forward '../core/style/private.import'; | ||
@forward '../core/theming/theming.import'; | ||
@forward 'autocomplete-theme' hide color, theme, typography; | ||
@forward 'autocomplete-theme' as mat-autocomplete-* hide mat-autocomplete-density; | ||
@forward './autocomplete-legacy-index'; | ||
|
||
@import '../core/style/private'; | ||
@import '../core/theming/theming'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@forward 'badge-theme' hide $default-size, $font-size, $font-weight, $large-size, $small-size, | ||
color, theme, typography; | ||
@forward 'badge-theme' as mat-badge-* hide mat-badge-density, mat-badge-size; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@forward 'bottom-sheet-theme' hide color, theme, typography; | ||
@forward 'bottom-sheet-theme' as mat-bottom-sheet-* hide mat-bottom-sheet-density; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@forward 'button-toggle-variables' as mat-button-toggle-*; | ||
@forward 'button-toggle-theme' as mat-button-toggle-*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@forward 'button-theme' hide color, theme, typography; | ||
@forward 'button-theme' as mat-button-* hide $mat-button-ripple-opacity, mat-button-density, | ||
mat-button-focus-overlay-color, mat-button-ripple-background, mat-button-ripple-color, | ||
mat-button-theme-property; | ||
|
||
@forward 'button-base' as mat-* hide $mat-border-radius, $mat-button-border-radius, | ||
$mat-button-line-height, $mat-button-size, $mat-focus-transition, $mat-line-height, $mat-margin, | ||
$mat-min-width, $mat-padding, mat-base; | ||
@forward 'button-base' as mat-button-* hide $mat-button-button-border-radius, | ||
$mat-button-button-line-height, $mat-button-button-size, $mat-button-fab-border-radius, | ||
$mat-button-fab-padding, $mat-button-fab-size, $mat-button-mini-fab-padding, | ||
$mat-button-mini-fab-size, $mat-button-stroked-button-border-width, | ||
$mat-button-stroked-button-line-height, $mat-button-stroked-button-padding, mat-button-fab, | ||
mat-button-raised-button; | ||
@forward 'button-base' as mat-icon-* hide $mat-icon-border-radius, $mat-icon-fab-border-radius, | ||
$mat-icon-fab-padding, $mat-icon-fab-size, $mat-icon-focus-transition, $mat-icon-line-height, | ||
$mat-icon-margin, $mat-icon-min-width, $mat-icon-mini-fab-padding, $mat-icon-mini-fab-size, | ||
$mat-icon-padding, $mat-icon-stroked-button-border-width, $mat-icon-stroked-button-line-height, | ||
$mat-icon-stroked-button-padding, mat-icon-base, mat-icon-fab, mat-icon-raised-button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@forward 'card-theme' hide color, theme, typography; | ||
@forward 'card-theme' as mat-card-* hide mat-card-density; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@forward 'checkbox-theme' hide color, theme, typography; | ||
@forward 'checkbox-theme' as mat-checkbox-* hide mat-checkbox-density; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
@forward '../core/theming/theming.import'; | ||
@forward '../core/typography/typography-utils.import'; | ||
@forward 'checkbox-theme' hide color, theme, typography; | ||
@forward 'checkbox-theme' as mat-checkbox-* hide mat-checkbox-density; | ||
@forward './checkbox-legacy-index'; | ||
|
||
@import '../core/theming/theming'; | ||
@import '../core/typography/typography-utils'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
@forward 'chips-theme' hide $chip-remove-font-size, color, theme, typography; | ||
@forward 'chips-theme' as mat-* hide mat-chip-element-color, mat-chip-theme-color, mat-color, | ||
mat-density, mat-ripple-background, mat-theme, mat-typography; | ||
@forward 'chips-theme' as mat-chips-* hide $mat-chips-chip-remove-font-size, | ||
mat-chips-chip-element-color, mat-chips-chip-theme-color, mat-chips-density, | ||
mat-chips-ripple-background; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@forward 'core' hide core; | ||
@forward 'core-theme' hide color, theme; | ||
@forward 'core' as mat-* hide mat-mdc-core, mat-mdc-strong-focus-indicators-positioning; | ||
@forward 'core-theme' as mat-* hide mat-color, mat-theme; | ||
@forward 'core' as mat-core-* hide mat-core-mdc-core, | ||
mat-core-mdc-strong-focus-indicators-positioning; | ||
@forward 'core-theme' as mat-core-*; | ||
|
||
@forward './theming/all-theme'; | ||
@forward './color/color-legacy-index'; | ||
@forward './density/private/density-legacy-index'; | ||
@forward './focus-indicators/focus-indicators-legacy-index'; | ||
@forward './option/option-legacy-index'; | ||
@forward './ripple/ripple-legacy-index'; | ||
@forward './selection/pseudo-checkbox/pseudo-checkbox-legacy-index'; | ||
@forward './style/style-legacy-index'; | ||
@forward './theming/theming-legacy-index'; | ||
@forward './typography/typography-legacy-index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@forward 'all-color'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1 @@ | ||
@forward 'compatibility' hide $private-density-generate-at-root, $private-density-generate-styles, | ||
private-density-legacy-compatibility, private-density-prop-value; | ||
@forward 'compatibility' as mat-* hide $mat-default-scale, $mat-interval, $mat-maximum-scale, | ||
$mat-minimum-scale, $mat-supported-scales; | ||
@forward './density-legacy-index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@forward 'all-density' hide all-component-densities; | ||
@forward 'compatibility' hide $private-density-generate-at-root, $private-density-generate-styles, | ||
private-density-legacy-compatibility, private-density-prop-value; | ||
@forward 'compatibility' as mat-* hide $mat-default-scale, $mat-interval, $mat-maximum-scale, | ||
$mat-minimum-scale, $mat-supported-scales; |
5 changes: 5 additions & 0 deletions
5
src/material/core/focus-indicators/_focus-indicators-legacy-index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@forward 'focus-indicators' hide private-strong-focus-indicators-positioning, | ||
strong-focus-indicators; | ||
@forward 'focus-indicators-theme' hide color, theme; | ||
@forward 'focus-indicators' as mat-*; | ||
@forward 'focus-indicators-theme' as mat-strong-focus-indicators-*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@forward 'option-theme' hide color, theme, typography; | ||
@forward 'option-theme' as mat-option-* hide mat-option-density; | ||
|
||
@forward 'optgroup-theme' hide color, theme, typography; | ||
@forward 'optgroup-theme' as mat-optgroup-* hide mat-optgroup-density; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@forward 'ripple' as mat-* hide $mat-color-opacity; | ||
@forward 'ripple' as mat-ripple-* hide mat-ripple-ripple; | ||
@forward 'ripple-theme' as mat-ripple-*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
src/material/core/selection/pseudo-checkbox/_pseudo-checkbox-legacy-index.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@forward 'pseudo-checkbox-theme' hide color, theme, typography; | ||
@forward 'pseudo-checkbox-theme' as mat-pseudo-checkbox-* hide mat-pseudo-checkbox-density; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
@forward 'vendor-prefixes'; | ||
@forward 'button-common' as mat-button-*; | ||
@forward './style-legacy-index'; | ||
|
||
@import './vendor-prefixes'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,3 @@ | ||
@forward 'variables' hide $fast-out-linear-in-timing-function, $fast-out-slow-in-timing-function, | ||
$linear-out-slow-in-timing-function, $small, $toggle-padding, $toggle-size, $xsmall; | ||
@forward 'variables' as mat-* hide $mat-ease-in-out-curve-function, $mat-pi, $mat-swift-ease-in, | ||
$mat-swift-ease-in-duration, $mat-swift-ease-in-out, $mat-swift-ease-in-out-duration, | ||
$mat-swift-ease-in-out-timing-function, $mat-swift-ease-in-timing-function, $mat-swift-ease-out, | ||
$mat-swift-ease-out-duration, $mat-swift-ease-out-timing-function, $mat-swift-linear, | ||
$mat-swift-linear-duration, $mat-swift-linear-timing-function, $mat-z-index-drawer, | ||
$mat-z-index-fab; | ||
@forward 'checkbox-common' as mat-checkbox-*; | ||
@forward './style-legacy-index'; | ||
|
||
@import './variables'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,3 @@ | ||
@forward 'variables' hide $fast-out-linear-in-timing-function, $fast-out-slow-in-timing-function, | ||
$linear-out-slow-in-timing-function, $small, $toggle-padding, $toggle-size, $xsmall; | ||
@forward 'variables' as mat-* hide $mat-ease-in-out-curve-function, $mat-pi, $mat-swift-ease-in, | ||
$mat-swift-ease-in-duration, $mat-swift-ease-in-out, $mat-swift-ease-in-out-duration, | ||
$mat-swift-ease-in-out-timing-function, $mat-swift-ease-in-timing-function, $mat-swift-ease-out, | ||
$mat-swift-ease-out-duration, $mat-swift-ease-out-timing-function, $mat-swift-linear, | ||
$mat-swift-linear-duration, $mat-swift-linear-timing-function, $mat-z-index-drawer, | ||
$mat-z-index-fab; | ||
@forward 'elevation' hide $color, $opacity, $prefix, $transition-duration, | ||
$transition-timing-function, elevation, overridable-elevation, elevation-transition, | ||
private-transition-property-value; | ||
@forward 'elevation' as mat-* hide $mat-color, $mat-opacity, $mat-prefix, $mat-transition-duration, | ||
$mat-transition-timing-function, mat-get-ambient-map, mat-get-penumbra-map, mat-get-umbra-map; | ||
@forward 'elevation' as mat-elevation-* hide mat-elevation-elevation, mat-elevation-get-ambient-map, | ||
mat-elevation-get-penumbra-map, mat-elevation-get-umbra-map, mat-elevation-overridable-elevation; | ||
@forward './style-legacy-index'; | ||
|
||
@import 'variables'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
@forward 'layout-common' as mat-*; | ||
@forward './style-legacy-index'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
@forward 'list-common' as mat-* hide mat-base, mat-wrapper-base; | ||
@forward 'list-common' as mat-line-* hide mat-line-normalize-text, mat-line-truncate-line; | ||
@forward './style-legacy-index'; |
Oops, something went wrong.