19.0.0 (2024-11-19)
Breaking Changes
compiler
this.foo
property reads no longer refer to template context variables. If you intended to read the template variable, do not usethis.
.
core
-
Angular directives, components and pipes are now standalone by default.
- Specify
standalone: false
for declarations that are currently declared in@NgModule
s. ng update
for v19 will take care of this automatically.
- Specify
-
TypeScript versions less than 5.5 are no longer supported.
-
Timing changes for
effect
API (in developer preview):-
effects which are triggered outside of change detection run as part of
the change detection process instead of as a microtask. Depending on the
specifics of application/test setup, this can result in them executing
earlier or later (or requiring additional test steps to trigger; see below
examples). -
effects which are triggered during change detection (e.g. by input
signals) run earlier, before the component's template.
-
-
ExperimentalPendingTasks
has been renamed toPendingTasks
. -
The
autoDetect
feature ofComponentFixture
will now
attach the fixture to theApplicationRef
. As a result, errors during
automatic change detection of the fixture be reported to theErrorHandler
.
This change may cause custom error handlers to observe new failures that were previously unreported. -
createComponent
will now render default fallback with emptyprojectableNodes
.- When passing an empty array to
projectableNodes
in thecreateComponent
API, the default fallback content
of theng-content
will be rendered if present. To prevent rendering the default content, passdocument.createTextNode('')
as aprojectableNode
.
// The first ng-content will render the default fallback content if present createComponent(MyComponent. { projectableNodes: [[], [secondNode]] }); // To prevent projecting the default fallback content: createComponent(MyComponent. { projectableNodes: [[document.createTextNode('')], [secondNode]] });
- When passing an empty array to
-
Errors that are thrown during
ApplicationRef.tick
will now be rethrown when usingTestBed
. These errors should be
resolved by ensuring the test environment is set up correctly to
complete change detection successfully. There are two alternatives to
catch the errors:- Instead of waiting for automatic change detection to happen, trigger
it synchronously and expect the error. For example, a jasmine test
could writeexpect(() => TestBed.inject(ApplicationRef).tick()).toThrow()
TestBed
will reject any outstandingComponentFixture.whenStable
promises. A jasmine test,
for example, could writeexpectAsync(fixture.whenStable()).toBeRejected()
.
As a last resort, you can configure errors to not be rethrown by
settingrethrowApplicationErrors
tofalse
inTestBed.configureTestingModule
. - Instead of waiting for automatic change detection to happen, trigger
-
The timers that are used for zone coalescing and hybrid
mode scheduling (which schedules an application state synchronization
when changes happen outside the Angular zone) will now run in the zone
above Angular rather than the root zone. This will mostly affect tests
which usefakeAsync
: these timers will now be visible tofakeAsync
and can be affected bytick
orflush
. -
The deprecated
factories
property inKeyValueDiffers
has been removed.
elements
- as part of switching away from custom CD behavior to the
hybrid scheduler, timing of change detection around custom elements has
changed subtly. These changes make elements more efficient, but can cause
tests which encoded assumptions about how or when elements would be checked
to require updating.
localize
- The
name
option in theng add
@localize`` schematic has been removed in favor of theproject
option.
platform-browser
- The deprecated
BrowserModule.withServerTransition
method has been removed. Please use theAPP_ID
DI token to set the application id instead.
router
- The
Router.errorHandler
property has been removed.
Adding an error handler should be configured in either
withNavigationErrorHandler
withprovideRouter
or theerrorHandler
property in the extra options ofRouterModule.forRoot
. In addition,
the error handler cannot be used to change the return value of the
router navigation promise or prevent it from rejecting. Instead, if you
want to prevent the promise from rejecting, useresolveNavigationPromiseOnError
. - The return type of the
Resolve
interface now includes
RedirectCommand
.
common
Commit | Description |
---|---|
add optional rounded transform support in cloudinary image loader (#55364) | |
automatically use sizes auto in NgOptimizedImage (#57479) | |
disable keyvalue sorting using null compareFn (#57487) |
compiler
Commit | Description |
---|---|
add diagnostic for unused standalone imports (#57605) | |
add support for the typeof keyword in template expressions. (#58183)
| |
this.a should always refer to class property a (#55183)
| |
add more specific matcher for hydrate never block (#58360) | |
avoid having to duplicate core environment (#58444) | |
control flow nodes with root at the end projected incorrectly (#58607) | |
fix :host parsing in pseudo-selectors (#58681)
| |
fix multiline selectors (#58681) | |
handle typeof expressions in serializer (#58217) | |
ignore placeholder-only i18n messages (#58154) | |
resolve :host:host-context(.foo) (#58681)
| |
transform chained pseudo-selectors (#58681) |
compiler-cli
Commit | Description |
---|---|
'strictStandalone' flag enforces standalone (#57935) | |
ensure template style elements are preprocessed as inline styles (#57429) | |
generate the HMR replacement module (#58205) | |
disable standalone by default on older versions of Angular (#58405) | |
do not fail fatal when references to non-existent module are discovered (#58515) | |
do not report unused declarations coming from an imported array (#57940) | |
incorrectly generating relative file paths on case-insensitive platforms (#58150) | |
make the unused imports diagnostic easier to read (#58468) | |
report individual diagnostics for unused imports (#58589) | |
reduce duplicate component style resolution (#57502) |
core
Commit | Description |
---|---|
Add a schematics to migrate to standalone: false . (#57643)
| |
Add async run method on ExperimentalPendingTasks (#56546)
| |
Add incremental hydration public api (#58249) | |
Add rxjs operator prevent app stability until an event (#56533) | |
add syntactic sugar for initializers (#53152) | |
allow passing undefined without needing to include it in the type argument of input (#57621)
| |
allow running output migration on a subset of paths (#58299) | |
change effect() execution timing & no-op allowSignalWrites (#57874)
| |
drop support for TypeScript 5.4 (#57577) | |
experimental resource() API for async dependencies (#58255)
| |
experimental impl of rxResource() (#58255)
| |
flipping the default value for standalone to true (#58169)
| |
initial version of the output migration (#57604) | |
introduce afterRenderEffect (#57549)
| |
introduce debugName optional arg to framework signal functions (#57073) | |
introduce the reactive linkedSignal (#58189) | |
mark input, output and model APIs as stable (#57804) | |
mark signal-based query APIs as stable (#57921) | |
migrate ExperimentalPendingTasks to PendingTasks (#57533) | |
promote outputFromObservable & outputToObservable to stable. (#58214)
| |
Promote takeUntilDestroyed to stable. (#58200)
| |
stabilize @let syntax (#57813)
| |
support TypeScript 5.6 (#57424) | |
treat directives, pipes, components as by default (#58229) | |
allow signal write error (#57973) | |
avoid breaking change with apps using rxjs 6.x (#58341) | |
clean up event contract once hydration is done (#58174) | |
ComponentFixture autoDetect feature works like production (#55228) | |
Ensure the ViewContext is retained after closure minification (#57903)
| |
fallback to default ng-content with empty projectable nodes. (#57480) | |
Fix fixture.detectChanges with autoDetect disabled and zoneless (#57416) | |
fixes issues with control flow and incremental hydration (#58644) | |
prevent errors on contract cleanup (#58614) | |
Prevents trying to trigger incremental hydration on CSR (#58366) | |
Re-assign error codes to be within core bounds (<1000) (#53455) | |
resolve forward-referenced host directives during directive matching (#58492) | |
rethrow errors during ApplicationRef.tick in TestBed (#57200) | |
Schedulers run in zone above Angular rather than root (#57553) | |
set encapsulation to None for empty component styles (#57130)
| |
remove deprecated factories Property in KeyValueDiffers (#58064)
|
elements
Commit | Description |
---|---|
support output() -shaped outputs (#57535)
| |
switch to ComponentRef.setInput & remove custom scheduler (#56728)
|
forms
Commit | Description |
---|---|
add ability to clear a FormRecord (#50750) | |
fix FormRecord type inference (#50750) |
http
Commit | Description |
---|---|
promote withRequestsMadeViaParent to stable. (#58221)
| |
preserve all headers from Headers object (#57802) |
language-service
Commit | Description |
---|---|
add code fix for unused standalone imports (#57605) | |
add code reactoring action to migrate @Input to signal-input (#57214)
| |
allow code refactorings to compute edits asynchronously (#57214) | |
support converting to signal queries in VSCode extension (#58106) | |
support migrating full classes to signal inputs in VSCode (#57975) | |
support migrating full classes to signal queries (#58263) | |
The suppress diagnostics option should work for external templates (#57873) |
localize
Commit | Description |
---|---|
remove deprecated name option. (#58063)
|
migrations
Commit | Description |
---|---|
add a combined migration for all signals APIs (#58259) | |
add schematic to migrate to signal queries (#58032) | |
capture output migration stats (#58321) | |
expose output as function migration (#58299) | |
introduce signal input migration as ng generate schematic (#57805)
| |
migrate .pipe calls in outputs used in tests (#57691) | |
print output migration stats in ng generate (#58321) | |
remove complete calls for migrated outputs (#57671) | |
replace .next usage on outputs (#57654) | |
add outputs migration to combined shorthand (#58318) | |
change imports to be G3 compatible (#57654) | |
do not migrate next calls in template if not an EventEmitter (#58631) | |
flip the default standalone flag in route-lazy-loading migration (#58474) | |
include the output migration in the defaults of the signal migration (#58635) | |
inject migration always inserting generated variables before super call (#58393) | |
inject migration not inserting generated code after super call in some cases (#58393) | |
migrate more .next output usages (#58282) | |
properly bundle shared compiler code into migrations (#58515) | |
properly handle comments in output migration (#57691) | |
properly migrate output aliases (#58411) | |
properly replace imports across files (#58414) | |
properly resolve tsconfig paths on windows (#58137) | |
replace removed NgModules in tests with their exports (#58627) |
platform-browser
Commit | Description |
---|---|
correctly add external stylesheets to ShadowDOM components (#58482) | |
remove deprecated BrowserModule.withServerTransition method (#58062)
|
platform-server
Commit | Description |
---|---|
destroy PlatformRef when error happens during the bootstrap() phase (#58112)
|
router
Commit | Description |
---|---|
Add routerOutletData input to RouterOutlet directive (#57051)
| |
Align RouterModule.forRoot errorHandler with provider error handler (#57050) | |
remove setter for injector on OutletContext (#58343)
| |
Update Resolve interface to include RedirectCommand like ResolveFn (#57309) |
service-worker
Commit | Description |
---|---|
allow specifying maxAge for entire application (#49601) | |
finish implementation of refreshAhead feature (#53356) |