build: update angular
This PR contains the following updates:
π‘ If you wish to disable git hash updates, add ":disableDigestUpdates" to the extends array in your config.
Release Notes
angular/angular (@βangular/animations)
v18.0.0
Breaking Changes
animations
- Deprecated
matchesElementmethod has been removed fromAnimationDriveras it is unused.
common
- The deprecated
isPlatformWorkerUiandisPlatformWorkerApphave been removed without replacement, as they serve no purpose since the removal of the WebWorker platform.
compiler
- Angular only supports writable expressions inside of two-way bindings.
compiler-cli
-
- Angular no longer supports TypeScript versions older than 5.4.
core
-
OnPushviews at the root of the application need to be marked dirty for their host bindings to refresh. Previously, the host bindings were refreshed for all root views without respecting theOnPushchange detection strategy. -
OnPushviews at the root of the application need to be marked dirty for their host bindings to refresh. Previously, the host bindings were refreshed for all root views without respecting theOnPushchange detection strategy. -
The
ComponentFixtureautoDetectfeature will no longer refresh the component's host view when the component isOnPushand not marked dirty. This exposes existing issues in components which claim to beOnPushbut do not correctly callmarkForCheckwhen they need to be refreshed. If this change causes test failures, the easiest fix is to change the component toChangeDetectionStrategy.Default. -
ComponentFixture.whenStablenow matches theApplicationRef.isStableobservable. Prior to this change, stability of the fixture did not include everything that was considered inApplicationRef.whenStableof the fixture will now include unfinished router navigations and unfinishedHttpClientrequests. This will cause tests thatawaitthewhenStablepromise to time out when there are incomplete requests. To fix this, remove thewhenStable, instead wait for another condition, or ensureHttpTestingControllermocks responses for all requests. Try addingHttpTestingController.verify()before yourawait 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 to true 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 theTestBedproviders.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 inbootstrapApplicationor addschedulingMode: NgZoneSchedulingMode.NgZoneOnlyto theBootstrapOptionsofbootstrapModule. -
When Angular runs change detection, it will continue to refresh any views attached to
ApplicationRefthat are still marked for check after one round completes. In rare cases, this can result in infinite loops when certain patterns continue to mark views for check usingChangeDetectorRef.detectChanges. This will be surfaced as a runtime error with theNG0103code. -
asynchas been removed, usewaitForAsyncinstead. -
The
ComponentFixture.autoDetectfeature now executes change detection for the fixture withinApplicationRef.tick. This more closely 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 toApplicationRef(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 this timing (usually by accident) will need to be adjusted. If a callback needs to execute after change detection, we recommendafterNextRenderinstead of something likesetTimeout. -
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 until some 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 been removed. 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:
withHttpTransferCache({ includeRequestsWithAuthHeaders: true, })
platform-browser
- Deprecated
StateKey,TransferStateandmakeStateKeyhave been removed from@angular/platform-browser, use the same APIs from@angular/core.
platform-browser-dynamic
- No longer used
RESOURCE_CACHE_PROVIDERAPIs have been removed.
platform-server
-
deprecated
platformDynamicServerhas been removed. Add animport @​angular/compilerand replace the usage withplatformServer -
deprecated
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 is80 -
portis empty whenhttps:protocol and port in url is443
-
router
- Guards can now return
RedirectCommandfor redirects in addition toUrlTree. Code which expects onlybooleanorUrlTreevalues inRoutetypes will need to be adjusted. - This change allows
Route.redirectToto be a function in addition to the previous string. Code which expectsredirectToto only be a string onRouteobjects will need to be adjusted. - When a a guard returns a
UrlTreeas a redirect, the redirecting navigation will now usereplaceUrlif the initial navigation was also using thereplaceUrloption. If this is not desirable, the redirect can configure newNavigationBehaviorOptionsby returning aRedirectCommandwith the desired options instead ofUrlTree. - Providers available to the routed components always
come from the injector heirarchy of the routes and never inherit from
the
RouterOutlet. This means that providers available only to the component that defines theRouterOutletwill no longer be available to route components in any circumstances. This was already the case whenever routes defined providers, either through lazy loading anNgModuleor through explicitproviderson the route config. - Providers available to the routed components always
come from the injector heirarchy of the routes and never inherit from
the
RouterOutlet. This means that providers available only to the component that defines theRouterOutletwill no longer be available to route components in any circumstances. This was already the case whenever routes defined providers, either through lazy loading anNgModuleor 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,getNumberOfCurrencyDigits
core
-
@Component.interpolationis deprecated. Use Angular's delimiters instead.
http
-
HttpClientModule,HttpClientXsrfModuleandHttpClientJsonpModuleAs mentionned, those modules can be replaced by provider function only.
animations
| Commit | Type | Description |
|---|---|---|
| bcce85af72 | refactor | remove deprecated matchesElement from AnimationDriver (#β55479) |
common
| Commit | Type | Description |
|---|---|---|
| d34c033902 | refactor | Deprecate Local Data API functions (#β54483) |
| 3b0de30b37 | refactor | remove deprecated isPlatformWorkerApp and isPlatformWorkerUi API (#β55302) |
compiler
| Commit | Type | Description |
|---|---|---|
| 91b007e58f | fix | add math elements to schema (#β55631) |
| 33d0102304 | fix | allow comments between connected blocks (#β55966) |
| 7fc7f3f05f | fix | capture all control flow branches for content projection in if blocks (#β54921) |
| a369f43fbd | fix | capture switch block cases for content projection (#β54921) |
| eb625d3783 | fix | declare for loop aliases in addition to new name (#β54942) |
| f824911510 | fix | For FatalDiagnosticError, hide the message field without affecting the emit (#β55160) |
| a040fb720a | fix | maintain multiline CSS selectors during CSS scoping (#β55509) |
| 39624c6b12 | fix | output input flags as a literal (#β55215) |
| eba92cfa55 | fix | prevent usage of reserved control flow symbol in custom interpolation context. (#β55809) |
| 7d5bc1c628 | fix | remove container index from conditional instruction (#β55190) |
| 4eb0165750 | fix | remove support for unassignable expressions in two-way bindings (#β55342) |
| e1650e3b13 | fix | throw error if item name and context variables conflict (#β55045) |
compiler-cli
| Commit | Type | Description |
|---|---|---|
| 5bd188a394 | feat | add partial compilation support for deferred blocks (#β54908) |
| b02b31a915 | feat | drop support for TypeScript older than 5.4 (#β54961) |
| 78188e877a | fix | add diagnostic if initializer API is used outside of an initializer (#β54993) |
| 69a83993b3 | fix | do not throw when retrieving TCB symbol for signal input with restricted access (#β55774) |
| 4f4f41016e | fix | dom property binding check in signal extended diagnostic (#β54324) |
| 7a16d7e969 | fix | don't type check the bodies of control flow nodes in basic mode (#β55360) |
| 8d93597a82 | fix | fix type narrowing of @if with aliases (#β55835) |
| 9b424d7224 | fix | preserve original reference to non-deferrable dependency (#β54759) |
| 694ba79cbf | fix | report cases where initializer APIs are used in a non-directive class (#β54993) |
| 6219341d26 | fix | report errors when initializer APIs are used on private fields (#β54981) |
| c04ffb1fa6 | fix | use switch statements to narrow Angular switch blocks (#β55168) |
core
| Commit | Type | Description |
|---|---|---|
| a730f09ae9 | feat | Add a public API to establish events to be replayed and an attribute to mark an element with an event handler. (#β55356) |
| fdd560ea14 | feat | Add ability to configure zone change detection to use zoneless scheduler (#β55252) |
| bce5e2344f | feat | Add build target for jsaction contract binary. (#β55319) |
| 666d646575 | feat | Add event delegation library to queue up events and replay them when the application is ready (#β55121) |
| 5f06ca8f55 | feat | add HOST_TAG_NAME token (#β54751) |
| a600a39d0c | feat | add support for fallback content in ng-content (#β54854) |
| 146306a141 | feat | add support for i18n hydration (#β54823) |
| f09c5a7bc4 | feat | Add zoneless change detection provider as experimental (#β55329) |
| d28614b90e | feat | Modify EventType from an enum to an object. (#β55323) |
| ac863ded48 | feat | provide ExperimentalPendingTasks API (#β55487) |
| 1ee9f32621 | feat | Synchronize changes from internal JSAction codebase. (#β55182) |
| d888da4606 | fix | ApplicationRef.tick should respect OnPush for host bindings (#β53718) |
| 64f870c12b | fix | ApplicationRef.tick should respect OnPush for host bindings (#β53718) (#β53718) |
| 8cad4e8cbe | fix | ComponentFixture autoDetect respects OnPush flag of host view (#β54824) |
| 658cf8c384 | fix | ComponentFixture stability should match ApplicationRef (#β54949) |
| 2fc11eae9e | fix | account for re-projected ng-content elements with fallback content (#β54854) |
| 0cbd73c6e9 | fix | add warning when using zoneless but zone.js is still loaded (#β55769) |
| d5edfde6ee | fix | afterRender hooks registered outside change detection can mark views dirty (#β55623) |
| de7447d15e | fix | Angular should not ignore changes that happen outside the zone (#β55102) |
| ba8e465974 | fix | Change Detection will continue to refresh views while marked for check (#β54734) |
| 5a10f405d3 | fix | complete the removal of deprecation async function (#β55491) |
| 24bc0ed4f2 | fix | ComponentFixture autodetect should detect changes within ApplicationRef.tick (#β54733) |
| 1c0ec56c46 | fix | correctly project single-root content inside control flow (#β54921) |
| 840c375255 | fix | do not save point-in-time setTimeout and rAF references (#β55124) |
| 10c5cdb49c | fix | ensure change detection runs in a reasonable timeframe with zone coalescing (#β54578) |
| ad045efd4b | fix | Ensure views marked for check are refreshed during change detection (#β54735) |
| 69085ea26e | fix | error about provideExperimentalCheckNoChangesForDebug uses wrong name (#β55824) |
| 0147e0b85a | fix | exhaustive checkNoChanges should only do a single pass (#β55839) |
| e02bcf89cf | fix | Fix clearing of pending task in zoneless cleanup implementation (#β55074) |
| 0cec9e4f9a | fix | Fix null dereference error addEvent (#β55353) |
| 44c0ed83a6 | fix | hide implementation details of ExperimentalPendingTasks (#β55516) |
| 314112de99 | fix | Prevent markForCheck during change detection from causing infinite loops (#β54900) |
| a5fa279b6e | fix | prevent i18n hydration from cleaning projected nodes (#β54823) |
| 6534c035c0 | fix | Remove deprecated Testability methods (#β53768) |
| a5c57c7484 | fix | resolve error for multiple component instances that use fallback content (#β55478) |
| f44a5e4604 | fix | support content projection and VCRs in i18n (#β54823) |
| 0510930a25 | fix | TestBed should not override NgZone from initTestEnvironment (#β55226) |
| e9a0c86766 | fix | TestBed should not override NgZone from initTestEnvironment (#β55226) |
| 700c0520bb | fix | Update ApplicationRef.tick loop to only throw in dev mode (#β54848) |
| a99cb7ce5b | fix | zoneless scheduler should check if Zone is defined before accessing it (#β55118) |
| 1fd63e9cff | refactor | deprecate @Component.interpolation (#β55778) |
forms
| Commit | Type | Description |
|---|---|---|
| 1c736dc3b2 | feat | Unified Control State Change Events (#β54579) |
| 61007dced0 | fix | Add event for forms submitted & reset (#β55667) |
| 2e27ca9ddf | fix | Allow canceled async validators to emit. (#β55134) |
http
| Commit | Type | Description |
|---|---|---|
| 6f88d80758 | feat | allow caching requests with different origins between server and client (#β55274) |
| 8eacb6e4b9 | feat | exclude caching for authenticated HTTP requests (#β55034) |
| d9b339fdbc | fix | resolve withRequestsMadeViaParent behavior with withFetch (#β55652) |
| ef665a40a5 | refactor | Deprecate HttpClientModule & related modules (#β54020) |
language-service
| Commit | Type | Description |
|---|---|---|
| 6d1b82df32 | fix | allow external projects to use provided compiler options (#β55035) |
| a48afe0d94 | fix | avoid generating TS syntactic diagnostics for templates (#β55091) |
| bd236cc150 | fix | implement getDefinitionAtPosition for Angular templates (#β55269) |
| 4166dfc1b6 | fix | prevent underlying TS Service from handling template files (#β55003) |
| b7f2fd4739 | fix | use type-only import in plugin factory (#β55996) |
migrations
| Commit | Type | Description |
|---|---|---|
| f914f6a362 | feat | Migration schematics for HttpClientModule (#β54020) |
| 8459ee46cb | fix | handle more cases in HttpClientModule migration (#β55640) |
| c4b2f18709 | fix | migrate HttpClientTestingModule in test modules (#β55803) |
| bb4a4016a9 | fix | preserve existing properties in HttpClientModule migration (#β55777) |
| f93e5180be | fix | resolve multiple structural issues with HttpClient migration (#β55557) |
platform-browser
| Commit | Type | Description |
|---|---|---|
| 45ae7a6b60 | feat | add withI18nSupport() in developer preview (#β55130) |
| 23f914f101 | fix | Use the right namespace for mathML. (#β55622) |
| cba336d4f1 | refactor | remove deprecated transfer state APIs (#β55474) |
platform-browser-dynamic
| Commit | Type | Description |
|---|---|---|
| eb20c1a8b1 | refactor | unused RESOURCE_CACHE_PROVIDER API has been removed (#β54875) |
platform-server
| Commit | Type | Description |
|---|---|---|
| 5674c644ab | fix | add nonce attribute to event record script (#β55495) |
| e71e869112 | fix | remove event dispatch script from HTML when hydration is disabled (#β55681) |
| 07ac017731 | refactor | remove deprecated platformDynamicServer API (#β54874) |
| e8b588d8b7 | refactor | remove deprecated ServerTransferStateModule API (#β54874) |
| 3b1967ca64 | refactor | remove deprecated useAbsoluteUrl and baseUrl from PlatformConfig (#β54874) |
| 2357d3566c | refactor | remove legacy URL handling logic (#β54874) |
router
| Commit | Type | Description |
|---|---|---|
| 4a42961393 | feat | withNavigationErrorHandler can convert errors to redirects (#β55370) |
| 8735af08b9 | feat | Add ability to return UrlTree with NavigationBehaviorOptions from guards (#β45023) |
| 87f3f27f90 | feat | Allow resolvers to return RedirectCommand (#β54556) |
| 2b802587f2 | feat | Allow Route.redirectTo to be a function which returns a string or UrlTree (#β52606) |
| 60f1d681e0 | fix | preserve replaceUrl when returning a urlTree from CanActivate (#β54042) |
| 3839cfbb18 | fix | Routed components never inherit RouterOutlet EnvironmentInjector (#β54265) |
| da906fdafc | fix | Routed components never inherit RouterOutlet EnvironmentInjector (#β54265) |
service-worker
| Commit | Type | Description |
|---|---|---|
| 3bc63eaaf3 | fix | avoid running CDs on controllerchange (#β54222) |
| e598634c10 | fix | remove controllerchange listener when app is destroyed (#β55365) |
v18.0.0-rc.3
18.0.0-rc.3 (2024-05-21)
compiler
| Commit | Description |
|---|---|
| allow comments between connected blocks (#β55966) | |
| prevent usage of reserved control flow symbol in custom interpolation context. (#β55809) |
compiler-cli
| Commit | Description |
|---|---|
| do not throw when retrieving TCB symbol for signal input with restricted access (#β55774) | |
| dom property binding check in signal extended diagnostic (#β54324) | |
fix type narrowing of @if with aliases (#β55835) |
core
| Commit | Description |
|---|---|
| add warning when using zoneless but zone.js is still loaded (#β55769) | |
| error about provideExperimentalCheckNoChangesForDebug uses wrong name (#β55824) | |
| exhaustive checkNoChanges should only do a single pass (#β55839) |
service-worker
| Commit | Description |
|---|---|
remove controllerchange listener when app is destroyed (#β55365) |
angular/components (@βangular/cdk)
v18.0.0-rc.3
cdk
| Commit | Type | Description |
|---|---|---|
| d80afa95e | fix | drag-drop: defer loading reset styles (#β29056) |
material
| Commit | Type | Description |
|---|---|---|
| 57acd08fb | fix | chips: simplify repeat chip removal prevention (#β29048) |
| ae82909a9 | fix | schematics: Add css token renaming migration |
| c7396b877 | fix | slider: aria-valuetext host binding should be onPush compatible (#β29042) |
| 8299b0912 | fix | slider: resolve duplicate key warnings (#β29073) |
Configuration
π Schedule: Branch creation - "after 10:00pm every weekday,before 4:00am every weekday,every weekend" in timezone America/Tijuana, 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.
π» Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.
- [ ] If you want to rebase/retry this PR, check this box
This PR has been generated by Renovate Bot.