fix(deps): update angular monorepo to v18 (major) #4230
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^15.1.2->^18.0.0^15.1.2->^18.0.0^15.1.2->^18.0.015.2.10->18.0.6^15.1.2->^18.0.0^15.1.2->^18.0.0^15.1.2->^18.0.0^15.1.2->^18.0.0^15.1.2->^18.0.0^15.1.2->^18.0.0Release Notes
angular/angular (@angular/animations)
v18.0.6Compare Source
common
core
router
v18.0.5Compare Source
core
@defererror. (#56559)v18.0.4Compare Source
compiler-cli
core
router
v18.0.3Compare Source
benchpress
core
localize
@angular/localize/initas polyfill inangular.json(#56300)migrations
v18.0.2Compare Source
core
HttpClientModuleimports on components. (#56067)withI18nSupport()call for components that use i18n blocks (#56175)migrations
v18.0.1Compare Source
compiler
compiler-cli
core
migrations
v18.0.0Compare Source
Blog post "Angular v18 is now available".
Breaking Changes
animations
matchesElementmethod has been removed fromAnimationDriveras it is unused.common
isPlatformWorkerUiandisPlatformWorkerApphave been removed without replacement, as they serve no purpose since the removal of the WebWorker platform.compiler
compiler-cli
core
OnPushviews 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
OnPushchange detection strategy.OnPushviews 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
OnPushchange detection strategy.The
ComponentFixtureautoDetectfeature will nolonger refresh the component's host view when the component is
OnPushand not marked dirty. This exposes existing issues in components which
claim to be
OnPushbut do not correctly callmarkForCheckwhen theyneed to be refreshed. If this change causes test failures, the easiest
fix is to change the component to
ChangeDetectionStrategy.Default.ComponentFixture.whenStablenow matches theApplicationRef.isStableobservable. Prior to this change, stabilityof the fixture did not include everything that was considered in
ApplicationRef.whenStableof the fixture will now include unfinishedrouter navigations and unfinished
HttpClientrequests. This will causetests that
awaitthewhenStablepromise to time out when there areincomplete requests. To fix this, remove the
whenStable,instead wait for another condition, or ensure
HttpTestingControllermocks responses for all requests. Try adding
HttpTestingController.verify()before your
await fixture.whenStableto 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.isStablewould 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
TestBedproviders.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
bootstrapApplicationor addschedulingMode: NgZoneSchedulingMode.NgZoneOnlyto theBootstrapOptionsofbootstrapModule.When Angular runs change detection, it will continue to
refresh any views attached to
ApplicationRefthat 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
NG0103code.asynchas been removed, usewaitForAsyncinstead.The
ComponentFixture.autoDetectfeature 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
NgZoneis now the first of eithersetTimeoutorrequestAnimationFrame. Code which relies on thistiming (usually by accident) will need to be adjusted. If a callback
needs to execute after change detection, we recommend
afterNextRenderinstead 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
ExpressionChangedAfterItHasBeenCheckedErroror 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,decreasePendingRequestCountandgetPendingRequestCounthave 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
includeRequestsWithAuthHeadersoption inwithHttpTransferCache.Example:
platform-browser
StateKey,TransferStateandmakeStateKeyhave been removed from@angular/platform-browser, use the same APIs from@angular/core.platform-browser-dynamic
RESOURCE_CACHE_PROVIDERAPIs have been removed.platform-server
deprecated
platformDynamicServerhas been removed. Add animport @​angular/compilerand replace the usage withplatformServerdeprecated
ServerTransferStateModulehas been removed.TransferStatecan be use without providing this module.deprecated
useAbsoluteUrlandbaseUrlbeen removed fromPlatformConfig. Provide and absoluteurlinstead.Legacy handling or Node.js URL parsing has been removed from
ServerPlatformLocation.The main differences are;
pathnameis always suffixed with a/.portis empty whenhttp:protocol and port in url is80portis empty whenhttps:protocol and port in url is443router
RedirectCommandfor redirectsin addition to
UrlTree. Code which expects onlybooleanorUrlTreevalues in
Routetypes will need to be adjusted.Route.redirectToto be a functionin addition to the previous string. Code which expects
redirectTotoonly be a string on
Routeobjects will need to be adjusted.UrlTreeas a redirect, theredirecting navigation will now use
replaceUrlif the initialnavigation was also using the
replaceUrloption. If this is notdesirable, the redirect can configure new
NavigationBehaviorOptionsbyreturning a
RedirectCommandwith 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
RouterOutletwill no longer be available toroute components in any circumstances. This was already the case
whenever routes defined providers, either through lazy loading an
NgModuleor through explicitproviderson 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
RouterOutletwill no longer be available toroute components in any circumstances. This was already the case
whenever routes defined providers, either through lazy loading an
NgModuleor through explicitproviderson 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,getNumberOfCurrencyDigitscore
@Component.interpolationis deprecated. Use Angular'sdelimiters instead.
http
HttpClientModule,HttpClientXsrfModuleandHttpClientJsonpModuleAs mentionned, those modules can be replaced by provider function only.
animations
matchesElementfromAnimationDriver(#55479)common
isPlatformWorkerAppandisPlatformWorkerUiAPI (#55302)compiler
FatalDiagnosticError, hide themessagefield without affecting the emit (#55160)compiler-cli
@ifwith aliases (#55835)core
ApplicationRef.tickshould respect OnPush for host bindings (#53718)ApplicationRef.tickshould respect OnPush for host bindings (#53718) (#53718)ComponentFixtureautoDetectrespectsOnPushflag of host view (#54824)ComponentFixturestability should matchApplicationRef(#54949)asyncfunction (#55491)setTimeoutandrAFreferences (#55124)addEvent(#55353)markForCheckduring change detection from causing infinite loops (#54900)@Component.interpolation(#55778)forms
http
withRequestsMadeViaParentbehavior withwithFetch(#55652)HttpClientModule& related modules (#54020)language-service
migrations
HttpClientModule(#54020)platform-browser
platform-browser-dynamic
RESOURCE_CACHE_PROVIDERAPI has been removed (#54875)platform-server
nonceattribute to event record script (#55495)platformDynamicServerAPI (#54874)ServerTransferStateModuleAPI (#54874)useAbsoluteUrlandbaseUrlfromPlatformConfig(#54874)router
withNavigationErrorHandlercan convert errors to redirects (#55370)UrlTreewithNavigationBehaviorOptionsfrom guards (#45023)RedirectCommand(#54556)RouterOutletEnvironmentInjector(#54265)RouterOutletEnvironmentInjector(#54265)service-worker
controllerchange(#54222)controllerchangelistener when app is destroyed (#55365)v17.3.11Compare Source
17.3.11 (2024-06-05)
v17.3.10Compare Source
v17.3.9Compare Source
v17.3.8Compare Source
compiler
core
v17.3.7Compare Source
compiler-cli
core
router
v17.3.6Compare Source
core
ActivatedRouteinject correct instance inside@deferblocks (#55374)v17.3.5Compare Source
v17.3.4Compare Source
common
v17.3.3Compare Source
17.3.3 (2024-04-03)
core
ChainedInjectors in injector debug utils (#55144)migrations
v17.3.2Compare Source
compiler
compiler-cli
core
@deferblocks (#55079)http
migrations
router
v17.3.1Compare Source
v17.3.0Compare Source
compiler
compiler-cli
ModuleWithProvidersliteral detection withtypeof(#54650)core
output()API (#54650)outputFromObservable()interop function (#54650)outputToObservableinterop helper (#54650)asReadonly. (#54706)DestroyRefinEventEmitter(#54748)http
router
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Renovate Bot.