@angular/platform-browser-dynamic
22.2.3 · 14 Oct 2026MIT4.2M / weekRepositoryHomepagenpmAtom feed
12.2.17 is the newest release of 12.x.
In short
22 breaking2 removed1 deprecated37 new6 faster51 fixed4 internal
- breaking
Minified UMD bundles are no longer included in the distributed NPM packages.
- breaking
common: Methods of the
PlatformLocationclass, namelyonPopStateandonHashChange, used to returnvoid. Now those methods return functions that can be called to remove event handlers. - breaking
common: The methods of the
HttpParamsclass now acceptstring | number | booleaninstead ofstringfor the value of a parameter. If you extended this class in your application, you'll have to update the signatures of your methods to reflect these changes. - breaking
compiler-cli: Linked libraries no longer generate legacy i18n message ids. Any downstream application that provides translations for these messages, will need to migrate their message ids using the
localize-migratecommand line tool. - breaking
core: Angular no longer maintains support for node v10
- breaking
core: Previously the
ng.getDirectivesfunction threw an error in case a given DOM node had no Angular context associated with it (for example if a function was called for a DOM element outside of an Angular app). This behavior was inconsistent with other debugging utilities underngnamespace, which handled this situation without raising an exception. Now calling theng.getDirectivesfunction for such DOM nodes would result in an empty array returned from that function. - breaking
core: Switching default of
emitDistinctChangesOnlyDefaultValuewhich changes the default behavior and may cause some applications which rely on the incorrect behavior to fail. - breaking
core: The type of the
APP_INITIALIZERtoken has been changed to more accurately reflect the types of return values that are handled by Angular. Previously, each initializer callback was typed to returnany, this is nowPromise<unknown> | Observable<unknown> | void. In the unlikely event that your application uses theInjector.getorTestBed.injectAPI to inject theAPP_INITIALIZERtoken, you may need to update the code to account for the stricter type.
Release note
Bug Fixes
animations: ensure consistent transition namespace ordering
animations: update supported range of node versions to only include LTS versions
animations: cleanup DOM elements when the root view is removed
animations: allow animations on elements in the shadow DOM (#40134) (dad42c8), closes #25672
animations: cleanup DOM elements when the root view is removed
bazel: update supported range of node versions to only include LTS versions
bazel: update build tooling for latest changes in rules_nodejs
bazel: update type castings for JSON.parse usage
benchpress: update type castings for JSON.parse usage
common: add right ContentType for boolean values with HttpClient request body
common: update supported range of node versions to only include LTS versions
common: viewport scroller not finding elements inside the shadow DOM (#41644) (c0f5ba3), closes #41470
- deprecated
common: temporarily re-export and deprecate
XhrFactory common: cleanup location change listeners when the root view is removed (#40867) (38524c4), closes #31546
common: allow number or boolean as http params (#40663) (91cdc11), closes #23856
common: avoid mutating context object in NgTemplateOutlet (#40360) (d3705b3), closes #24515
compiler: preserve @page rules in encapsulated styles (#41915) (3e365ba), closes #26269
compiler: strip scoped selectors from
@font-facerules (#41815) (2a11cda), closes #41751compiler: update supported range of node versions to only include LTS versions
compiler: non-literal inline templates incorrectly processed in partial compilation
compiler: not generating update instructions for ng-template inside alternate namespaces (#41669) (2bcbbda), closes #41308
compiler: avoid parsing EmptyExpr with a backwards span
compiler: handle case-sensitive CSS custom properties (#41380) (e112e32), closes #41364
compiler: include used components during JIT compilation of partial component declaration (#41353) (ff9470b), closes #41104 #41318
compiler: support multiple
:host-context()selectors (#40494) (07b7af3), closes #19199compiler: update type castings for JSON.parse usage
compiler-cli: use '' for the source map URL of indirect templates (#41973) (7a4d980), closes #40854
compiler-cli: expose the linker as a Babel plugin
compiler-cli: prefer non-aliased exports in reference emitters (#41866) (75bb931), closes #41443 #41277
compiler-cli: allow linker to process minified booleans (#41747) (1fb6724), closes #41655
compiler-cli: match string indexed partial declarations (#41747) (f885750), closes #41655
compiler-cli: update supported range of node versions to only include LTS versions
compiler-cli: autocomplete literal types in templates.
compiler-cli: do not error with prepocessing if component has no inline styles
compiler-cli: ensure the compiler tracks
ts.Programs correctlycompiler-cli: prevent eliding default imports in incremental recompilations (#41557) (7f16515), closes #41377
compiler-cli: resolve
rootDirsto absolute (#41359) (3e0fda9), closes #36290compiler-cli: add
useInliningoption to type check config (#41043) (09aefd2), closes #40963compiler-cli:
readConfigurationexisting options should override options in tsconfigcompiler-cli: extend
angularCompilerOptionsin tsconfig from node (#40694) (5eb1954), closes #36715compiler-cli: update type castings for JSON.parse usage
core: do not retain dynamically compiled components and modules (#42003) (1449c5c), closes #19997
core: invoke profiler around ngOnDestroy lifecycle hooks
core: AsyncPipe now compatible with RxJS 7
core: handle multiple i18n attributes with expression bindings (#41882) (73c6c64), closes #41869
core: update supported range of node versions to only include LTS versions
core: detect synthesized constructors that have been downleveled using TS 4.2 (#41305) (274dc15), closes #41298
core: Switch
emitDistinctChangesOnlyDefaultValueto truecore: remove duplicated EMPTY_OBJ constant
core: remove duplicated EMPTY_ARRAY constant
core: allow EmbeddedViewRef context to be updated (#40360) (a3e1719), closes #24515
core: make DefaultIterableDiffer keep the order of duplicates (#23941) (a826926), closes #23815
core: NgZone coaleascing options should trigger onStable correctly
elements: update supported range of node versions to only include LTS versions
elements: update type castings for JSON.parse usage
forms: update supported range of node versions to only include LTS versions
http: complete the request on timeout (#39807) (61a0b6d), closes #26453
http: emit error on XMLHttpRequest abort event (#40767) (3897265), closes #22324
language-service: update supported range of node versions to only include LTS versions
language-service: use script versions for incremental compilations
language-service: Only provide Angular property completions in templates
language-service: Add plugin option to force strictTemplates
language-service: use single entry point for Ivy and View Engine
localize: relax error to warning for missing target (#41944) (35ceed2), closes #21690
localize: update supported range of node versions to only include LTS versions
localize: update type castings for JSON.parse usage
ngcc: detect synthesized constructors that have been downleveled using TS 4.2 (#41305) (8d3da56), closes #41298
platform-browser: prevent memory leak of style nodes if shadow DOM encapsulation is used (#42005) (d555555), closes #36655
platform-browser: update supported range of node versions to only include LTS versions
platform-browser: configure
XhrFactoryto useBrowserXhr(#41313) (e0028e5), closes #41311platform-browser: update type castings for JSON.parse usage
platform-browser-dynamic: update supported range of node versions to only include LTS versions
platform-server: update supported range of node versions to only include LTS versions
router: update supported range of node versions to only include LTS versions
router: Only retrieve stored route when reuse strategy indicates it should reattach (#30263) (a4ff071), closes #23162
router: recursively merge empty path matches (#41584) (1179dc8), closes #41481
router: fragment can be null (#37336) (b555160), closes #23894 #34197
router: update type castings for JSON.parse usage
service-worker: update supported range of node versions to only include LTS versions
service-worker: update type castings for JSON.parse usage
upgrade: preserve $interval.flush when ngMocks is being used
upgrade: update supported range of node versions to only include LTS versions
Features
animations: update supported range of node versions
animations: add support for disabling animations through BrowserAnimationsModule.withConfig
bazel: update supported range of node versions
common: update supported range of node versions
common: add
historyGomethod toLocationservicecommon: support ICU standard "stand alone day of week" with
DatePipe(#40766) (c56ecab), closes #26922common: implement
appendAll()method onHttpParams(#20930) (575a2d1), closes #20798compiler: support nullish coalescing in templates (#41437) (ec27bd4), closes #36528
compiler: update supported range of node versions
compiler: emit @PURE or @pureOrBreakMyCode annotations in the generated code
compiler-cli: mark ability to use partial compilation mode as stable (#41518) (6ba67c6), closes #41496
compiler-cli: update supported range of node versions
compiler-cli: support transforming component style resources
compiler-cli: support producing Closure-specific PURE annotations
core: introduce getDirectiveMetadata global debugging utility
core: update supported range of node versions
core: support
forwardRefinprovidedInofInjectabledeclaration (#41426) (f7c294e), closes #41205core: add migration for
XhrFactoryimport- removed
core: drop support for TypeScript 4.0 and 4.1
core: support TypeScript 4.2
core: manually annotate de-sugarred core tree-shakable providers with @pureOrBreakMyCode
core: more precise type for
APP_INITIALIZERtoken (#40986) (ca721c2), closes #40729- removed
core: drop support for zone.js 0.10.x (#40823) (aaf9b31), closes angular/angular-cli#20034
core: support APP_INITIALIZER work with observable (#33222) (ca17ac5), closes #15088
elements: update supported range of node versions
forms: update supported range of node versions
forms: add
emitEventoption for AbstractControl-based class methods (#31031) (4ec045e), closes #29662forms: introduce min and max validators (#39063) (8fb83ea), closes #16352
http: introduce HttpContext request context
http: expose a list of human-readable http status codes (#23548) (6fe3a1d), closes #23543
language-service: implement signature help
language-service: update supported range of node versions
language-service: add perf tracing to LanguageService
language-service: add command for getting components for a template file
language-service: Add diagnostics to suggest turning on strict mode
language-service: Implement
getRenameInfolanguage-service: initial implementation for
findRenameLocationslanguage-service: view template typecheck block
localize: update supported range of node versions
localize: add scripts to migrate away from legacy message IDs
ngcc: support
__readhelper as used by TypeScript 4.2ngcc: support
__spreadArrayhelper as used by TypeScript 4.2 (#41201) (7b1214e) #40394platform-browser: update supported range of node versions
platform-browser-dynamic: update supported range of node versions
platform-server: update supported range of node versions
platform-server: allow shimming the global env sooner (#40559) (43ecf8a), closes #24551 #39950 #39950
router: update supported range of node versions
router: add migration for ActivatedRouteSnapshot.fragment (#41092) (190fa07), closes #37336
router: Add more fine-tuned control in
routerLinkActiveOptions(#40303) (6c05c80), closes #13205router: Allow for custom router outlet implementations
service-worker: update supported range of node versions
upgrade: update supported range of node versions
Performance Improvements
common: remove unused methods from DomAdapter
compiler: reduce amount of generated code for safe accesses and nullish coalescing (#41563) (9a3b82f), closes #41437 #41491
compiler-cli: allow incremental compilation in the presence of redirected source files
compiler-cli: cache results of
absoluteFromSourceFilecore: minor improvements to listener instructions
core: avoid storing LView in ngContext (#41358) (990067a), closes #41047
core: optimize getDirectives
Breaking changes
- breaking
Minified UMD bundles are no longer included in the distributed NPM packages.
- breaking
animations: DOM elements are now correctly removed when the root view is removed.
If you are using SSR and use the app's HTML for rendering, you will need
to ensure that you save the HTML to a variable before destorying the
app.
It is also possible that tests could be accidentally relying on the old behavior by
trying to find an element that was not removed in a previous test. If
this is the case, the failing tests should be updated to ensure they
have proper setup code which initializes elements they rely on. - breaking
common: Methods of the
PlatformLocationclass, namelyonPopStateandonHashChange,
used to returnvoid. Now those methods return functions that can be called
to remove event handlers. - breaking
common: The methods of the
HttpParamsclass now acceptstring | number | boolean
instead ofstringfor the value of a parameter.
If you extended this class in your application,
you'll have to update the signatures of your methods to reflect these changes. - breaking
compiler-cli: Linked libraries no longer generate legacy i18n message ids. Any downstream
application that provides translations for these messages, will need to
migrate their message ids using thelocalize-migratecommand line tool. - breaking
core: Angular no longer maintains support for node v10
- breaking
core: Previously the
ng.getDirectivesfunction threw an error in case a
given DOM node had no Angular context associated with it (for example
if a function was called for a DOM element outside of an Angular app).
This behavior was inconsistent with other debugging utilities underng
namespace, which handled this situation without raising an exception.
Now calling theng.getDirectivesfunction for such DOM nodes would
result in an empty array returned from that function. - breaking
core: Switching default of
emitDistinctChangesOnlyDefaultValue
which changes the default behavior and may cause some applications which
rely on the incorrect behavior to fail.
emitDistinctChangesOnly flag has also been deprecated and will be
removed in a future major release.
The previous implementation would fire changes QueryList.changes.subscribe
whenever the QueryList was recomputed. This resulted in an artificially
high number of change notifications, as it is possible that recomputingQueryList results in the same list. When the QueryList gets recomputed
is an implementation detail, and it should not be the thing that determines
how often change event should fire.
Unfortunately, fixing the behavior outright caused too many existing
applications to fail. For this reason, Angular considers this fix a
breaking fix and has introduced a flag in @ContentChildren and@ViewChildren, that controls the behavior.
export class QueryCompWithStrictChangeEmitParent {
@ContentChildren('foo', {
// This option is the new default with this change.
emitDistinctChangesOnly: true,
})
foos!: QueryList<any>;
}For backward compatibility before v12emitDistinctChangesOnlyDefaultValue was set to false. This change
changes the default to true.
- breaking
core: The type of the
APP_INITIALIZERtoken has been changed to more accurately
reflect the types of return values that are handled by Angular. Previously,
each initializer callback was typed to returnany, this is nowPromise<unknown> | Observable<unknown> | void. In the unlikely event that
your application uses theInjector.getorTestBed.injectAPI to inject
theAPP_INITIALIZERtoken, you may need to update the code to account for
the stricter type.
Additionally, TypeScript may report the TS2742 error if the APP_INITIALIZER
token is used in an expression of which its inferred type has to be emitted
into a .d.ts file. To workaround this, an explicit type annotation is needed,
which would typically be Provider or Provider.
- breaking
core: Minimum supported
zone.jsversion is0.11.4 - breaking
forms: The
emitEventoption was added to the followingFormArrayandFormGroupmethods: - breaking
FormGroup.addControl
- breaking
FormGroup.removeControl
- breaking
FormGroup.setControl
- breaking
FormArray.push
- breaking
FormArray.insert
- breaking
FormArray.removeAt
- breaking
FormArray.setControl
- breaking
FormArray.clear
If your app has custom classes that extend FormArray or FormGroup classes and override the
above-mentioned methods, you may need to update your implementation to take the new options into
account and make sure that overrides are compatible from a types perspective.
- breaking
forms: Previously
minandmaxattributes defined on the<input type="number">
were ignored by Forms module. Now presence of these attributes would
trigger min/max validation logic (in caseformControl,formControlName
orngModeldirectives are also present on a given input) and
corresponding form control status would reflect that. - breaking
platform-browser:
XhrFactoryhas been moved from@angular/common/httpto@angular/common.
Before
import {XhrFactory} from '@angular/common/http';After
import {XhrFactory} from '@angular/common';- breaking
router: Strict null checks will report on fragment potentially being null.
Migration path: add null check. - breaking
router: The type of the
RouterLinkActive.routerLinkActiveOptionsinput was
expanded to allow more fine-tuned control. Code that previously read
this property may need to be updated to account for the new type.