- ng update @angular/core@21 @angular/cli@21 (corrige GHSA-jrmj-c5cx-3cw6, XSS SVG) - Migration automatique des templates vers le control flow natif (@if/@for, 138 fichiers) - Correction des 5 `track` invalides generes par la migration (trackBy a 1 argument -> track $index) + suppression des fonctions trackBy mortes - TypeScript 5.9, zone.js 0.15 ; npm audit : 0 vulnerabilite Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
27 lines
1.3 KiB
TypeScript
27 lines
1.3 KiB
TypeScript
import { bootstrapApplication } from '@angular/platform-browser';
|
|
import { AppComponent } from './app/app.component';
|
|
import { PreloadAllModules, provideRouter, withPreloading } from '@angular/router';
|
|
import { routes } from './app/app.routes';
|
|
import { provideHttpClient, withInterceptors } from '@angular/common/http';
|
|
import { APP_INITIALIZER, provideZoneChangeDetection } from '@angular/core';
|
|
import { ConfigService } from './app/services/config.service';
|
|
import { sessionExpiredInterceptor } from './app/interceptors/session-expired.interceptor';
|
|
|
|
// withPreloading(PreloadAllModules) : une fois l'app initiale rendue, Angular
|
|
// telecharge en arriere-plan tous les chunks lazy-loades. Consequence : la
|
|
// premiere visite d'une route ne declenche plus de download runtime, elle
|
|
// ouvre instantanement. Cout : un peu plus de bande passante au demarrage
|
|
// (acceptable pour une app interne ou toutes les routes seront visitees).
|
|
bootstrapApplication(AppComponent, {
|
|
providers: [
|
|
provideZoneChangeDetection(),provideRouter(routes, withPreloading(PreloadAllModules)),
|
|
provideHttpClient(withInterceptors([sessionExpiredInterceptor])),
|
|
{
|
|
provide: APP_INITIALIZER,
|
|
useFactory: (config: ConfigService) => () => config.load(),
|
|
deps: [ConfigService],
|
|
multi: true,
|
|
},
|
|
],
|
|
}).catch((err: Error) => console.error(err));
|