Update angular monorepo to v16 (major) - autoclosed
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
@angular/animations | dependencies | major | 15.1.2 -> 16.0.1 |
@angular/common | dependencies | major | 15.1.2 -> 16.0.1 |
@angular/compiler | dependencies | major | 15.1.2 -> 16.0.1 |
@angular/compiler-cli | devDependencies | major | 15.1.2 -> 16.0.1 |
@angular/core | dependencies | major | 15.1.2 -> 16.0.1 |
@angular/forms | dependencies | major | 15.1.2 -> 16.0.1 |
@angular/platform-browser | dependencies | major | 15.1.2 -> 16.0.1 |
@angular/platform-browser-dynamic | dependencies | major | 15.1.2 -> 16.0.1 |
@angular/router | dependencies | major | 15.1.2 -> 16.0.1 |
@angular/service-worker | dependencies | major | 15.1.2 -> 16.0.1 |
Release Notes
angular/angular
v16.0.1
core
Commit | Type | Description |
---|---|---|
52c74d3b4a | fix | add additional component metadata to component ID generation (#50203) |
048b6b1e0d | fix | bootstrapApplication call not rejected when error is thrown in importProvidersFrom module (#50120) |
d68796782f | fix | handle hydration of root components with injected ViewContainerRef (#50136) |
f751ce6445 | fix | handle projection of hydrated containters into components that skip hydration (#50199) |
346ab73dd9 | fix | only try to retrieve transferred state on the browser (#50144) |
v16.0.0
16.0.0 (2023-05-03)
Commit | Description |
---|---|
remove Angular Compatibility Compiler (ngcc) (#49101) | |
remove deprecated EventManager method addGlobalEventListener (#49645) |
common
Commit | Description |
---|---|
Provide MockPlatformLocation by default in BrowserTestingModule (#49137) | |
strict type checking for ngtemplateoutlet (#48374) | |
remove deprecated XhrFactory export from http entrypoint (#49251) |
compiler
Commit | Description |
---|---|
add support for compile-time required inputs (#49304) | |
add support for compile-time required inputs (#49453) | |
add support for compile-time required inputs (#49468) | |
drop support for TypeScript 4.8 (#49155) | |
support multiple configuration files in extends (#49125) |
|
incorrectly matching directives on attribute bindings (#49713) | |
Produce diagnositc if directive used in host binding is not exported (#49527) |
compiler-cli
Commit | Description |
---|---|
Add an extended diagnostic for nSkipHydration (#49512) |
|
Catch FatalDiagnosticError during template type checking (#49527) | |
optimize NgModule emit for standalone components (#49837) |
core
Commit | Description |
---|---|
add assertInInjectionContext (#49529) |
|
add mergeApplicationConfig method (#49253) |
|
Add ability to configure NgZone in bootstrapApplication (#49557) |
|
add Angular Signals to the public API (#49150) | |
add API to provide CSP nonce for inline stylesheets (#49444) | |
add migration to remove moduleId references (#49496) |
|
add support for TypeScript 5.0 (#49126) | |
allow removal of previously registered DestroyRef callbacks (#49493) | |
Allow typeguards on QueryList.filter (#48042) | |
Drop public factories property for IterableDiffers : Breaking change (#49598) |
|
drop support for zone.js versions <=0.12.0 (#49331) |
|
effects can optionally return a cleanup function (#49625) | |
expose makeStateKey , StateKey and TransferState (#49563) |
|
expose onDestroy on ApplicationRef (#49677) | |
implement takeUntilDestroyed in rxjs-interop (#49154) |
|
introduce runInInjectionContext and deprecate prior version (#49396) |
|
introduce concept of DestroyRef (#49158) | |
Mark components for check if they read a signal (#49153) | |
prototype implementation of @angular/core/rxjs-interop (#49154) | |
remove entryComponents (#49484) | |
support usage of non-experimental decorators with TypeScript 5.0 (#49492) | |
add newline to hydration mismatch error (#49965) | |
allow async functions in effects (#49783) | |
catch errors from source signals outside of .next (#49769) | |
ComponentRef.setInput only sets input when not equal to previous (#49607) | |
deprecate moduleId @Component property (#49496) |
|
Ensure effects can be created when Zone is not defined (#49890) | |
ensure takeUntilDestroyed unregisters onDestroy listener on unsubscribe (#49901) | |
error if document body is null (#49818) | |
execute input setters in non-reactive context (#49906) | |
execute query setters in non-reactive context (#49906) | |
execute template creation in non-reactive context (#49883) | |
Fix capitalization of toObservableOptions (#49832) | |
generate consistent component IDs (#48253) | |
include inner ViewContainerRef anchor nodes into ViewRef.rootNodes output (#49867) | |
make sure that lifecycle hooks are not tracked (#49701) | |
onDestroy should be registered only on valid DestroyRef (#49804) | |
resolve InitialRenderPendingTasks promise on complete (#49784) |
|
toObservable should allow writes to signals in the effect (#49769) | |
typing of TestBed Common token. (#49997) | |
When using setInput, mark view dirty in same was as markForCheck (#49711) |
|
change RendererType2.styles to accept a only a flat array (#49072) |
|
generate a static application ID (#49422) | |
Remove ReflectiveInjector symbol (#48103) |
|
remove Node.js v14 support (#49255) |
forms
Commit | Description |
---|---|
Improve typings form (async)Validators (#48679) |
http
Commit | Description |
---|---|
allow HttpClient to cache requests (#49509) |
|
delay accessing pendingTasks.whenAllTasksComplete (#49784) |
|
ensure new cache state is returned on each request (#49749) | |
force macro task creation during HTTP request (#49546) | |
HTTP cache was being disabled prematurely (#49826) | |
wait for all XHR requests to finish before stabilizing application (#49776) |
migrations
Commit | Description |
---|---|
Migration to remove Router guard and resolver interfaces (#49337) |
platform-browser
Commit | Description |
---|---|
add a public API function to enable non-destructive hydration (#49666) | |
deprecate withServerTransition call (#49422) |
|
enable HTTP request caching when using provideClientHydration (#49699) |
|
export deprecated TransferState as type (#50015) |
|
KeyEventsPlugin should keep the same behavior (#49330) | |
only add ng-app-id to style on server side (#49465) |
|
reuse server generated component styles (#48253) | |
set nonce attribute in a platform compatible way (#49624) | |
move ApplicationConfig to core (#49253) |
|
remove deprecated BrowserTransferStateModule symbol (#49718) |
platform-server
Commit | Description |
---|---|
renderApplication now accepts a bootstrapping method (#49248) |
|
add provideServerSupport function to provide server capabilities to an application (#49380) |
|
rename provideServerSupport to provideServerRendering (#49678) |
|
bundle @angular/domino in via esbuild (#49229) | |
remove dependency on @angular/platform-browser-dynamic (#50064) |
|
deprecate useAbsoluteUrl and baseUrl (#49546) |
|
remove renderApplication overload that accepts a component (#49463) |
|
remove deprecated renderModuleFactory (#49247) |
router
Commit | Description |
---|---|
Expose information about the last successful Navigation (#49235) |
|
helper functions to convert class guards to functional (#48709) | |
Opt-in for binding Router information to component inputs (#49633) |
|
Ensure anchor scrolling happens on ignored same URL navigations (#48025) | |
fix = not parsed in router segment name (#47332) | |
Remove deprecated ComponentFactoryResolver from APIs (#49239) | |
remove RouterEvent from Event union type (#46061) | |
Route matching should only happen once when navigating (#49163) | |
Route matching should only happen once when navigating (#49163) | |
Router.createUrlTree should work with any ActivatedRoute (#48508) |
service-worker
Commit | Description |
---|---|
add function to provide service worker (#48247) |
Breaking Changes
- Angular Compatibility Compiler (ngcc) has been removed and as a result Angular View Engine libraries will no longer work
- Deprecated
EventManager
methodaddGlobalEventListener
has been removed as it is not used by Ivy.
bazel
- Several changes to the Angular Package Format (APF)
- Removal of FESM2015
- Replacing ES2020 with ES2022
- Replacing FESM2020 with FESM2022
- Several changes to the Angular Package Format (APF)
- Removal of FESM2015
- Replacing ES2020 with ES2022
- Replacing FESM2020 with FESM2022
common
-
MockPlatformLocation
is now provided by default in tests. Existing tests may have behaviors which rely onBrowserPlatformLocation
instead. For example, direct access to thewindow.history
in either the test or the component rather than going through the Angular APIs (Location.getState()
). The quickest fix is to update the providers in the test suite to override the provider againTestBed.configureTestingModule({providers: [{provide: PlatformLocation, useClass: BrowserPlatformLocation}]})
. The ideal fix would be to update the code to instead be compatible withMockPlatformLocation
instead. - If the 'ngTemplateOutletContext' is different from the context, it will result in a compile-time error.
Before the change, the following template was compiling:
interface MyContext {
$implicit: string;
}
@​Component({
standalone: true,
imports: [NgTemplateOutlet],
selector: 'person',
template: `
<ng-container
*ngTemplateOutlet="
myTemplateRef;
context: { $implicit: 'test', xxx: 'xxx' }
"></ng-container>
`,
})
export class PersonComponent {
myTemplateRef!: TemplateRef<MyContext>;
}
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:
- add the 'xxx' property to 'MyContext' with the correct type or
- add '
any(...)' inside the template to make the error disappear. However, adding '
any(...)' does not correct the error but only preserves the previous behavior of the code. - Deprecated
XhrFactory
export from@angular/common/http
has been removed. UseXhrFactory
from@angular/common
instead.
compiler
-
- TypeScript 4.8 is no longer supported.
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 tosetInput
. -
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.bootstrapApplication(ComponentA, { providers: [ { provide: APP_ID, useValue: 'app-a' }, // ... other providers ... ] });
-
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
- The deprecated
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
const output: string = await renderApplication(RootComponent, options);
Now
const bootstrap = () => bootstrapApplication(RootComponent, appConfig); const output: string = await renderApplication(bootstrap, options);
-
renderModuleFactory
has been removed. UserenderModule
instead.
router
- The
Scroll
event'srouterEvent
property may also be aNavigationSkipped
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 useViewContainerRef.createComponent
without the factory resolver. - The
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)
. - Tests which mock
ActivatedRoute
instances may need to be adjusted because 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 anActivatedRoute
that does not appear in the current 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 examplerouter.navigate([], {relativeTo: route, queryParams: newQueryParams})
. In this case, therelativeTo
property should be removed.
Deprecations
core
-
makeStateKey
,StateKey
andTransferState
exports have been moved from@angular/platform-browser
to@angular/core
. Please update the imports.
- import {makeStateKey, StateKey, TransferState} from '@​angular/platform-browser';
+ import {makeStateKey, StateKey, TransferState} from '@​angular/core';
-
EnvironmentInjector.runInContext
is now deprecated, withrunInInjectionContext
functioning as a direct replacement:// Previous method version (deprecated): envInjector.runInContext(fn); // New standalone function: runInInjectionContext(envInjector, fn);
-
The
@Directive
/@Component
moduleId
property is now deprecated. 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:
imports: [ BrowserModule.withServerTransition({ appId: 'serverApp' }), ... ]
After:
imports: [ BrowserModule, { provide: APP_ID, useValue: 'serverApp' }, ... ],
-
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.
v15.2.9
15.2.9 (2023-05-03)
common
Commit | Description |
---|---|
fix incorrectly reported distortion for padded images (#49889) |
compiler-cli
Commit | Description |
---|---|
catch fatal diagnostic when getting diagnostics for components (#50046) |
v15.2.8
15.2.8 (2023-04-19)
core
Commit | Description |
---|---|
handle invalid classes in class array bindings (#49924) |
http
Commit | Description |
---|---|
prevent headers from throwing an error when initializing numerical values (#49379) |
router
Commit | Description |
---|---|
canceledNavigationResolution: 'computed' with redirects to the current URL (#49793) |
v15.2.7
15.2.7 (2023-04-12)
compiler
Commit | Description |
---|---|
Produce diagnositc if directive used in host binding is not exported (#49792) |
compiler-cli
Commit | Description |
---|---|
Catch FatalDiagnosticError during template type checking (#49792) |
core
Commit | Description |
---|---|
When using setInput, mark view dirty in same way as markForCheck (#49747) |
Special Thanks
Alan Agius, Andrew Kushnir, Andrew Scott, Kristiyan Kostadinov, Matthieu Riegler and Nikola Kološnjaji
v15.2.6
15.2.6 (2023-04-05)
core
Commit | Description |
---|---|
change the URL sanitization to only block javascript: URLs (#49659) |
router
Commit | Description |
---|---|
create correct URL relative to path with empty child (#49691) | |
Ensure initial navigation clears current navigation when blocking (#49572) |
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
15.2.5 (2023-03-29)
common
Commit | Description |
---|---|
invalid ImageKit transformation (#49201) |
compiler
Commit | Description |
---|---|
do not unquote CSS values (#49460) | |
handle trailing comma in object literal (#49535) |
core
Commit | Description |
---|---|
set style property value to empty string instead of an invalid value (#49460) |
router
Commit | Description |
---|---|
Ensure Router preloading works with lazy component and static children (#49571) | |
fix #49457 outlet activating with old info (#49459) |
Special Thanks
Alan Agius, Andrew Scott, Asaf Malin, Jan Cabadaj, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Sid and Tano Abeleyra
v15.2.4
15.2.4 (2023-03-22)
core
Commit | Description |
---|---|
Allow TestBed.configureTestingModule to work with recursive cycle of standalone components. (#49473) |
|
more accurate matching of classes during content projection (#48888) |
migrations
Commit | Description |
---|---|
preserve trailing commas in code generated by standalone migration (#49533) |
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
15.2.3 (2023-03-16)
Special Thanks
Alan Agius, Esteban Gehring, Matthieu Riegler and Virginia Dooley
v15.2.2
15.2.2 (2023-03-08)
migrations
Commit | Description |
---|---|
add protractor support if protractor imports are detected (#49274) |
Special Thanks
Alan Agius, Andrew Kushnir, Andrew Scott, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Sai Kartheek Bommisetty and Vinit Neogi
v15.2.1
15.2.1 (2023-03-01)
common
Commit | Description |
---|---|
make Location.normalize() return the correct path when the base path contains characters that interfere with regex syntax. (#49181) |
compiler-cli
Commit | Description |
---|---|
do not persist component analysis if template/styles are missing (#49184) |
core
Commit | Description |
---|---|
update zone.js peerDependencies ranges (#49244) |
migrations
Commit | Description |
---|---|
avoid migrating the same class multiple times in standalone migration (#49245) | |
delete barrel exports in standalone migration (#49176) |
router
Commit | Description |
---|---|
add error message when using loadComponent with a NgModule (#49164) |
Special Thanks
Alan Agius, Andrew Kushnir, Aristeidis Bampakos, Craig Spence, Doug Parker, Iván Navarro, Joey Perrott, Kristiyan Kostadinov, Matthieu Riegler, Michael Ziluck, Paul Gschwendtner, Stephanie Tuerk, Vincent and Virginia Dooley
v15.2.0
15.2.0 (2023-02-22)
Deprecations
- Class and
InjectionToken
guards and resolvers are deprecated. Instead, write guards as plain JavaScript functions and inject dependencies withinject
from@angular/core
.
Commit | Description |
---|---|
Deprecate class and InjectionToken and resolvers (#47924) |
common
Commit | Description |
---|---|
Add loaderParams attribute to NgOptimizedImage (#48907) |
compiler-cli
Commit | Description |
---|---|
incorrectly detecting forward refs when symbol already exists in file (#48988) |
core
Commit | Description |
---|---|
add ng generate schematic to convert declarations to standalone (#48790) | |
add ng generate schematic to convert to standalone bootstrapping APIs (#48848) | |
add ng generate schematic to remove unnecessary modules (#48832) |
language-service
Commit | Description |
---|---|
Allow auto-imports of a pipe via quick fix when its selector is used, both directly and via reexports. (#48354) | |
Introduce a new NgModuleIndex, and use it to suggest re-exports. (#48354) | |
generate forwardRef for same file imports (#48898) |
migrations
Commit | Description |
---|---|
add enum in mode option in standalone schema (#48851) |
|
automatically prune root module after bootstrap step (#49030) | |
avoid generating imports with forward slashes (#48993) | |
avoid internal modules when generating imports (#48958) | |
avoid interrupting the migration if language service lookup fails (#49010) | |
avoid modifying testing modules without declarations (#48921) | |
don't add ModuleWithProviders to standalone test components (#48987) | |
don't copy animations modules into the imports of test components (#49147) | |
don't copy unmigrated declarations into imports array (#48882) | |
don't delete classes that may provide dependencies transitively (#48866) | |
duplicated comments on migrated classes (#48966) | |
generate forwardRef for same file imports (#48898) | |
migrate HttpClientModule to provideHttpClient() (#48949) | |
migrate RouterModule.forRoot with a config object to use features (#48935) | |
migrate tests when switching to standalone bootstrap API (#48987) | |
move standalone migrations into imports (#48987) | |
normalize paths to posix (#48850) | |
only exclude bootstrapped declarations from initial standalone migration (#48987) | |
preserve tsconfig in standalone migration (#48987) | |
reduce number of files that need to be checked (#48987) | |
return correct alias when conflicting import exists (#49139) | |
standalone migration incorrectly throwing path error for multi app projects (#48958) | |
support --defaults in standalone migration (#48921) | |
use consistent quotes in generated imports (#48876) | |
use import remapper in root component (#49046) | |
use NgForOf instead of NgFor (#49022) | |
avoid re-traversing nodes when resolving bootstrap call dependencies (#49010) | |
speed up language service lookups (#49010) |
platform-browser
Commit | Description |
---|---|
remove styles from DOM of destroyed components (#48298) |
platform-server
Commit | Description |
---|---|
avoid duplicate TransferState info after renderApplication call (#49094) |
router
Commit | Description |
---|---|
Add a withNavigationErrorHandler feature to provideRouter (#48551) | |
Add test helper for trigger navigations in tests (#48552) |
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
15.1.5 (2023-02-15)
forms
Commit | Description |
---|---|
Make radio buttons respect [attr.disabled] (#48864) |
Special Thanks
AleksanderBodurri, Alvaro Junqueira, Dylan Hunn, Joey Perrott, Matthieu Riegler, PaloMiklo and Paul Gschwendtner
v15.1.4
15.1.4 (2023-02-08)
Special Thanks
Jessica Janiuk, Kian Yang Lee, Matthieu Riegler, Redouane Bekkouche and Simona Cotin
v15.1.3
15.1.3 (2023-02-02)
animations
Commit | Description |
---|---|
fix non-animatable warnings for easing (#48583) |
common
Commit | Description |
---|---|
warn if using ngSrcset without a configured image loader (#48804) |
compiler
Commit | Description |
---|---|
incorrect code when non-null assertion is used after a safe access (#48801) |
migrations
Commit | Description |
---|---|
Fixed file format issue with lint (#48859) | |
migration host incorrectly reading empty files (#48849) |
platform-server
Commit | Description |
---|---|
insert transfer state script before other script tags (#48868) |
router
Commit | Description |
---|---|
Handle routerLink directive on svg anchors. (#48857) |
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
Configuration
-
If you want to rebase/retry this MR, check this box.
This MR has been generated by Renovate Bot.