Update dependency @angular/animations to v18 - autoclosed #137
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "renovate_angular-animations-18.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
->^18.0.0
Release Notes
angular/angular (@angular/animations)
v18.2.12
Compare Source
compiler-cli
v18.2.11
Compare Source
core
v18.2.10
Compare Source
compiler
localize
v18.2.9
Compare Source
compiler-cli
v18.2.8
Compare Source
compiler
compiler-cli
core
platform-server
PlatformRef
when error happens during thebootstrap()
phase (#58112) (#58135)v18.2.7
Compare Source
common
compiler-cli
core
http
migrations
upgrade
v18.2.6
Compare Source
v18.2.5
Compare Source
compiler-cli
core
@let
declaration with array whenpreparingForHydration
(#57816)migrations
v18.2.4
Compare Source
compiler
migrations
v18.2.3
Compare Source
http
v18.2.2
Compare Source
core
http
router
upgrade
v18.2.1
Compare Source
compiler-cli
v18.2.0
Compare Source
compiler
compiler-cli
jit: true
opt-out (#56892)@NgModule
classes withjit: true
(#57212)core
language-service
migrations
router
v18.1.5
Compare Source
compiler-cli
core
v18.1.4
Compare Source
compiler
compiler-cli
interpolatedSignalNotInvoked
extended diagnostic (#57291)language-service
v18.1.3
Compare Source
compiler
compiler-cli
core
v18.1.2
Compare Source
compiler
compiler-cli
core
afterNextRender
hooks return that callback value. (#57031)v18.1.1
Compare Source
common
compiler
compiler-cli
core
migrations
v18.1.0
Compare Source
common
compiler
compiler-cli
core
toSignal
(#56447)ComponentMirror
(#56402)afterRender
&afterNextRender
phases API (#55648)forms
NgControlStatus
host bindingsOnPush
compatible (#55720)http
Content-Type
header case insensitive (#56541)language-service
router
UrlTree
as an input torouterLink
(#56265)v18.0.7
Compare Source
compiler
http
fetch
outside of Angular zone (#56820)migrations
v18.0.6
Compare Source
common
core
router
v18.0.5
Compare Source
core
@defer
error. (#56559)v18.0.4
Compare Source
compiler-cli
core
router
v18.0.3
Compare Source
benchpress
core
localize
@angular/localize/init
as polyfill inangular.json
(#56300)migrations
v18.0.2
Compare Source
core
HttpClientModule
imports on components. (#56067)withI18nSupport()
call for components that use i18n blocks (#56175)migrations
v18.0.1
Compare Source
compiler
compiler-cli
core
migrations
v18.0.0
Compare Source
Blog post "Angular v18 is now available".
Breaking Changes
animations
matchesElement
method has been removed fromAnimationDriver
as it is unused.common
isPlatformWorkerUi
andisPlatformWorkerApp
have been removed without replacement, as they serve no purpose since the removal of the WebWorker platform.compiler
compiler-cli
core
OnPush
views at the root of the application need tobe marked dirty for their host bindings to refresh. Previously, the host
bindings were refreshed for all root views without respecting the
OnPush
change detection strategy.OnPush
views at the root of the application need tobe marked dirty for their host bindings to refresh. Previously, the host
bindings were refreshed for all root views without respecting the
OnPush
change detection strategy.The
ComponentFixture
autoDetect
feature will nolonger refresh the component's host view when the component is
OnPush
and not marked dirty. This exposes existing issues in components which
claim to be
OnPush
but do not correctly callmarkForCheck
when theyneed to be refreshed. If this change causes test failures, the easiest
fix is to change the component to
ChangeDetectionStrategy.Default
.ComponentFixture.whenStable
now matches theApplicationRef.isStable
observable. Prior to this change, stabilityof the fixture did not include everything that was considered in
ApplicationRef
.whenStable
of the fixture will now include unfinishedrouter navigations and unfinished
HttpClient
requests. This will causetests that
await
thewhenStable
promise to time out when there areincomplete requests. To fix this, remove the
whenStable
,instead wait for another condition, or ensure
HttpTestingController
mocks responses for all requests. Try adding
HttpTestingController.verify()
before your
await fixture.whenStable
to identify the open requests.Also, make sure your tests wait for the stability promise. We found many
examples of tests that did not, meaning the expectations did not execute
within the test body.
In addition,
ComponentFixture.isStable
would synchronously switch totrue in some scenarios but will now always be asynchronous.
Angular will ensure change detection runs, even when the state update originates from
outside the zone, tests may observe additional rounds of change
detection compared to the previous behavior.
This change will be more likely to impact existing unit tests.
This should usually be seen as more correct and the test should be updated,
but in cases where it is too much effort to debug, the test can revert to the old behavior by adding
provideZoneChangeDetection({schedulingMode: NgZoneSchedulingMode.NgZoneOnly})
to the
TestBed
providers.Similarly, applications which may want to update state outside the zone
and not trigger change detection can add
provideZoneChangeDetection({schedulingMode: NgZoneSchedulingMode.NgZoneOnly})
to the providers in
bootstrapApplication
or addschedulingMode: NgZoneSchedulingMode.NgZoneOnly
to theBootstrapOptions
ofbootstrapModule
.When Angular runs change detection, it will continue to
refresh any views attached to
ApplicationRef
that are still marked forcheck after one round completes. In rare cases, this can result in infinite
loops when certain patterns continue to mark views for check using
ChangeDetectorRef.detectChanges
. This will be surfaced as a runtimeerror with the
NG0103
code.async
has been removed, usewaitForAsync
instead.The
ComponentFixture.autoDetect
feature now executeschange detection for the fixture within
ApplicationRef.tick
. This moreclosely matches the behavior of how a component would refresh in
production. The order of component refresh in tests may be slightly
affected as a result, especially when dealing with additional components
attached to the application, such as dialogs. Tests sensitive to this
type of change (such as screenshot tests) may need to be updated.
Concretely, this change means that the component will refresh before
additional views attached to
ApplicationRef
(i.e. dialog components).Prior to this change, the fixture component would refresh after other
views attached to the application.
The exact timing of change detection execution when
using event or run coalescing with
NgZone
is now the first of eithersetTimeout
orrequestAnimationFrame
. Code which relies on thistiming (usually by accident) will need to be adjusted. If a callback
needs to execute after change detection, we recommend
afterNextRender
instead of something like
setTimeout
.Newly created and views marked for check and reattached
during change detection are now guaranteed to be refreshed in that same
change detection cycle. Previously, if they were attached at a location
in the view tree that was already checked, they would either throw
ExpressionChangedAfterItHasBeenCheckedError
or not be refreshed untilsome future round of change detection. In rare circumstances, this
correction can cause issues. We identified one instance that relied on
the previous behavior by reading a value on initialization which was
queued to be updated in a microtask instead of being available in the
current change detection round. The component only read this value during
initialization and did not read it again after the microtask updated it.
Testability methods
increasePendingRequestCount
,decreasePendingRequestCount
andgetPendingRequestCount
have beenremoved. This information is tracked with zones.
http
By default we now prevent caching of HTTP requests that require authorization . To opt-out from this behaviour use the
includeRequestsWithAuthHeaders
option inwithHttpTransferCache
.Example:
platform-browser
StateKey
,TransferState
andmakeStateKey
have been removed from@angular/platform-browser
, use the same APIs from@angular/core
.platform-browser-dynamic
RESOURCE_CACHE_PROVIDER
APIs have been removed.platform-server
deprecated
platformDynamicServer
has been removed. Add animport @​angular/compiler
and replace the usage withplatformServer
deprecated
ServerTransferStateModule
has been removed.TransferState
can be use without providing this module.deprecated
useAbsoluteUrl
andbaseUrl
been removed fromPlatformConfig
. Provide and absoluteurl
instead.Legacy handling or Node.js URL parsing has been removed from
ServerPlatformLocation
.The main differences are;
pathname
is always suffixed with a/
.port
is empty whenhttp:
protocol and port in url is80
port
is empty whenhttps:
protocol and port in url is443
router
RedirectCommand
for redirectsin addition to
UrlTree
. Code which expects onlyboolean
orUrlTree
values in
Route
types will need to be adjusted.Route.redirectTo
to be a functionin addition to the previous string. Code which expects
redirectTo
toonly be a string on
Route
objects will need to be adjusted.UrlTree
as a redirect, theredirecting navigation will now use
replaceUrl
if the initialnavigation was also using the
replaceUrl
option. If this is notdesirable, the redirect can configure new
NavigationBehaviorOptions
byreturning a
RedirectCommand
with the desired options instead ofUrlTree
.come from the injector heirarchy of the routes and never inherit from
the
RouterOutlet
. This means that providers available only to thecomponent that defines the
RouterOutlet
will no longer be available toroute components in any circumstances. This was already the case
whenever routes defined providers, either through lazy loading an
NgModule
or through explicitproviders
on the route config.come from the injector heirarchy of the routes and never inherit from
the
RouterOutlet
. This means that providers available only to thecomponent that defines the
RouterOutlet
will no longer be available toroute components in any circumstances. This was already the case
whenever routes defined providers, either through lazy loading an
NgModule
or through explicitproviders
on the route config.Deprecations
common
getCurrencySymbol
,getLocaleCurrencyCode
,getLocaleCurrencyName
,getLocaleCurrencySymbol
,getLocaleDateFormat
,getLocaleDateTimeFormat
,getLocaleDayNames
,getLocaleDayPeriods
,getLocaleDirection
,getLocaleEraNames
,getLocaleExtraDayPeriodRules
,getLocaleExtraDayPeriods
,getLocaleFirstDayOfWeek
,getLocaleId
,getLocaleMonthNames
,getLocaleNumberFormat
,getLocaleNumberSymbol
,getLocalePluralCase
,getLocaleTimeFormat
,getLocaleWeekEndRange
,getNumberOfCurrencyDigits
core
@Component.interpolation
is deprecated. Use Angular'sdelimiters instead.
http
HttpClientModule
,HttpClientXsrfModule
andHttpClientJsonpModule
As mentionned, those modules can be replaced by provider function only.
animations
matchesElement
fromAnimationDriver
(#55479)common
isPlatformWorkerApp
andisPlatformWorkerUi
API (#55302)compiler
FatalDiagnosticError
, hide themessage
field without affecting the emit (#55160)compiler-cli
@if
with aliases (#55835)core
ApplicationRef.tick
should respect OnPush for host bindings (#53718)ApplicationRef.tick
should respect OnPush for host bindings (#53718) (#53718)ComponentFixture
autoDetect
respectsOnPush
flag of host view (#54824)ComponentFixture
stability should matchApplicationRef
(#54949)async
function (#55491)setTimeout
andrAF
references (#55124)addEvent
(#55353)markForCheck
during change detection from causing infinite loops (#54900)@Component.interpolation
(#55778)forms
http
withRequestsMadeViaParent
behavior withwithFetch
(#55652)HttpClientModule
& related modules (#54020)language-service
migrations
HttpClientModule
(#54020)platform-browser
platform-browser-dynamic
RESOURCE_CACHE_PROVIDER
API has been removed (#54875)platform-server
nonce
attribute to event record script (#55495)platformDynamicServer
API (#54874)ServerTransferStateModule
API (#54874)useAbsoluteUrl
andbaseUrl
fromPlatformConfig
(#54874)router
withNavigationErrorHandler
can convert errors to redirects (#55370)UrlTree
withNavigationBehaviorOptions
from guards (#45023)RedirectCommand
(#54556)RouterOutlet
EnvironmentInjector
(#54265)RouterOutlet
EnvironmentInjector
(#54265)service-worker
controllerchange
(#54222)controllerchange
listener when app is destroyed (#55365)v17.3.12
Compare Source
compiler
v17.3.11
Compare Source
17.3.11 (2024-06-05)
v17.3.10
Compare Source
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
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)⚠️ Artifact update problem
Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.
♻ Renovate will retry this branch, including artifacts, only when one of the following happens:
The artifact failure details are included below:
File name: package-lock.json
Update dependency @angular/animations to v18to Update dependency @angular/animations to v18 - autoclosedPull request closed