npm @angular/forms 16.0.0-next.5
v16.0.0-next.5

latest releases: 19.0.0-rc.1, 18.2.11, 19.0.0-rc.0...
19 months ago

16.0.0-next.5 (2023-03-29)

Breaking Changes

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

  • 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.

core

    • 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 to setInput.

Deprecations

core

  • makeStateKey, StateKey and TransferState 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';
  • 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-server

  • PlatformConfig.baseUrl and PlatformConfig.useAbsoluteUrl platform-server config options are deprecated as these were not used.

common

Commit Description
fix - 6499f5ae28 invalid ImageKit transformation (#49201)
fix - d47fef72cb strict type checking for ngtemplateoutlet (#48374)

compiler

Commit Description
fix - 1829542aea do not unquote CSS values (#49460)
fix - 73d2f3c866 handle trailing comma in object literal (#49535)

compiler-cli

Commit Description
feat - 03d1d00ad9 Add an extended diagnostic for nSkipHydration (#49512)

core

Commit Description
feat - 89d291c367 add assertInInjectionContext (#49529)
feat - 605c536420 add migration to remove moduleId references (#49496)
feat - 9c5fd50de4 effects can optionally return a cleanup function (#49625)
feat - c024574f46 expose makeStateKey, StateKey and TransferState (#49563)
feat - 9b65b84cb9 Mark components for check if they read a signal (#49153)
feat - 585e34bf6c remove entryComponents (#49484)
fix - be23b7ce65 ComponentRef.setInput only sets input when not equal to previous (#49607)
fix - 316c91b1a4 deprecate moduleId @Component property (#49496)
fix - fdafdb78dc set style property value to empty string instead of an invalid value (#49460)

http

Commit Description
fix - 45a6ac09fd force macro task creation during HTTP request (#49546)

migrations

Commit Description
feat - 5e5dac278d Migration to remove Router guard and resolver interfaces (#49337)

platform-browser

Commit Description
fix - e8e36811d5 set nonce attribute in a platform compatible way (#49624)

platform-server

Commit Description
refactor - e99460865e deprecate useAbsoluteUrl and baseUrl (#49546)

router

Commit Description
fix - 2dbf3e0023 Ensure Router preloading works with lazy component and static children (#49571)
fix - d3018c0ee7 fix #49457 outlet activating with old info (#49459)
fix - 3c7e637374 Route matching should only happen once when navigating (#49163)
fix - 1600687fe5 Route matching should only happen once when navigating (#49163)

Special Thanks

Alan Agius, Alex Rickabaugh, Andrew Kushnir, Andrew Scott, Asaf Malin, Jan Cabadaj, Jessica Janiuk, JiaLiPassion, Kristiyan Kostadinov, Matthieu Riegler, Paul Gschwendtner, Pawel Kozlowski, Sid, Tano Abeleyra and tomalaforge

Don't miss a new forms release

NewReleases is sending notifications on new releases.