Skip to content

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Feb 13, 2025

Includes a bunch of cleanups for the docs site (see below) that ended up removing 230kb from the initial bundle.

build: update the docs site to latest Angular

Updates the docs site to the latest version of Angular.

fix(material-angular-io): remove docs data from critical path

The docs site was loading the data of all the examples up-front through an eager import which was bringing in ~170kb of JavaScript which isn't necessary for the initial load. These changes refactor the various call sites so that they load the example data asynchronously.

fix(material-angular-io): remove animations dependency

Drops the @angular/animations module from the docs site since it's no longer necessary. This removes another ~70kb from the initial bundle.

refactor(material-angular-io): use standalone imports instead of modules

Removes (almost) all of our @NgModule usage in the docs site by replacing their usages with standalone imports.

refactor(material-angular-io): switch to inject function

Runs the inject migration over the docs site to make it consistent with the rest of the repo.

refactor(material-angular-io): remove remaining modules

Reworks the docs site to remove all remaining @NgModule usages.

build: narrow down prettier file set

Fixes that the formatting check was catching some files incorrectly, like pnpm lock file.

Updates the docs site to the latest version of Angular.
The docs site was loading the data of all the examples up-front through an eager import which was bringing in ~170kb of JavaScript which isn't necessary for the initial load. These changes refactor the various call sites so that they load the example data asynchronously.
@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 Feb 13, 2025
@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label Feb 13, 2025
Drops the `@angular/animations` module from the docs site since it's no longer necessary. This removes another ~70kb from the initial bundle.
Removes (almost) all of our `@NgModule` usage in the docs site by replacing their usages with standalone imports.
Runs the inject migration over the docs site to make it consistent with the rest of the repo.
Reworks the docs site to remove all remaining `@NgModule` usages.
Fixes that the formatting check was catching some files incorrectly, like pnpm lock file.

bootstrapApplication(MaterialDocsApp, {
providers: [
prefersReducedMotion ? provideNoopAnimations() : provideAnimations(),
Copy link
Member Author

Choose a reason for hiding this comment

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

My plan is to handle reduced motion centrally from Material, instead of relying on the animations module for it.

@crisbeto crisbeto marked this pull request as ready for review February 13, 2025 13:08
@crisbeto crisbeto requested review from a team as code owners February 13, 2025 13:08
@crisbeto crisbeto requested review from andrewseguin, mmalerba and wagnermaciel and removed request for a team February 13, 2025 13:08
Copy link
Member

@josephperrott josephperrott left a comment

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release and removed target: patch This PR is targeted for the next patch release labels Feb 14, 2025
@crisbeto crisbeto merged commit 01292a1 into angular:main Feb 14, 2025
26 of 29 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 Mar 17, 2025
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: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants