Skip to content

Commit 0811f64

Browse files
clydindgp1130
authored andcommitted
build: update package output to use ES2022
The JavaScript generated for the published packages is now using ES2022. This removes additional downleveling of code that was previously necessary to use newer features. The minimum Node.js version of 18.13 provides support for the needed features. While this change does require a patch to `@bazel/concatjs` to allow the target to be set to `ES2022`, this patch is now already required by the migration of the universal repository into the CLI repository.
1 parent 4b67d2a commit 0811f64

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

packages/angular/ssr/src/inline-css-processor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class CrittersExtended extends Critters {
9292
private documentNonces = new WeakMap<PartialDocument, string | null>();
9393

9494
// Inherited from `Critters`, but not exposed in the typings.
95-
protected embedLinkedStylesheet!: EmbedLinkedStylesheetFn;
95+
protected declare embedLinkedStylesheet: EmbedLinkedStylesheetFn;
9696

9797
constructor(
9898
readonly optionsExtended: InlineCriticalCssProcessorOptions & InlineCriticalCssProcessOptions,

packages/angular_devkit/build_angular/src/builders/prerender/utils.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import { BuilderContext } from '@angular-devkit/architect';
1010
import { BrowserBuilderOptions } from '@angular-devkit/build-angular';
11-
import { json } from '@angular-devkit/core';
11+
import { JsonObject, json } from '@angular-devkit/core';
1212
import * as fs from 'fs';
1313
import { parseAngularRoutes } from 'guess-parser';
1414
import * as path from 'path';
@@ -48,7 +48,7 @@ export async function getRoutes(
4848
} catch (e) {
4949
assertIsError(e);
5050

51-
logger.error('Unable to extract routes from application.', { ...e });
51+
logger.error('Unable to extract routes from application.', { ...e } as unknown as JsonObject);
5252
}
5353
}
5454

packages/angular_devkit/build_angular/src/utils/index-file/inline-critical-css.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class CrittersExtended extends Critters {
8888
private documentNonces = new WeakMap<PartialDocument, string | null>();
8989

9090
// Inherited from `Critters`, but not exposed in the typings.
91-
protected embedLinkedStylesheet!: EmbedLinkedStylesheetFn;
91+
protected declare embedLinkedStylesheet: EmbedLinkedStylesheetFn;
9292

9393
constructor(
9494
private readonly optionsExtended: InlineCriticalCssProcessorOptions &

tools/defaults.bzl

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def ts_library(
7373
if not devmode_module:
7474
devmode_module = "commonjs"
7575
if not devmode_target:
76-
devmode_target = "es2020"
76+
devmode_target = "es2022"
7777

7878
_ts_library(
7979
name = name,
@@ -83,7 +83,7 @@ def ts_library(
8383
tsconfig = tsconfig,
8484
devmode_module = devmode_module,
8585
devmode_target = devmode_target,
86-
prodmode_target = "es2020",
86+
prodmode_target = "es2022",
8787
# @external_end
8888
**kwargs
8989
)

tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"outDir": "./dist",
1212
"skipLibCheck": true,
1313
"strict": true,
14-
"target": "es2020",
15-
"lib": ["es2020"],
14+
"target": "es2022",
15+
"lib": ["es2022"],
1616
"rootDir": ".",
1717
"rootDirs": [".", "./dist-schema/bin/"],
1818
"paths": {

0 commit comments

Comments
 (0)