Update dependency @angular/common to v17 - autoclosed #126
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "renovate_angular-common-17.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
^13.3.3
->^17.0.0
Release Notes
angular/angular (@angular/common)
v17.3.9
Compare Source
v17.3.8
Compare Source
compiler
core
v17.3.7
Compare Source
compiler-cli
core
router
v17.3.6
Compare Source
core
ActivatedRoute
inject correct instance inside@defer
blocks (#55374)v17.3.5
Compare Source
v17.3.4
Compare Source
common
v17.3.3
Compare Source
17.3.3 (2024-04-03)
core
ChainedInjector
s in injector debug utils (#55144)migrations
v17.3.2
Compare Source
compiler
compiler-cli
core
@defer
blocks (#55079)http
migrations
router
v17.3.1
Compare Source
compiler
compiler-cli
v17.3.0
Compare Source
compiler
compiler-cli
ModuleWithProviders
literal detection withtypeof
(#54650)core
output()
API (#54650)outputFromObservable()
interop function (#54650)outputToObservable
interop helper (#54650)asReadonly
. (#54706)DestroyRef
inEventEmitter
(#54748)http
router
v17.2.4
Compare Source
compiler-cli
core
@defer
dependencies (#54667)--strictFunctionTypes
(#54652)asReadonly
. (#54719)v17.2.3
Compare Source
common
AsyncPipe
should not callmarkForCheck
on subscription (#54554)compiler-cli
core
@defer
block (#52881)migrations
v17.2.2
Compare Source
common
compiler
compiler-cli
core
migrations
router
v17.2.1
Compare Source
compiler-cli
v17.2.0
Compare Source
common
compiler
useTemplatePipeline
(#54057)compiler-cli
@Injectable
classes in local compilation mode (#54139)forbidOrphanComponents
is set (#54139)core
http
v17.1.3
Compare Source
compiler-cli
core
afterRender
hooks should allow updating state (#54074)markForCheck
by partially reverting #54074 (#54329)router
v17.1.2
Compare Source
animations
common
compiler
core
migrations
v17.1.1
Compare Source
router
last
helper with nativeArray.at(-1)
(#54021)v17.1.0
Compare Source
compiler
compiler-cli
getConstructorDependencies
helper to work with reflection host after the previous change (#52215)core
input
API for signal-based inputs (#53872)SignalNode
reactive node incorrectly exposing unset field (#53571)router
NavigationExtras
(#53303)onSameUrlNavigation: 'ignore'
innavigateByUrl
(#52265)v17.0.9
Compare Source
common
compiler
compiler-cli
core
afterRender
hooks now only run onApplicationRef.tick
(#52455)migrations
platform-server
v17.0.8
Compare Source
compiler
core
migrations
router
v17.0.7
Compare Source
compiler
compiler-cli
core
migrations
platform-browser
router
v17.0.6
Compare Source
compiler
compiler-cli
core
@for
loops (#53274)migrations
router
v17.0.5
Compare Source
core
migrations
@for
(#53238)router
v17.0.4
Compare Source
common
load
on image once it fails to load (#52990)compiler
compiler-cli
core
getDeferBlocks
is invoked in tests (#52973)migrations
v17.0.3
Compare Source
animations
core
http
content-type
to set the blobtype
. (#52840)migrations
v17.0.2
Compare Source
compiler-cli
core
@for
(#52697)v17.0.1
Compare Source
http
migrations
Web Frameworks: the internet frontier.
These are the voyages of the framework Angular.
Its continuing mission:
To explore strange, new technologies.
To seek out new users and new applications.
To boldly go where no web framework has gone before.
In honor of v17.0.1
Live long and prosper 🖖🏻
v17.0.0
Compare Source
Blog post "Angular v17 is now available".
Breaking Changes
Node.js v16 support has been removed and the minimum support version has been bumped to 18.13.0.
Node.js v16 is planned to be End-of-Life on 2023-09-11. Angular will stop supporting Node.js v16 in Angular v17. For Node.js release schedule details, please see: https://github.com/nodejs/release#release-schedule
common
migrating from the previously used == operator. NgSwitch expressions and / or
individual condition values need adjusting to this stricter equality
check. The added warning message should help pin-pointing NgSwitch
usages where adjustments are needed.
core
Angular now requires
zone.js
version~0.14.0
Versions of TypeScript older than 5.2 are no longer supported.
The
mutate
method was removed from theWritableSignal
interface and completelydropped from the public API surface. As an alternative, please use the
update
method andmake immutable changes to the object.
Example before:
Example after:
OnPush
components that are created dynamically nowonly have their host bindings refreshed and
ngDoCheck run
during changedetection if they are dirty.
Previously, a bug in the change detection would result in the
OnPush
configuration of dynamically created components to be ignored when
executing host bindings and the
ngDoCheck
function. This israrely encountered but can happen if code has a handle on the
ComponentRef
instance and updates values read in theOnPush
component template without then calling either
markForCheck
ordetectChanges
on that component'sChangeDetectorRef
.platform-browser
REMOVE_STYLES_ON_COMPONENT_DESTROY
default value is nowtrue
. This causes CSS of components to be removed from the DOM when destroyed. You retain the previous behaviour by providing theREMOVE_STYLES_ON_COMPONENT_DESTROY
injection token.The
withNoDomReuse()
function was removed from the public API. If you need to disable hydration, you can exclude theprovideClientHydration()
call from provider list in your application (which would disable hydration features for the entire application) or usengSkipHydration
attribute to disable hydration for particular components. See this guide for additional information: https://angular.io/guide/hydration#how-to-skip-hydration-for-particular-components.router
Absolute redirects no longer prevent further redirects.
Route configurations may need to be adjusted to prevent infinite
redirects where additional redirects were previously ignored after an
absolute redirect occurred.
Routes with
loadComponent
would incorrectly causechild routes to inherit their data by default. The default
paramsInheritanceStrategy
isemptyOnly
. If parent data should beinherited in child routes, this should be manually set to
always
.urlHandlingStrategy
has been removed from the Router public API.This should instead be configured through the provideRouter or RouterModule.forRoot APIs.
The following Router properties have been removed from
the public API:
These should instead be configured through the
provideRouter
orRouterModule.forRoot
APIs.The
setupTestingRouter
function has been removed. UseRouterModule.forRoot
orprovideRouter
to setup theRouter
fortests instead.
malformedUriErrorHandler
is no longer available inthe
RouterModule.forRoot
options. URL parsing errors should instead behandled in the
UrlSerializer.parse
method.zone.js
Deep and legacy
dist/
imports likezone.js/bundles/zone-testing.js
andzone.js/dist/zone
are no longer allowed.zone-testing-bundle
andzone-testing-node-bundle
are also no longer part of the package.The proper way to import
zone.js
andzone.js/testing
is:Deprecations
animations
AnimationDriver.NOOP
symbol is deprecated, useNoopAnimationDriver
instead.core
ChangeDetectorRef.checkNoChanges
is deprecated.Test code should use
ComponentFixture
instead ofChangeDetectorRef
.Application code should not call
ChangeDetectorRef.checkNoChanges
directly.Swapping out the context object for
EmbeddedViewRef
is no longer supported. Support for this was introduced with v12.0.0, but
this pattern is rarely used. There is no replacement, but you can use
simple assignments in most cases, or
Object.assign
, or alternativelystill replace the full object by using a
Proxy
(seeNgTemplateOutlet
as an example).
Also adds a warning if the deprecated
NgProbeToken
The
NgProbeToken
is not used internally since the transition from View Engine to Ivy. The token has no utility and can be removed from applications and libraries.animations
AnimationDriver.NOOP
(#51843)benchpress
common
DatePipeConfig
(#51287)compiler
compiler-cli
core
ChangeDetectorRef.checkNoChanges
(#52431)CompilerOptions.useJit
andCompilerOptions.missingTranslation
. (#49672)rejectErrors
option totoSignal
(#52474)afterRender
in reactive contexts (#52138)effect
inside reactive contexts (#52138)performance.mark
(#52505)getDependenciesFromInjectable
(#52450)EmbeddedViewRef
(#51887)NgProbeToken
(#51396)http
language-service
localize
migrations
TransferState
,StateKey
andmakeStateKey
migration. (#49594)platform-browser
EventManagerPlugin
in the public API. (#49969)withNoDomReuse
function (#52057)platform-server
router
urlHandlingStrategy
from public Router properties (#51631)ExtraOptions
(#51745)v16.2.12
Compare Source
animations
finish
listener once player is destroyed (#51136)common
compiler-cli
v16.2.11
Compare Source
core
providedIn
(#52365)router
RouterTestingHarness
should throw if a component is expected but navigation fails (#52357)v16.2.10
Compare Source
v16.2.9
Compare Source
forms
v16.2.8
Compare Source
language-service
ts.Project
reloads (#51912)service-worker
v16.2.7
Compare Source
core
service-worker
handleFetch
fails (#51885)v16.2.6
Compare Source
core
v16.2.5
Compare Source
v16.2.4
Compare Source
v16.2.3
Compare Source
animations
compiler-cli
core
language-service
v16.2.2
Compare Source
common
compiler-cli
core
router
canceledNavigationResolution: 'computed'
works on first page (#51441)v16.2.1
Compare Source
animations
finish
listener once player is destroyed (#51136)common
compiler-cli
v16.2.0
Compare Source
benchpress
common
compiler
compiler-cli
core
router
fixture
of theRouterTestingHarness
(#50280)v16.1.9
Compare Source
v16.1.8
Compare Source
compiler
v16.1.7
Compare Source
http
Zone
is defined (#51119)v16.1.6
Compare Source
http
v16.1.5
Compare Source
animations
core
deref
returningnull
onRefactiveNode
. (#50992)platform-browser
REMOVE_STYLES_ON_COMPONENT_DESTROY
is enabled. (#51005)upgrade
takeUntil
on leaky subscription. (#50901)v16.1.4
Compare Source
core
setTimeout
when coalescing tasks in Node.js (#50820)upgrade
v16.1.3
Compare Source
core
elements
platform-browser
v16.1.2
Compare Source
http
v16.1.1
Compare Source
compiler-cli
core
migrations
v16.1.0
Compare Source
compiler
core
http
fetch
Backend for theHttpClient
(#50247)v16.0.6
Compare Source
core
v16.0.5
Compare Source
compiler
core
ngOnInit
correctly before server render (#50573)platform-server
v16.0.4
Compare Source
animations
common
core
ApplicationRef.isStable
to account for rendering pending tasks (#50425)v16.0.3
Compare Source
core
Self
flag inside embedded views with custom injectors (#50270)http
v16.0.2
Compare Source
core
isSignal
function (#50035)v16.0.1
Compare Source
core
v16.0.0
Compare Source
Blog post "Angular v16 is now available".
Breaking Changes
EventManager
methodaddGlobalEventListener
has been removed as it is not used by Ivy.bazel
common
MockPlatformLocation
is now provided by default in tests.Existing tests may have behaviors which rely on
BrowserPlatformLocation
instead. For example, direct access to thewindow.history
in either the test or the component rather than goingthrough the Angular APIs (
Location.getState()
). The quickest fix is toupdate the providers in the test suite to override the provider again
TestBed.configureTestingModule({providers: [{provide: PlatformLocation, useClass: BrowserPlatformLocation}]})
.The ideal fix would be to update the code to instead be compatible with
MockPlatformLocation
instead.Before the change, the following template was compiling:
However, it does not compile now because the 'xxx' property does not exist in 'MyContext', resulting in the error: 'Type '{ $implicit: string; xxx: string; }' is not assignable to type 'MyContext'.'
The solution is either:
XhrFactory
export from@angular/common/http
has been removed. UseXhrFactory
from@angular/common
instead.compiler
core
QueryList.filter now supports type guard functions, which will result in type narrowing. Previously if you used type guard functions, it resulted in no changes to the return type. Now the type would be narrowed, which might require updates to the application code that relied on the old behavior.
zone.js
versions0.11.x
and0.12.x
are not longer supported.entryComponents
has been deleted from the@NgModule
and@Component
public APIs. Any usages can be removed since they weren't doing anyting.ANALYZE_FOR_ENTRY_COMPONENTS
injection token has been deleted. Any references can be removed.ComponentRef.setInput will only set the input on the
component if it is different from the previous value (based on
Object.is
equality). If code relies on the input always being set, it should be
updated to copy objects or wrap primitives in order to ensure the input
value differs from the previous call to
setInput
.RendererType2.styles
no longer accepts a nested arrays.The
APP_ID
token value is no longer randomly generated. If you are bootstrapping multiple application on the same page you will need to set to provide theAPP_ID
yourself.The
ReflectiveInjector
and related symbols were removed. Please update the code to avoid references to theReflectiveInjector
symbol. UseInjector.create
as a replacement to create an injector instead.Node.js v14 support has been removed
Node.js v14 is planned to be End-of-Life on 2023-04-30. Angular will stop supporting Node.js v14 in Angular v16. Angular v16 will continue to officially support Node.js versions v16 and v18.
platform-browser
BrowserTransferStateModule
was removed, since it's no longer needed. TheTransferState
class can be injected without providing the module. TheBrowserTransferStateModule
was empty starting from v14 and you can just remove the reference to that module from your applications.platform-server
Users that are using SSR with JIT mode will now need to add
import to @​angular/compiler
before bootstrapping the application.NOTE: this does not effect users using the Angular CLI.
renderApplication
method no longer accepts a root component as first argument. Instead, provide a bootstrapping function that returns aPromise<ApplicationRef>
.Before
Now
renderModuleFactory
has been removed. UserenderModule
instead.router
Scroll
event'srouterEvent
property may also bea
NavigationSkipped
event. Previously, it was only aNavigationEnd
event.
ComponentFactoryResolver
has been removed from Router APIs.Component factories are not required to create an instance of a component
dynamically. Passing a factory resolver via resolver argument is no longer needed
and code can instead use
ViewContainerRef.createComponent
without thefactory resolver.
RouterEvent
type is no longer present in theEvent
union type representing all router event types. If you have code using something likefilter((e: Event): e is RouterEvent => e instanceof RouterEvent)
, you'll need to update it tofilter((e: Event|RouterEvent): e is RouterEvent => e instanceof RouterEvent)
.ActivatedRoute
instances may need to be adjustedbecause Router.createUrlTree now does the right thing in more
scenarios. This means that tests with invalid/incomplete ActivatedRoute mocks
may behave differently than before. Additionally, tests may now navigate
to a real URL where before they would navigate to the root. Ensure that
tests provide expected routes to match.
There is rarely production impact, but it has been found that relative
navigations when using an
ActivatedRoute
that does not appear in thecurrent router state were effectively ignored in the past. By creating
the correct URLs, this sometimes resulted in different navigation
behavior in the application. Most often, this happens when attempting to
create a navigation that only updates query params using an empty
command array, for example
router.navigate([], {relativeTo: route, queryParams: newQueryParams})
. In this case, therelativeTo
propertyshould be removed.
Deprecations
core
makeStateKey
,StateKey
andTransferState
exports have been moved from@angular/platform-browser
to@angular/core
. Please update the imports.EnvironmentInjector.runInContext
is now deprecated, withrunInInjectionContext
functioning as a direct replacement:The
@Directive
/@Component
moduleId
property is nowdeprecated. It did not have any effect for multiple major versions and
will be removed in v17.
platform-browser
BrowserModule.withServerTransition
has been deprecated.APP_ID
should be used instead to set the application ID.NB: Unless, you render multiple Angular applications on the same page, setting an application ID is not necessary.
Before:
After:
ApplicationConfig
has moved, please importApplicationConfig
from@angular/core
instead.platform-server
PlatformConfig.baseUrl
andPlatformConfig.useAbsoluteUrl
platform-server config options are deprecated as these were not used.EventManager
methodaddGlobalEventListener
(#49645)common
XhrFactory
export fromhttp
entrypoint (#49251)compiler
extends
(#49125)compiler-cli
nSkipHydration
(#49512)core
assertInInjectionContext
(#49529)mergeApplicationConfig
method (#49253)NgZone
inbootstrapApplication
(#49557)moduleId
references (#49496)factories
property forIterableDiffers
: Breaking change (#49598)zone.js
versions<=0.12.0
(#49331)makeStateKey
,StateKey
andTransferState
(#49563)takeUntilDestroyed
in rxjs-interop (#49154)runInInjectionContext
and deprecate prior version (#49396)moduleId
@Component
property (#49496)InitialRenderPendingTasks
promise on complete (#49784)markForCheck
(#49711)RendererType2.styles
to accept a only a flat array (#49072)ReflectiveInjector
symbol (#48103)forms
http
HttpClient
to cache requests (#49509)pendingTasks.whenAllTasksComplete
(#49784)migrations
Router
guard and resolver interfaces (#49337)platform-browser
withServerTransition
call (#49422)provideClientHydration
(#49699)TransferState
as type (#50015)ng-app-id
to style on server side (#49465)ApplicationConfig
to core (#49253)BrowserTransferStateModule
symbol (#49718)platform-server
renderApplication
now accepts a bootstrapping method (#49248)provideServerSupport
function to provide server capabilities to an application (#49380)provideServerSupport
toprovideServerRendering
(#49678)@angular/platform-browser-dynamic
(#50064)useAbsoluteUrl
andbaseUrl
(#49546)renderApplication
overload that accepts a component (#49463)renderModuleFactory
(#49247)router
Navigation
(#49235)Router
information to component inputs (#49633)service-worker
v15.2.10
Compare Source
service-worker
v15.2.9
Compare Source
common
compiler-cli
v15.2.8
Compare Source
core
http
router
v15.2.7
Compare Source
compiler
compiler-cli
core
markForCheck
(#49747)Special Thanks
Alan Agius, Andrew Kushnir, Andrew Scott, Kristiyan Kostadinov, Matthieu Riegler and Nikola Kološnjaji
v15.2.6
Compare Source
core
router
Special Thanks
Andrew Scott, Guillaume Weghsteen, John Manners, Johnny Gérard, Matthieu Riegler, Robin Richtsfeld, Sandra Limacher, Sarthak Thakkar, Vinit Neogi and vikram menon
v15.2.5
Compare Source
common
compiler
core
router
Special Thanks
Alan Agius, Andrew Scott, Asaf Malin, Jan Cabadaj, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Sid and Tano Abeleyra
v15.2.4
Compare Source
core
TestBed.configureTestingModule
to work with recursive cycle of standalone components. (#49473)Special Thanks
Aditya Srinivasan, Alex Rickabaugh, Andrew Scott, Kristiyan Kostadinov, Masaoki Kobayashi, Matthieu Riegler, Paul Gschwendtner, Peter Götz, Thomas Pischke, Virginia Dooley and avmaxim
v15.2.3
Compare Source
Special Thanks
Alan Agius, Esteban Gehring, Matthieu Riegler and Virginia Dooley
v15.2.2
Compare Source
migrations
Special Thanks
Alan Agius, Andrew Kushnir, Andrew Scott, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Sai Kartheek Bommisetty and Vinit Neogi
v15.2.1
Compare Source
service-worker
v15.2.0
Compare Source
Deprecations
InjectionToken
guards and resolvers aredeprecated. Instead, write guards as plain JavaScript functions and
inject dependencies with
inject
from@angular/core
.common
compiler-cli
core
language-service
migrations
enum
inmode
option instandalone
schema (#48851)platform-browser
platform-server
router
Special Thanks
Alan Agius, Alex Castle, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Dylan Hunn, Ikko Eltociear Ashimine, Ilyass, Jessica Janiuk, Joey Perrott, John Manners, Kalbarczyk, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Virginia Dooley, Walid Bouguima, cexbrayat and mgechev
v15.1.5
Compare Source
forms
[attr.disabled]
(#48864)Special Thanks
AleksanderBodurri, Alvaro Junqueira, Dylan Hunn, Joey Perrott, Matthieu Riegler, PaloMiklo and Paul Gschwendtner
v15.1.4
Compare Source
Special Thanks
Jessica Janiuk, Kian Yang Lee, Matthieu Riegler, Redouane Bekkouche and Simona Cotin
v15.1.3
Compare Source
animations
common
compiler
migrations
platform-server
script
before otherscript
tags (#48868)router
Special Thanks
Alan Agius, Besim Gürbüz, Brecht Billiet, Dario Piotrowicz, Dylan Hunn, Iván Navarro, Jessica Janiuk, Kristiyan Kostadinov, Matthieu Riegler, Onkar Ruikar, Payam Valadkhan, Santosh Yadav, Virginia Dooley and Walid Bouguima
v15.1.2
Compare Source
compiler
compiler-cli
router
Special Thanks
Alan Agius, AleksanderBodurri, Andrew Kushnir, Andrew Scott, Charles Lyding, Dylan Hunn, JoostK, Matthieu Riegler, Paul Gschwendtner, Payam Valadkhan, Virginia Dooley, Yann Thomas LE MOIGNE and dario-piotrowicz
v15.1.1
Compare Source
common
Location
to get a normalized URL valid in case a represented URL starts with the substring equalsAPP_BASE_HREF
(#48489)core
Special Thanks
Alan Agius, Alex Rickabaugh, Andrew Scott, Aristeidis Bampakos, Bob Watson, Jens, Konstantin Kharitonov, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Vladyslav Slipchenko, ced, dario-piotrowicz, mgechev and ノウラ
v15.1.0
Compare Source
Deprecations
router
CanLoad guards in the Router are deprecated. Use CanMatch
instead.
router writable properties
The following strategies are meant to be configured by registering the
application strategy in DI via the
providers
in the rootNgModule
orbootstrapApplication
:routeReuseStrategy
titleStrategy
urlHandlingStrategy
The following options are meant to be configured using the options
available in
RouterModule.forRoot
orprovideRouter
.onSameUrlNavigation
paramsInheritanceStrategy
urlUpdateStrategy
canceledNavigationResolution
The following options are available in
RouterModule.forRoot
but notavailable in
provideRouter
:malformedUriErrorHandler
- This was found to not be used anywhereinternally.
errorHandler
- Developers can instead subscribe toRouter.events
and filter for
NavigationError
.common
compiler
compiler-cli
@babel/core
dependency and lock version (#48634)core
TestBed.runInInjectionContext
to help test functions which useinject
(#47955)isStandalone()
function available in public API (#48114)forms
language-service
package.json
for vscode extension resolution (#48678)/api
entry-point (#48670)localize
@angular/localize
on `ng add (#48502)migrations
router
onSameUrlNavigation
default per-navigation (#48050)Special Thanks
Alan Agius, Alex Castle, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Bob Watson, Charles Lyding, Derek Cormier, Doug Parker, Dylan Hunn, George Kalpakas, Greg Magolan, Jessica Janiuk, JiaLiPassion, Joey Perrott, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Renan Ferro, Tim Gates, Vadim, Virginia Dooley, ced, mgechev, piyush132000, robertIsaac and sr5434
v15.0.4
Compare Source
animations
common
compiler-cli
Special Thanks
Alan Agius, Andrew Kushnir, Andrew Scott, Aristeidis Bampakos, Bob Watson, BrowserPerson, Jens, Jessica Janiuk, Joey Perrott, JoostK, Konstantin Kharitonov, Lukas Matta, Piotr Kowalski, Virginia Dooley, Yannick Baron, dario-piotrowicz, lsst25, piyush132000 and why520crazy
v15.0.3
Compare Source
common
Location
to support base href containingorigin
(#48327)compiler
compiler-cli
core
Special Thanks
Alan Agius, Alex Castle, Andrew Kushnir, Andrew Scott, Bob Watson, Derek Cormier, Joey Perrott, Konstantin Kharitonov, Kristiyan Kostadinov, Paul Gschwendtner, Pawel Kozlowski, dario-piotrowicz and piyush132000
v15.0.2
Compare Source
compiler-cli
Special Thanks
Alan Agius, Andrew Scott, Aristeidis Bampakos, Bob Watson, Derek Cormier, JoostK, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Rokas Brazdžionis, mgechev and piyush132000
v15.0.1
Compare Source
common
forms
language-service
router
Special Thanks
Alan Agius, Andrew Scott, Bjarki, Bob Watson, Brooke, Derek Cormier, Dylan Hunn, George Kalpakas, Greg Magolan, Ikko Ashimine, Ivan Rodriguez, Jessica Janiuk, Joe Roxbury, Joey Perrott, Kristiyan Kostadinov, Matthieu Riegler, Mikhail Savchuk, Nebojsa Cvetkovic, Pawel Kozlowski, Volodymyr and Wooshaah
v15.0.0
Compare Source
Blog post "Angular v15 is now available".
Breaking Changes
compiler
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:
None
orShadowDom
compiler-cli
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 parameterswhich 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.
Angular compiler option
enableIvy
has been removed as Ivy is the only rendering engine.core
14.[15-19].x
and16.[10-12].x
. Current supported versions of Node.js are14.20.x
,16.13.x
and18.10.x
.src
orsrcdoc
preceding other attributes. Such usages may need to be updated to ensure compliance with the new stricter rules around iframe bindings.forms
ControlValueAccessor
is attached. You can opt-out withFormsModule.withConfig
orReactiveFormsModule.withConfig
.localize
canParse
method has been removed from all translation parsers in@angular/localize/tools
.analyze
should be used instead.hint
parameter in theparse
methods is now mandatory.router
RouterOutlet
would immediatelyinstantiate 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.
relativeLinkResolution
is no longer configurable inthe Router. This option was used as a means to opt out of a bug fix.
Deprecations
common
DATE_PIPE_DEFAULT_TIMEZONE
token is now deprecated in favorof the
DATE_PIPE_DEFAULT_OPTIONS
token, which accepts an objectas a value and the timezone can be defined as a field (called
timezone
)on that object.
core
NgModule
to theprovidedIn
option for@Injectable
andInjectionToken
is now deprecated.providedIn: NgModule
was intended to be a tree-shakable alternative toNgModule providers. It does not have wide usage, and in most cases is used
incorrectly, in circumstances where
providedIn: 'root'
should bepreferred. If providers should truly be scoped to a specific NgModule, use
NgModule.providers
instead.providedIn: 'any'
for an@Injectable
orInjectionToken
is now deprecated.providedIn: 'any'
is an option with confusing semantics and is almostnever used apart from a handful of esoteric cases internal to the framework.
The bit field signature of
Injector.get()
has been deprecated, in favor of the new options object.The bit field signature of
TestBed.inject()
has been deprecated, in favor of the new options object.router
RouterLinkWithHref
directive is deprecated, use theRouterLink
directive instead. TheRouterLink
contains the code from theRouterLinkWithHref
to handle elements withhref
attributes.common
provideLocationMocks()
function to provide Location mocks (#47674)rawSrc
->ngSrc
in NgOptimizedImage directive (#47362)compiler
compiler-cli
strictInjectionParameters
requirement (#44615)enableIvy
options (#47346)core
providedIn: NgModule
andprovidedIn: 'any'
(#47616)Update dependency @angular/common to v17to Update dependency @angular/common to v17 - autoclosedPull request closed