Skip to content

Conversation

@crisbeto
Copy link
Member

Fixes that all M3 themes were causing a "no theme has been loaded" warning to be logged, because they weren't inserting the loaded marker.

Note: it's tempting to create the marker as a token, but we can't do it because tokens are output under a selector, whereas we want the marker to always be at the top level since we detect it by creating an element and inserting it into the body.

Fixes #29115.

Usually themes are loaded as global styles which are blocking. This allows us to assume that by the time to app is bootstrapped, the theme should have loaded. Our own demo app doesn't work this way, because we're inserting the theme inside the main entrypoint, because we need to determine whether to insert an M2 or M3 theme. This prevented us from properly testing the theme loaded warning.

These changes switch to bootstrapping the app after the theme has loaded.
@crisbeto crisbeto added target: patch This PR is targeted for the next patch release merge: preserve commits When the PR is merged, a rebase and merge should be performed labels May 25, 2024
@crisbeto crisbeto requested review from amysorto and mmalerba May 25, 2024 07:55
@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label May 25, 2024
@crisbeto crisbeto changed the title fix(material/core): M3 themes no inserting loaded marker fix(material/core): M3 themes not inserting loaded marker May 25, 2024
Fixes that all M3 themes were causing a "no theme has been loaded" warning to be logged, because they weren't inserting the loaded marker.

Note: it's tempting to create the marker as a token, but we can't do it because tokens are output under a selector, whereas we want the marker to always be at the top level since we detect it by creating an element and inserting it into the `body`.

Fixes angular#29115.
@crisbeto crisbeto self-assigned this May 28, 2024
@crisbeto crisbeto added the action: merge The PR is ready for merge by the caretaker label May 28, 2024
@crisbeto crisbeto merged commit 233c8a3 into angular:main May 28, 2024
@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 28, 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 area: build & ci Related the build and CI infrastructure of the project merge: preserve commits When the PR is merged, a rebase and merge should be performed target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(theming): 'Could not find Angular Material core theme' warning with new Angular 18 application using Angular Material

2 participants