Packages

@angular/upgrade

22.2.3 · 14 Oct 2026MIT104.4k / weekRepositoryHomepagenpmAtom feed

Your version

15.0.0

major16 Nov 2022Where it was published

15.2.10 is the newest release of 15.x.

In short

11 breaking5 deprecated3 changed

  • breaking

    Invalid constructors for DI may now report compilation errors

  • breaking

    Angular compiler option enableIvy has been removed as Ivy is the only rendering engine.

  • breaking

    Angular no longer supports Node.js versions 14.[15-19].x and 16.[10-12].x. Current supported versions of Node.js are 14.20.x, 16.13.x and 18.10.x.

  • breaking

    TypeScript versions older than 4.8 are no longer supported.

  • breaking

    Existing iframe usages may have security-sensitive attributes applied as an attribute or property binding in a template or via host bindings in a directive. Such usages would require an update to ensure compliance with the new stricter rules around iframe bindings.

  • breaking

    Existing iframe usages may have src or srcdoc preceding other attributes. Such usages may need to be updated to ensure compliance with the new stricter rules around iframe bindings.

  • breaking

    setDisabledState will always be called when a ControlValueAccessor is attached. You can opt-out with FormsModule.withConfig or ReactiveFormsModule.withConfig.

  • breaking

    canParse method has been removed from all translation parsers in @angular/localize/tools. analyze should be used instead.

Release note

Breaking Changes

compiler

  • breaking

    Keyframes names are now prefixed with the component's "scope name".
    For example, the following keyframes rule in a component definition,
    whose "scope name" is host-my-cmp:

    @keyframes foo { ... }

    will become:

    @keyframes host-my-cmp_foo { ... }

    Any TypeScript/JavaScript code which relied on the names of keyframes rules
    will no longer match.

    The recommended solutions in this case are to either:

    • change the component's view encapsulation to the None or ShadowDom

    • define keyframes rules in global stylesheets (e.g styles.css)

    • define keyframes rules programmatically in code.

compiler-cli

  • breaking

    Invalid constructors for DI may now report compilation errors

    When a class inherits its constructor from a base class, the compiler may now
    report an error when that constructor cannot be used for DI purposes. This may
    either be because the base class is missing an Angular decorator such as
    @Injectable() or @Directive(), or because the constructor contains parameters
    which do not have an associated token (such as primitive types like string).
    These situations used to behave unexpectedly at runtime, where the class may be
    constructed without any of its constructor parameters, so this is now reported
    as an error during compilation.

    Any new errors that may be reported because of this change can be resolved either
    by decorating the base class from which the constructor is inherited, or by adding
    an explicit constructor to the class for which the error is reported.

  • breaking

    Angular compiler option enableIvy has been removed as Ivy is the only rendering engine.

core

  • breaking

    Angular no longer supports Node.js versions 14.[15-19].x and 16.[10-12].x. Current supported versions of Node.js are 14.20.x, 16.13.x and 18.10.x.

  • breaking

    TypeScript versions older than 4.8 are no longer supported.

  • breaking

    Existing iframe usages may have security-sensitive attributes applied as an attribute or property binding in a template or via host bindings in a directive. Such usages would require an update to ensure compliance with the new stricter rules around iframe bindings.

  • breaking

    Existing iframe usages may have src or srcdoc preceding other attributes. Such usages may need to be updated to ensure compliance with the new stricter rules around iframe bindings.

forms

  • breaking

    setDisabledState will always be called when a ControlValueAccessor is attached. You can opt-out with FormsModule.withConfig or ReactiveFormsModule.withConfig.

localize

  • breaking

    canParse method has been removed from all translation parsers in @angular/localize/tools. analyze should be used instead.

    • the hint parameter in theparse methods is now mandatory.

router

  • breaking

    Previously, the RouterOutlet would immediately
    instantiate the component being activated during navigation. Now the
    component is not instantiated until the change detection runs. This
    could affect tests which do not trigger change detection after a router
    navigation. In rarer cases, this can affect production code that relies
    on the exact timing of component availability.

  • breaking

    The title property is now required on ActivatedRouteSnapshot

  • breaking

    relativeLinkResolution is no longer configurable in
    the Router. This option was used as a means to opt out of a bug fix.

Deprecations

common

  • deprecated

    The DATE_PIPE_DEFAULT_TIMEZONE token is now deprecated in favor
    of the DATE_PIPE_DEFAULT_OPTIONS token, which accepts an object
    as a value and the timezone can be defined as a field (called timezone)
    on that object.

core

  • deprecated

    The ability to pass an NgModule to the providedIn option for
    @Injectable and InjectionToken is now deprecated.

    providedIn: NgModule was intended to be a tree-shakable alternative to
    NgModule providers. It does not have wide usage, and in most cases is used
    incorrectly, in circumstances where providedIn: 'root' should be
    preferred. If providers should truly be scoped to a specific NgModule, use
    NgModule.providers instead.

    • The ability to set providedIn: 'any' for an @Injectable or
      InjectionToken is now deprecated.

    providedIn: 'any' is an option with confusing semantics and is almost
    never used apart from a handful of esoteric cases internal to the framework.

  • deprecated

    The bit field signature of Injector.get() has been deprecated, in favor of the new options object.

  • deprecated

    The bit field signature of TestBed.inject() has been deprecated, in favor of the new options object.

router

  • deprecated

    The RouterLinkWithHref directive is deprecated, use the RouterLink directive instead. The RouterLink contains the code from the RouterLinkWithHref to handle elements with href attributes.

common

CommitDescription
feat - c0c7efaf7cadd provideLocationMocks() function to provide Location mocks (#47674)
feat - 75e6297f09add <link> preload tag on server for priority img (#47343)
feat - 4fde292bb5Add automatic srcset generation to ngOptimizedImage (#47547)
feat - 9483343ebfAdd fill mode to NgOptimizedImage (#47738)
feat - bdb5371033add injection token for default DatePipe configuration (#47157)
fix - 449d29b701Add fetchpriority to ngOptimizedImage preloads (#48010)
fix - 4f52d4e474don't generate srcset if noopImageLoader is used (#47804)
fix - 3a18398d83Don't warn about image distortion is fill mode is enabled (#47824)
fix - edea15f2c6export the IMAGE_CONFIG token (#48051)
fix - 8abf1c844cfix formatting on oversized image error (#47188)
fix - ca7bf65933rename rawSrc -> ngSrc in NgOptimizedImage directive (#47362)
fix - b3879dbf14support density descriptors with 2+ decimals (#47197)
fix - fa4798095eupdate size error to mention 'fill' mode (#47797)
fix - 23f210c0abwarn if using supported CDN but not built-in loader (#47330)
fix - 945432e3faWarn on fill ngOptimizedImage without height (#48036)

compiler

CommitDescription
fix - 051f75648dscope css keyframes in emulated view encapsulation (#42608)
fix - 39b72e208bupdate element schema (#47552)
fix - 48b354a83eupdate element schema (#47552)

compiler-cli

CommitDescription
fix - bc54687c7bexclude abstract classes from strictInjectionParameters requirement (#44615)
fix - 309b2cde51implement more host directive validations as diagnostics (#47768)
fix - 2e1dddec45support hasInvalidatedResolutions. (#47585)
fix - 19ad4987f9use @ts-ignore. (#47636)
perf - 8fcadaad48cache source file for reporting type-checking diagnostics (#47471)
refactor - 16f96eeabfremove enableIvy options (#47346)

core

CommitDescription
docs - e3cef4a784deprecate providedIn: NgModule and providedIn: 'any' (#47616)
feat - 1b9fd46d14add support for Node.js version 18 (#47730)
feat - ed11a13c3cdrop support for TypeScript 4.6 and 4.7 (#47690)
feat - db28badfe6enable the new directive composition API (#47642)
feat - 7de1469be6introduce EnvironmentProviders wrapper type (#47669)
feat - 841c8e5138support object-based DI flags in Injector.get() (#46761)
feat - 120555a626support object-based DI flags in TestBed.inject() (#46761)
fix - 96c0e42e61allow readonly arrays for standalone imports (#47851)
fix - 28f289b825hardening attribute and property binding rules for <iframe> elements (#47964)
fix - d4b3c0b47chardening rules related to the attribute order on iframe elements (#47935)
fix - 85330f3fd9update isDevMode to rely on ngDevMode (#47475)

forms

CommitDescription
feat - a8569e3802export forms utility functions: isFormArray, isFormGroup… (#47718)
fix - 96b7fe93afcall setDisabledState on ControlValueAcessor when control is enabled (#47576)
fix - a99d9d67f3don't mutate validators array (#47830)
fix - 2625dc1312Improve a very commonly viewed error message by adding a guide. (#47969)
fix - ae29f98c20Runtime error pages must begin with leading zero (#47991)

http

CommitDescription
feat - 3ba99e286aallow for child HttpClients to request via parents (#47502)
feat - 84d0d33c35introduce provideHttpClientTesting provider function (#47502)
feat - 62c7a7a16eintroduce functional interceptors (#47502)
feat - e47b129070introduce the provideHttpClient() API (#47502)
fix - ea16a98dfebetter handle unexpected undefined XSRF tokens (#47683)
fix - e7b48da713rename withLegacyInterceptors to withInterceptorsFromDi (#47901)

language-service

CommitDescription
feat - bebef5fb43Quick fix to import a component when its selector is used (#47088)
feat - e7ee53c541support to fix invalid banana in box (#47393)

localize

CommitDescription
fix - 400a6b5e37add polyfill in polyfills array instead of polyfills.ts (#47569)
fix - b6fd814542update ng add schematic to support Angular CLI version 15 (#47763)
refactor - d36fd3d9e4remove deprecated canParse method from TranslationParsers (#47275)

platform-server

CommitDescription
fix - 2908eba59calign server renderer interface with base renderer (#47868)

router

CommitDescription
feat - 7bee28d037add a migration to remove relativeLinkResolution usages (#47604)
feat - 5163e3d876Add UrlTree constructor to public API (#47186)
feat - da58801f95auto-unwrap default exports when lazy loading (#47586)
feat - c3f857975dmake RouterOutlet name an Input so it can be set dynamically (#46569)
feat - f73ef21442merge RouterLinkWithHref into RouterLink (#47630)
feat - 16c8f55663migrate RouterLinkWithHref references to RouterLink (#47599)
feat - 07017a7bd3prevent provideRouter() from usage in @Component (#47669)
fix - 79e9e8ab77Delay router scroll event until navigated components have rendered (#47563)
fix - 6a88bad019Ensure ActivatedRouteSnapshot#title has correct value (#47481)
fix - 7b89d95c0eRemove deprecated relativeLinkResolution (#47623)

Special Thanks

Alan Agius, AleksanderBodurri, Alex Castle, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Charles Lyding, Dylan Hunn, Ferdinand Malcher, George Kalpakas, Jeremy Elbourn, Jessica Janiuk, JiaLiPassion, Joey Perrott, JoostK, Kara Erickson, Kristiyan Kostadinov, Martin Probst, Matthias Weiß, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Sabareesh Kappagantu, WD Snoeijer, angular-robot[bot], arturovt, ced, dario-piotrowicz, ivanwonder and jaybell