Skip to content

refactor(material/core): resolve circular dependencies #21110

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

Merged
merged 1 commit into from
Nov 25, 2020

Conversation

crisbeto
Copy link
Member

Hopefully the last set of code changes for the Sass module system migration.

  • Combines theming/_theming.scss and theming/_private.scss, because they had a circular dependency and since theming.scss could be considered a public API, we can't move the utilities out into a shared file.
  • Changes the angular-material-density mixin to include density mixins individually, instead of going through angular-material-theme. The previous approach had transient circular dependencies that will turn into hard errors once we switch to the
    Sass module system. The new approach is in line with what we're doing already inside angular-material-typography.
  • Switches a few MDC function calls to go through @use instead of @import. For some reason Sass was having a hard time finding the old ones after the files are migrated to the module system.
  • Passes a variable as a parameter to mat-mdc-private-dialog-structure-overrides, instead of expecting it to be available as a global variable. This seems like an oversight.
  • Fixes several places where mixins were being imported transitively, rather than explicitly. This will be an error with the Sass module system.

Note: Setting as a P2, because it's a blocker for the Sass module system migration. I'm trying to fix all the errors ahead of time so that the final PR consists only of changes made by the migration script.

Hopefully the last set of code changes for the Sass module system migration.
* Combines `theming/_theming.scss` and `theming/_private.scss`, because they had a
circular dependency and since `theming.scss` could be considered a public API, we
can't move the utilities out into a shared file.
* Changes the `angular-material-density` mixin to include density mixins individually,
instead of going through `angular-material-theme`. The previous approach had
transient circular dependencies that will turn into hard errors once we switch to the
Sass module system. The new approach is in line with what we're doing already
inside `angular-material-typography`.
* Switches a few MDC function calls to go through `@use` instead of `@import`. For
some reason Sass was having a hard time finding the old ones after the files are
migrated to the module system.
* Passes a variable as a parameter to `mat-mdc-private-dialog-structure-overrides`,
instead of expecting it to be available as a global variable. This seems like an oversight.
* Fixes several places where mixins were being imported transitevely, rather than
explicitly. This will be an error with the Sass module system.
@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release labels Nov 21, 2020
@google-cla google-cla bot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 21, 2020
Copy link
Contributor

@mmalerba mmalerba left a comment

Choose a reason for hiding this comment

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

LGTM

@mmalerba mmalerba added the action: merge The PR is ready for merge by the caretaker label Nov 22, 2020
@annieyw annieyw merged commit 029136e into angular:master Nov 25, 2020
@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 Dec 26, 2020
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 P2 The issue is important to a large percentage of users, with a workaround target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants