Change8

21.0.0-next.2

Breaking Changes
📦 angularView on GitHub →
6 breaking3 features🐛 8 fixes🔧 11 symbols

Summary

This release introduces experimental signal-based forms and Navigation API support, while removing several deprecated APIs including UpgradeAdapter and the platform-browser export of ApplicationConfig. It also includes significant internal refactoring of the Router to use async/await, which may impact test timings.

⚠️ Breaking Changes

  • TestBed now provides a fake PlatformLocation supporting the Navigation API. If tests break, provide MockPlatformLocation from @angular/common/testing manually.
  • Using provideZoneChangeDetection in TestBed no longer prevents error rethrowing. Adjust tests to handle errors or set rethrowApplicationErrors: false in configureTestingModule.
  • The ignoreChangesOutsideZone option for ZoneJS change detection has been removed.
  • The deprecated ApplicationConfig export has been removed from @angular/platform-browser. Import it from @angular/core instead.
  • Router navigations now use async/await internally and may take additional microtasks to complete. Ensure all navigations are finished before running test assertions.
  • UpgradeAdapter has been removed. Use upgrade/static instead.

Migration Steps

  1. Update imports of ApplicationConfig from @angular/platform-browser to @angular/core.
  2. Replace usage of UpgradeAdapter with upgrade/static.
  3. Remove ignoreChangesOutsideZone from ZoneJS configuration.
  4. Review unit tests for navigation timing and ensure they wait for microtasks/navigation completion.
  5. If TestBed tests fail due to PlatformLocation changes, provide {provide: PlatformLocation, useClass: MockPlatformLocation}.

✨ New Features

  • Add experimental support for the Navigation API in @angular/common.
  • Add experimental signal-based forms in @angular/forms.
  • Add responseType property to HttpResponse and HttpErrorResponse in @angular/common/http.

🐛 Bug Fixes

  • Fix regression with event parsing and animate prefix in compiler.
  • Avoid injecting internal error handler from a destroyed injector in core.
  • Fix cancellation of animation enter classes.
  • Fixed inject migration schematics for migrate destructured properties.
  • Prevent error on cleanup when an rxResource stream throws before returning an Observable.
  • Consistent treatment of empty values in forms.
  • Prevent false warning for duplicate state serialization in platform-server.
  • Update recognize stage in router to use internally async/await.

🔧 Affected Symbols

PlatformLocationMockPlatformLocationTestBedprovideZoneChangeDetectionignoreChangesOutsideZoneApplicationConfigUpgradeAdapterHttpResponseHttpErrorResponserxResourceinject