Skip to content

Commit

Permalink
Revert "build: update ts_library to produce ES2022 (angular#49332)…
Browse files Browse the repository at this point in the history
…" (angular#49554)

This reverts commit 262c989.

PR Close angular#49554
  • Loading branch information
atscott committed Mar 22, 2023
1 parent e917a81 commit 589b66b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 9 deletions.
4 changes: 1 addition & 3 deletions packages/tsconfig-build.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
"noFallthroughCasesInSwitch": true,
"moduleResolution": "node",
"module": "esnext",
"target": "es2022",
// Keep the below in sync with ng_module.bzl
"useDefineForClassFields": false,
"target": "es2020",
"lib": ["es2020", "dom"],
"skipLibCheck": true,
// don't auto-discover @types/node, it results in a ///<reference in the .d.ts output
Expand Down
4 changes: 2 additions & 2 deletions tools/defaults.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def ts_library(
if not package_name:
package_name = _default_module_name(testonly)

default_target = "es2022"
default_target = "es2020"
default_module = "esnext"

_ts_library(
Expand All @@ -132,7 +132,7 @@ def ts_library(
deps = deps,
devmode_target = default_target,
devmode_module = default_module,
# For prodmode, the target is set to `ES2022`. `@bazel/typecript` sets `ES2015` by
# For prodmode, the target is set to `ES2020`. `@bazel/typecript` sets `ES2015` by
# default. Note that this should be in sync with the `ng_module` tsconfig generation.
# https://github.com/bazelbuild/rules_nodejs/blob/901df3868e3ceda177d3ed181205e8456a5592ea/third_party/github.com/bazelbuild/rules_typescript/internal/common/tsconfig.bzl#L195
# https://github.com/bazelbuild/rules_nodejs/blob/9b36274dba34204625579463e3da054a9f42cb47/packages/typescript/internal/build_defs.bzl#L85.
Expand Down
4 changes: 0 additions & 4 deletions tools/postinstall-patches.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,6 @@ ls('node_modules/@types').filter(f => f.startsWith('babel__')).forEach(pkg => {
sed('-i', 'private rootDirsRelative;', 'rootDirsRelative(fileName: string): string;',
'node_modules/@bazel/concatjs/internal/tsc_wrapped/compiler_host.d.ts');

// Add support for ES2022 in ts_library
sed('-i', '"es2020", "esnext"', '"es2020", "es2022", "esnext"',
'node_modules/@bazel/concatjs/internal/build_defs.bzl');

log('\n# patch: delete d.ts files referring to rxjs-compat');
// more info in https://github.com/angular/angular/pull/33786
rm('-rf', [
Expand Down

0 comments on commit 589b66b

Please sign in to comment.