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

Consolidate style loading logic #29617

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Consolidate style loading logic #29617

merged 3 commits into from
Aug 21, 2024

Conversation

crisbeto
Copy link
Member

Introduces a new cdk/private entrypoint that we can use for logic that needs to be shared, but shouldn't be public. Also moves our various implementations of style loading into it.

@crisbeto crisbeto added target: major This PR is targeted for the next major release target: patch This PR is targeted for the next patch release labels Aug 21, 2024
@crisbeto crisbeto marked this pull request as ready for review August 21, 2024 08:18
@crisbeto crisbeto requested review from a team as code owners August 21, 2024 08:18
@crisbeto crisbeto requested review from mmalerba and andrewseguin and removed request for a team August 21, 2024 08:18
@crisbeto crisbeto added merge: preserve commits When the PR is merged, a rebase and merge should be performed and removed target: patch This PR is targeted for the next patch release labels Aug 21, 2024
* Loads a set of styles.
* @param loader Component which will be instantiated to load the styles.
*/
loadStyles(loader: Type<unknown>): void {
Copy link
Contributor

Choose a reason for hiding this comment

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

Usage looks a little redundant with styleLoader.loadStyles()

What about renaming this to just load

.ng-dev/commit-message.mts Show resolved Hide resolved
@@ -0,0 +1 @@
Private utilities meant to be used only within the CDK and Material.
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes me wonder if this sort of utility is useful to other Angular component libraries. Maybe over time we could graduate these things to the framework or CDK

Creates a new `cdk/private` package in which we can put shared code that isn't meant to be public and creates a new style loader service that can be used to load structural styles for components.
…yles

Switches the drag&drop module to use the common service to load the preview styles.
…tyles

Switches the badge to use the common style loading service to load its structural styles.
@crisbeto crisbeto removed request for a team and mmalerba August 21, 2024 16:25
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label Aug 21, 2024
@crisbeto crisbeto merged commit 9323bf4 into angular:main Aug 21, 2024
21 of 23 checks passed
@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 Sep 21, 2024
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 merge: preserve commits When the PR is merged, a rebase and merge should be performed target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants