Browse Source

refactor: migrate deprecated animation providers to async variants

Replace provideAnimations() with provideAnimationsAsync() and
provideNoopAnimations() with provideNoopAnimationsAsync() across
the application and Storybook stories.

The synchronous variants were deprecated in Angular 17. The async
versions load animation code lazily, reducing the initial bundle.

Fixes #6121
pull/6716/head
Trevin Chow 2 weeks ago
parent
commit
84c48649af
  1. 4
      apps/client/src/main.ts
  2. 4
      libs/ui/src/lib/entity-logo/entity-logo.component.stories.ts
  3. 4
      libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.stories.ts

4
apps/client/src/main.ts

@ -22,7 +22,7 @@ import {
import { MatSnackBarModule } from '@angular/material/snack-bar';
import { MatTooltipModule } from '@angular/material/tooltip';
import { bootstrapApplication } from '@angular/platform-browser';
import { provideAnimations } from '@angular/platform-browser/animations';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { RouterModule, TitleStrategy } from '@angular/router';
import { ServiceWorkerModule } from '@angular/service-worker';
import { provideIonicAngular } from '@ionic/angular/standalone';
@ -79,7 +79,7 @@ import { environment } from './environments/environment';
),
LanguageService,
ModulePreloadService,
provideAnimations(),
provideAnimationsAsync(),
provideHttpClient(withInterceptorsFromDi()),
provideIonicAngular(),
provideMarkdown(),

4
libs/ui/src/lib/entity-logo/entity-logo.component.stories.ts

@ -1,6 +1,6 @@
import { CommonModule } from '@angular/common';
import { importProvidersFrom } from '@angular/core';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
import { provideNoopAnimationsAsync } from '@angular/platform-browser/animations/async';
import { applicationConfig, Meta, StoryObj } from '@storybook/angular';
import { EntityLogoImageSourceServiceMock } from '../mocks/entity-logo-image-source.service.mock';
@ -13,7 +13,7 @@ export default {
decorators: [
applicationConfig({
providers: [
provideNoopAnimations(),
provideNoopAnimationsAsync(),
importProvidersFrom(CommonModule),
{
provide: EntityLogoImageSourceService,

4
libs/ui/src/lib/symbol-autocomplete/symbol-autocomplete.component.stories.ts

@ -9,7 +9,7 @@ import {
NgControl,
ReactiveFormsModule
} from '@angular/forms';
import { provideNoopAnimations } from '@angular/platform-browser/animations';
import { provideNoopAnimationsAsync } from '@angular/platform-browser/animations/async';
import { applicationConfig, Meta, StoryObj } from '@storybook/angular';
import { HttpClientMock } from '../mocks/httpClient.mock';
@ -75,7 +75,7 @@ export default {
decorators: [
applicationConfig({
providers: [
provideNoopAnimations(),
provideNoopAnimationsAsync(),
importProvidersFrom(CommonModule, FormsModule, ReactiveFormsModule),
{
provide: NgControl,

Loading…
Cancel
Save