6 Commits in this Release
Ordered by the degree to which they evolved the repo in this version.
Browse Other Releases
Top Contributors in 14.0.0
Directory Browser for 14.0.0
We haven't yet finished calculating and confirming the files and directories changed in this release. Please check back soon.
Release Notes Published
<a name="14.0.0"></a>
14.0.0 (2022-06-02)
Breaking Changes
animations
- The
AnimationDriver.getParentElement
method has become required, so any implementors of this interface are now required to provide an implementation for this method. This breakage is unlikely to affect application developers, asAnimationDriver
is not expected to be implemented in user code. ### common - Adds new required class member that any implementors of the LocationStrategy will need to satisfy. Location does not depend on PlatformLocation anymore. ### compiler
Keyframes names are now prefixed with the component's "scope name". For example, the following keyframes rule in a component definition, whose "scope name" is host-my-cmp:
@keyframes foo { ... }
will become:
@keyframes host-my-cmp_foo { ... }
Any TypeScript/JavaScript code which relied on the names of keyframes rules will no longer match.
The recommended solutions in this case are to either:
- change the component's view encapsulation to the None
or ShadowDom
- define keyframes rules in global stylesheets (e.g styles.css)
- define keyframes rules programmatically in code.
- Keyframes names are now prefixed with the component's "scope name".
For example, the following keyframes rule in a component definition,
whose "scope name" is host-my-cmp:
@keyframes foo { ... }
will become:
@keyframes host-my-cmp_foo { ... }
Any TypeScript/JavaScript code which relied on the names of keyframes rules will no longer match.
The recommended solutions in this case are to either:
- change the component's view encapsulation to the None
or ShadowDom
- define keyframes rules in global stylesheets (e.g styles.css)
- define keyframes rules programmatically in code.
core
- Support for Node.js v12 has been removed as it will become EOL on 2022-04-30. Please use Node.js v14.15 or later.
- TypeScript versions older than 4.6 are no longer supported.
- Forms [email] input coercion
Forms [email] input value will be considered as true if it is defined with any value rather
than false and 'false'.
- Since Ivy, TestBed doesn't use AOT summaries. The aotSummaries
fields in TestBed APIs were present, but unused. The fields were deprecated in previous major version and in v14 those fields are removed. The aotSummaries
fields were completely unused, so you can just drop them from the TestBed APIs usage.
forms
- Forms classes accept a generic.
Forms model classes now accept a generic type parameter. Untyped versions of these classes are available to opt-out of the new, stricter behavior. - objects with a length key set to zero will no longer validate as empty.
This is technically a breaking change, since objects with a key length
and value 0
will no longer validate as empty. This is a very minor change, and any reliance on this behavior is probably a bug anyway.
http
- Queries including + will now actually query for + instead of space. Most workarounds involving custom codecs will be unaffected. Possible server-side workarounds will need to be undone.
- JSONP will throw an error when headers are set on a reques
JSONP does not support headers being set on requests. Before when a request was sent to a JSONP backend that had headers set the headers were ignored. The JSONP backend will now throw an error if it receives a request that has any headers set. Any uses of JSONP on requests with headers set will need to remove the headers to avoid the error.
platform-browser
- This change may cause a breaking change in unit tests that are implicitly depending on a specific number and sequence of change detections in order for their assertions to pass.
- This may break invalid calls to
TransferState
methods.
This tightens parameter types of TransferState
usage, and is a minor breaking change which may reveal existing problematic calls.
router
- The type of
Route.pathMatch
is now more strict. Places that usepathMatch
will likely need to be updated to have an explicitRoute
/Routes
type so that TypeScript does not infer the type asstring
. - When returning a
Promise
from theLoadChildrenCallback
, the possible type is now restricted toType<any>|NgModuleFactory<any>
rather thanany
. initialNavigation: 'enabled'
was deprecated in v11 and is replaced byinitialNavigation: 'enabledBlocking'
.- The type of
component
onActivatedRoute
andActivatedRouteSnapshot
includesstring
. In reality, this is not the case. The component cannot be anything other than a component class. - * The type of
initialUrl
is set tostring|UrlTree
but in reality, theRouter
only sets it to a value that will always beUrlTree
initialUrl
is documented as "The target URL passed into theRouter#navigateByUrl()
call before navigation" but the value actually gets set to something completely different. It's set to the current internalUrlTree
of the Router at the time navigation occurs.
With this change, there is no exact replacement for the old value of
initialUrl
because it was enver intended to be exposed.
Router.url
is likely the best replacement for this.
In more specific use-cases, tracking the finalUrl
between successful
navigations can also be used as a replacement.
- Lazy loaded configs are now also validated once loaded like the
initial set of routes are. Lazy loaded modules which have invalid Route
configs will now error. Note that this is only done in dev mode so
there is no production impact of this change.
- When a guard returns a UrlTree
, the router would previously schedule
the redirect navigation within a setTimeout
. This timeout is now removed,
which can result in test failures due to incorrectly written tests.
Tests which perform navigations should ensure that all timeouts are
flushed before making assertions. Tests should ensure they are capable
of handling all redirects from the original navigation.
- Previously, resolvers were waiting to be completed
before proceeding with the navigation and the Router would take the last
value emitted from the resolver.
The router now takes only the first emitted value by the resolvers
and then proceeds with navigation. This is now consistent with Observables
returned by other guards: only the first value is used.
zone.js
- in TaskTrackingZoneSpec track a periodic task until it is cancelled
The breaking change is scoped only to the plugin
zone.js/plugins/task-tracking
. If you used TaskTrackingZoneSpec
and
checked the pending macroTasks e.g. using (this.ngZone as any)._inner
._parent._properties.TaskTrackingZone.getTasksFor('macroTask')
, then
its behavior slightly changed for periodic macrotasks. For example,
previously the setInterval
macrotask was no longer tracked after its
callback was executed for the first time. Now it's tracked until
the task is explicitly cancelled, e.g with clearInterval(id)
.
fixes 45350
Deprecations
common
- The
ngModuleFactory
input of theNgComponentOutlet
directive is deprecated in favor of a newly addedngModule
input. ThengModule
input accepts references to the NgModule class directly, without the need to resolve module factory first. ### forms - The
initialValueIsDefault
option has been deprecated and replaced with the otherwise-identicalnonNullable
option, for the sake of naming consistency. - It is now deprecated to provide both
AbstractControlOption
s and an async validators argument to a FormControl. Previously, the async validators would just be silently dropped, resulting in a probably buggy forms. Now, the constructor call is deprecated, and Angular will print a warning in devmode. ### router - The
resolver
argument of theRouterOutletContract.activateWith
function and theresolver
field of theOutletContext
class are deprecated. Passing component factory resolvers are no longer needed. TheComponentFactoryResolver
-related symbols were deprecated in@angular/core
package since v13. ### animations | Commit | Description | | -- | -- | | | make validateStyleProperty check dev-mode only (#45570) | | | provide warnings for non-animatable CSS properties (#45212) | | | allow animations with unsupported CSS properties (#44729) | | | apply default params when resolved value is null or undefined (#45339) | | | implement missing transition delay (#44799) | | | improve algorithm to balance animation namespaces (#45057) | | | made errors in the animations package tree shakeable (#45004) | | | Remove generic objects in favor of Maps (#44482) | | | remove no longer needed CssKeyframes classes (#44903) | | | makeAnimationDriver.getParentElement
required (#45114) | ### bazel | Commit | Description | | -- | -- | | | allow for generatedpackage.json
files inng_package
(#45470) | | | report error when dependency does not provide JS sources inng_package
(#45470) | | | speed up dev-turnaround by bundling types only when packaging (#45405) | | | do not error if files part ofsrcs
are outside of package (#45622) | | | remove unnecessary file extractions fromng_package
(#45470) | | | speed upd.ts
bundling by configuring worker (#45900) | | | use allowedInputs to avoid fs.stat (#46069) | ### common | Commit | Description | | -- | -- | | | add getState method to LocationStrategy interface (#45648) | | | support NgModule as an input to the NgComponentOutlet (#44815) | | | support years greater than 9999 (#43622) | | | cleanup URL change listeners when the root view is removed (#44901) | | | properly cast http param values to strings (#42643) | | | makeNgLocalization
token tree-shakable (#45118) | ### compiler | Commit | Description | | -- | -- | | | exclude empty styles from emitted metadata (#45459) | | | scope css keyframes in emulated view encapsulation (#42608) | | | scope css keyframes in emulated view encapsulation (#42608) | ### compiler-cli | Commit | Description | | -- | -- | | | exclude abstract classes fromstrictInjectionParameters
requirement (#44615) | | | initial implementation of standalone components (#44812) | | | propagatestandalone
flag to runtime (#44973) | | | standalone types imported into NgModule scopes (#44973) | | | Support template binding to protected component members (#45823) | | | better error messages for NgModule structural issues (#44973) | | | fix issue with incremental tracking of APIs for pipes (#45672) | | | full side-effectful registration of NgModules with ids (#45024) | | | handle forwardRef in imports of standalone component (#45869) | | | handle inline type-check blocks in nullish coalescing extended check (#45454) | | | handle standalone components with cycles (#46029) | | | preserveforwardRef
for component scopes (#46139) | | | report invalid imports in standalone components during resolve phase (#45827) | | | Support resolve animation name from the DTS (#45107) | | | update unknown tag error for aot standalone components (#45919) | | | use existing imports for standalone dependencies (#46029) | | | ignore the module.id anti-pattern for NgModule ids (#45024) | ### core | Commit | Description | | -- | -- | | | addApplicationRef.destroy
method (#45624) | | | add thebootstrapApplication
function (#45674) | | | allow for injector to be specified when creating an embedded view (#45156) | | | allow for injector to be specified when creating an embedded view (#45156) | | | allow to throw on unknown elements in tests (#45479) | | | allow to throw on unknown elements in tests (#45479) | | | allow to throw on unknown properties in tests (#45853) | | | drop support for Node.js 12 (#45286) | | | drop support for TypeScript 4.4 and 4.5 (#45394) | | | implementimportProvidersFrom
function (#45626) | | | implement EnvironmentInjector with adapter to NgModuleRef (#45626) | | | implement standalone directives, components, and pipes (#45687) | | | move ANIMATION_MODULE_TYPE injection token into core (#44970) | | | support TypeScript 4.6 (#45190) | | | support TypeScript 4.7 (#45749) | | | triggerEventHandler accept optional eventObj (#45279) | | | update TestBed to recognize Standalone Components (#45809) | | | add more details to the MISSING_INJECTION_CONTEXT error (#46166) | | | avoid Closure Compiler error in restoreView (#45445) | | | better error message when unknown property is present (#46147) | | | Ensure theStandaloneService
is retained after closure minification (#45783) | | | handle AOT-compiled standalone components in TestBed correctly (#46052) | | | improve TestBed declarations standalone error message (#45999) | | | include component name into unknown element/property error message (#46160) | | | incorrectly inserting elements inside template element (#43429) | | | input coercion (#42803) | | | memory leak in event listeners inside embedded views (#43075) | | | preventBrowserModule
providers from being loaded twice (#45826) | | | produce proper error message for unknown props on<ng-template>
s (#46068) | | | restore NgModule state correctly after TestBed overrides (#46049) | | | set correct context for inject() for component ctors (#45991) | | | support nested arrays of providers inEnvironmentInjector
(#45789) | | | throw if standalone components are present in@NgModule.bootstrap
(#45825) | | | update unknown property error to account for standalone components in AOT (#46159) | | | update unknown tag error for jit standalone components (#45920) | | | verify standalone component imports in JiT (#45777) | | | allowcheckNoChanges
mode to be tree-shaken in production (#45913) | | | avoid storing LView in ngContext (#45051) | | | makeCompiler
,ApplicationRef
andApplicationInitStatus
tree-shakable (#45102) | | | makeIterableDiffers
andKeyValueDiffers
tree-shakable (#45094) | | | makeLOCALE_ID
and other tokens fromApplicationModule
tree-shakable (#45102) | | | only track LViews that are referenced in ngContext (#45172) | | | remove deprecatedaotSummaries
fields in TestBed config (#45487) | ### devtools tabs | Commit | Description | | -- | -- | | | stop scroll occuring at tabs level | ### forms | Commit | Description | | -- | -- | | | AddFormBuilder.nonNullable
. (#45852) | | | Add a FormRecord type. (#45607) | | | Add untyped versions of the model classes for use in migration. (#45205) | | | Implement strict types for the Angular Forms package. (#43834) | | | support negative indices in FormArray methods. (#44848) | | | Add anonNullable
option toFormControl
for consistency. | | | Add UntypedFormBuilder (#45268) | | | Allow NonNullableFormBuilder to be injected. (#45904) | | | Correct empty validator to handle objects with a propertylength: 0
. (#33729) | | | Fix a typing bug in FormBuilder. (#45684) | | | Make UntypedFormBuilder assignable to FormBuilder, and vice versa. (#45421) | | | not picking up disabled state if group is swapped out and disabled (#43499) | | | Prevent FormBuilder from distributing unions to control types. (#45942) | | | Property renaming safe code (#45271) | | | Update the typed forms migration to use FormArray<T> instead of FormArray<T[]>. (#44933) | | | Update the typed forms migration. (#45281) | | | Value and RawValue should be part of the public API. (#45978) | | | Warn on FormControls that are constructed with both options and asyncValidators. | ### http | Commit | Description | | -- | -- | | | encode + signs in query params as %2B (angular#11058) (#45111) | | | Throw error when headers are supplied in JSONP request (#45210) | ### language-service | Commit | Description | | -- | -- | | | Provide plugin to delegate rename requests to Angular (#44696) | | | Fix detection of Angular for v14+ projects (#45998) | ### localize | Commit | Description | | -- | -- | | | ensure transitively loaded compiler code is tree-shakable (#45405) | ### migrations | Commit | Description | | -- | -- | | | Add migration to add explicitRoute
/Routes
type (#45084) | ### ngcc | Commit | Description | | -- | -- | | | cope with packages following APF v14+ (#45833) | ### platform-browser | Commit | Description | | -- | -- | | | do not run change detection when loading Hammer (#44921) | | | Make transfer state key typesafe. (#23020) | | | remove obsolete shim for Map comparison in Jasmine (#45521) | | | avoid including Testability by default inbootstrapApplication
(#45885) | ### platform-server | Commit | Description | | -- | -- | | | implementrenderApplication
function (#45785) | | | updaterenderApplication
to moveappId
to options (#45844) | ### router | Commit | Description | | -- | -- | | | AddEnvironmentInjector
toRouterOutlet.activateWith
(#45597) | | | AddRoute.title
with a configurableTitleStrategy
(#43307) | | | Add ability to specify providers on a Route (#45673) | | | add ariaCurrentWhenActive input to RouterLinkActive directive (#45167) | | | add type properties to all router events (#44189) | | | AllowloadChildren
to return aRoute
array (#45700) | | | set stricter type for Route.title (#44939) | | | Support lazy loading standalone components withloadComponent
(#45705) | | | Fix type of Route.pathMatch to be more accurate (#45176) | | | merge interited resolved data and static data (#45276) | | | Removeany
fromLoadChildrenCallback
type (#45524) | | | Remove deprecated initialNavigation option (#45729) | | | Remove unused string type for ActivatedRoute.component (#45625) | | | UpdateNavigation#initialUrl
to match documentation and reality (#43863) | | | validate lazy loaded configs (#45526) | | | cancel the navigation instantly if at least one resolver doesn't emit any value (#45621) | | | deprecate no longer needed resolver fields (#45597) | | | Remove unnecessary setTimeout in UrlTree redirects (#45735) | | | take only the first emitted value of every resolver to make it consistent with guards (#44573) | ### service-worker | Commit | Description | | -- | -- | | | addcacheOpaqueResponses
option for data-groups (#44723) | | | emit a notification when the service worker is already up to date after check (#45216) | ## Special Thanks Adrian Kunz, Alan Agius, AleksanderBodurri, Alex Rickabaugh, AlirezaEbrahimkhani, Amir Rustamzadeh, Andrew Kushnir, Andrew Scott, Chabbey Franรงois, Charles Lyding, Cรฉdric Exbrayat, Daan De Smedt, David Schmidt, Derek Cormier, Dmitrij Kuba, Doug Parker, Dylan Hunn, Emma Twersky, George Kalpakas, George Looshch, Jan Kuehle, Jessica Janiuk, JiaLiPassion, JimMorrison723, Joe Martin (Crowdstaffing), Joey Perrott, JoostK, Kristiyan Kostadinov, Krzysztof Platis, Leosvel Pรฉrez Espinosa, Maddie Klein, Mark Whitfeld, Martin Sikora, Michael-Doner, Michal Materowski, Minko Gechev, Paul Gschwendtner, Pawel Kozlowski, Payam Shahidi, Pusztai Tibor, Ricardo Mattiazzi Baumgartner, Roy Dorombozi, Ruslan Lekhman, Samuel Littley, Sergej Grilborzer, Sumit Arora, Tobias Speicher, Virginia Dooley, Zack Elliott, alirezaghey, ananyahs96, arturovt, cexbrayat, dario-piotrowicz, ivanwonder, kamikopi, markostanimirovic, markwhitfeld, mgechev, renovate[bot], twerske and zverbeta