Skip to content

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.

  • 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.
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.

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.
enableIvy
Removes the canParse method from all translation parsers in @angular/localize/tools and makes the hint parameter in parse methods mandatory.
canParseanalyzeparse
RouterOutlet no longer instantiates the activated component immediately during navigation; it waits until change detection runs.
RouterOutlet
relativeLinkResolution is no longer configurable in the Router.
relativeLinkResolution
Renames rawSrc to ngSrc in the NgOptimizedImage directive.
NgOptimizedImagerawSrcngSrc
Removes the enableIvy options.
enableIvy
Removes the deprecated canParse method from TranslationParsers.
TranslationParserscanParse
Removes the deprecated relativeLinkResolution option.
relativeLinkResolution
Invalid 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.
srcsrcdoc
setDisabledState is always called when a ControlValueAccessor is attached; opt out via FormsModule.withConfig or ReactiveFormsModule.withConfig.
setDisabledStateControlValueAccessorFormsModule.withConfigReactiveFormsModule.withConfig
The title property is now required on ActivatedRouteSnapshot.
ActivatedRouteSnapshottitle
Merges RouterLinkWithHref into RouterLink.
RouterLinkWithHrefRouterLink
Security3
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.
Deprecated24
Deprecates class and InjectionToken guards and resolvers in favor of plain JavaScript functions using inject from @angular/core.
InjectionTokeninject
Uses 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.forRoot
Migrates 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.
tsconfig
Reduces 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.
--defaults
Uses consistent quotes in generated imports.
Uses NgForOf instead of NgFor in migrations.
NgForOfNgFor
Deprecates CanLoad guards in the Router in favor of CanMatch.
CanLoadCanMatchcanLoadcanMatch
Deprecates router writable properties in favor of DI providers or RouterModule.forRoot/provideRouter options.
routeReuseStrategytitleStrategyurlHandlingStrategyonSameUrlNavigationparamsInheritanceStrategyurlUpdateStrategycanceledNavigationResolutionmalformedUriErrorHandler
Deprecates public members of Router that are meant to be configured elsewhere.
Router
Deprecates the DATE_PIPE_DEFAULT_TIMEZONE token in favor of DATE_PIPE_DEFAULT_OPTIONS with a timezone field.
DATE_PIPE_DEFAULT_TIMEZONEDATE_PIPE_DEFAULT_OPTIONStimezone
Deprecates passing an NgModule to the providedIn option of @Injectable and InjectionToken.
providedIn@InjectableInjectionTokenNgModule.providers
Deprecates 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.
RouterLinkWithHrefRouterLink
Deprecates providedIn: NgModule and providedIn: 'any' for injectable providers.
providedInNgModule