Upgrading @angular/platform-browser-dynamic 14 to 15
Breaking14.3.0 โ 15.2.10Breaking15Security3Platform5Deprecated28New37Changed9Fixed133Other5
BreakingUpgrade verdict
15 breaking changes and 5 platform requirement changes and 3 security fixes.
In plain terms
- Animation keyframe names inside components get a component-specific prefix, so any code that looks up keyframes by their old names will stop working.
- The enableIvy compiler option is gone because Ivy is now the only rendering engine.
- Localization tooling drops the canParse method in favor of analyze, and the hint argument to parse is now required.
- Components routed into a RouterOutlet are now created only when change detection runs, which can affect tests and code relying on exact timing.
Must act Top 5 of 47 that need code or config changes
Node.js requirement changed in 15.0.0-next.6: ^14.15.0 || >=16.10.0 โ ^14.20.0 || ^16.13.0 || >=18.10.0.
What you must change
Breaking15
Keyframes names are now prefixed with the component's scope name, so code relying on the original names no longer matches.
Removes the Angular compiler option enableIvy since Ivy is the only rendering engine.
enableIvyRemoves the canParse method from all translation parsers in @angular/localize/tools and makes the hint parameter in parse methods mandatory.
canParseanalyzeparseRouterOutlet no longer instantiates the activated component immediately during navigation; it waits until change detection runs.
RouterOutletrelativeLinkResolution is no longer configurable in the Router.
relativeLinkResolutionRenames rawSrc to ngSrc in the NgOptimizedImage directive.
NgOptimizedImagerawSrcngSrcRemoves the enableIvy options.
enableIvyRemoves the deprecated canParse method from TranslationParsers.
TranslationParserscanParseRemoves the deprecated relativeLinkResolution option.
relativeLinkResolutionInvalid constructors for DI may now report compilation errors when a base class lacks an Angular decorator or has untokenized parameters.
@Injectable()@Directive()Existing iframe usages may have security-sensitive attributes applied as attribute or property bindings, requiring updates for stricter iframe binding rules.
Existing iframe usages may have src or srcdoc preceding other attributes and may need updating for stricter iframe binding rules.
srcsrcdocsetDisabledState is always called when a ControlValueAccessor is attached; opt out via FormsModule.withConfig or ReactiveFormsModule.withConfig.
setDisabledStateControlValueAccessorFormsModule.withConfigReactiveFormsModule.withConfigThe title property is now required on ActivatedRouteSnapshot.
ActivatedRouteSnapshottitleMerges RouterLinkWithHref into RouterLink.
RouterLinkWithHrefRouterLinkSecurity3
Changes URL sanitization to only block javascript: URLs.
Hardens attribute and property binding rules for <iframe> elements.
<iframe>Hardens rules related to the attribute order on iframe elements.
<iframe>Platform5
Adds support for TypeScript 4.9.
Drops support for Node.js 14.[15-19].x and 16.[10-12].x; supported versions are 14.20.x, 16.13.x and 18.10.x.
Drops support for TypeScript versions older than 4.8.
Adds support for Node.js version 18.
Drops support for TypeScript 4.6 and 4.7.
Deprecations to plan for
Deprecated24
Deprecates class and InjectionToken guards and resolvers in favor of plain JavaScript functions using inject from @angular/core.
InjectionTokeninjectUses the import remapper in the root component.
Avoids re-traversing nodes when resolving bootstrap call dependencies.
Speeds up language service lookups.
Migrates RouterModule.forRoot with a config object to use features.
RouterModule.forRootMigrates tests when switching to the standalone bootstrap API.
Moves standalone migrations into imports.
Normalizes paths to posix in migrations.
Only excludes bootstrapped declarations from the initial standalone migration.
Preserves tsconfig in the standalone migration.
tsconfigReduces the number of files that need to be checked during migration.
Returns the correct alias when a conflicting import exists.
Fixes the standalone migration incorrectly throwing a path error for multi app projects.
Supports --defaults in the standalone migration.
--defaultsUses consistent quotes in generated imports.
Uses NgForOf instead of NgFor in migrations.
NgForOfNgForDeprecates CanLoad guards in the Router in favor of CanMatch.
CanLoadCanMatchcanLoadcanMatchDeprecates router writable properties in favor of DI providers or RouterModule.forRoot/provideRouter options.
routeReuseStrategytitleStrategyurlHandlingStrategyonSameUrlNavigationparamsInheritanceStrategyurlUpdateStrategycanceledNavigationResolutionmalformedUriErrorHandlerDeprecates public members of Router that are meant to be configured elsewhere.
RouterDeprecates the DATE_PIPE_DEFAULT_TIMEZONE token in favor of DATE_PIPE_DEFAULT_OPTIONS with a timezone field.
DATE_PIPE_DEFAULT_TIMEZONEDATE_PIPE_DEFAULT_OPTIONStimezoneDeprecates passing an NgModule to the providedIn option of @Injectable and InjectionToken.
providedIn@InjectableInjectionTokenNgModule.providersDeprecates the bit field signature of Injector.get() in favor of the new options object.
Injector.get()TestBed.inject()Deprecates the RouterLinkWithHref directive in favor of RouterLink, which handles elements with href attributes.
RouterLinkWithHrefRouterLinkDeprecates
providedIn: NgModule and providedIn: 'any' for injectable providers.providedInNgModule