@angular/platform-server
22.2.6 · 12 Nov 2026MIT1M / weekRepositoryHomepagenpmAtom feed
12.2.17 is the newest release of 12.x.
In short
14 breaking2 removed1 deprecated9 new4 faster14 fixed2 internal
- Breaking
Minified UMD bundles are no longer included in the distributed NPM packages.
- 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. - Breaking
core: Minimum supported
zone.jsversion is0.11.4 - Breaking
FormGroup.addControl
- Breaking
FormGroup.removeControl
Security
11 advisories affect 12.0.0; 20.3.33 fixes them
- HighAngular SSR: Denial of Service (DoS) via Infinite Loop on Malformed DOCTYPEGHSA-f67j-2jqw-jpq7 · 28 Sep 2026Fixed in 20.3.31
- HighAngular SSR: XSS via Unescaped Processing Instruction (<?...?>) Nodes in Fallback Raw-Content ElementsGHSA-j3r3-mxqp-r2p4 · 28 Sep 2026Fixed in 20.3.30
- HighAngular: SSR XSS via Unescaped <template> Content Across DocumentFragment Boundaries in Fallback Raw-Content ElementsGHSA-v3p8-whq6-r5jg · 10 Sep 2026Fixed in 20.3.30
- HighAngular: SSRF and Cross-Origin Credential Disclosure via URL Resolution Discrepancy in SSRGHSA-f6mr-pjwc-34m4 · 10 Sep 2026Fixed in 20.3.30
- HighAngular SSR: Missing Fallback Raw-Content Serialization Escaping leads to Cross-Site Scripting (XSS)GHSA-vpx6-8pjr-4g3v · 3 Aug 2026Fixed in 20.3.27
6 more
- High@angular/platform-server: Missing `<noscript>` Raw-Text Serialization Escaping leads to Cross-Site Scripting (XSS) in Angular SSRGHSA-gxx4-3xcv-f8qx · 15 Jun 2026Fixed in 19.2.25
- High@angular/platform-server: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')GHSA-hqr9-c56f-3x7f · 15 Jun 2026Fixed in 19.2.25
- High@angular/platform-server: URL Parser Differential leading to SSRF Allowlist BypassGHSA-xrxm-cp7j-8xf6 · 15 Jun 2026Fixed in 19.2.23
- High@angular/platform-server: SSRF via Hostname HijackingGHSA-rfh7-fxqc-q52v · 19 May 2026Fixed in 19.2.22
- HighAngular: SSRF via protocol-relative and backslash URLs in Angular Platform-ServerGHSA-45q2-gjvg-7973 · 16 Apr 2026Fixed in 19.2.21
- Moderate@angular/platform-server: Open Redirect via Protocol-Relative URLs in Server-Side Rendering (SSR)GHSA-w739-gvwx-grc3 · 20 Oct 2026Fixed in 20.3.33
Release note
The section about @angular/platform-server of a note shared by several packages.
Bug Fixes
animations: cleanup DOM elements when the root view is removed
animations: cleanup DOM elements when the root view is removed
- Deprecated
common: temporarily re-export and deprecate
XhrFactory common: cleanup location change listeners when the root view is removed (#40867) (38524c4), closes #31546
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
platform-server: update supported range of node versions to only include LTS versions
Features
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
platform-server: update supported range of node versions
platform-server: allow shimming the global env sooner (#40559) (43ecf8a), closes #24551 #39950 #39950
Performance Improvements
common: remove unused methods from DomAdapter
core: 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.
used to returnvoid. Now those methods return functions that can be called
to remove event handlers.
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.
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
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.
were ignored by Forms module. Now presence of these attributes would
trigger min/max validation logic (in case formControl, formControlName
or ngModel directives are also present on a given input) and
corresponding form control status would reflect that.
Before
import {XhrFactory} from '@angular/common/http';After
import {XhrFactory} from '@angular/common';Migration path: add null check.
expanded to allow more fine-tuned control. Code that previously read
this property may need to be updated to account for the new type.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.