Skip to content

Commit c46d533

Browse files
devversionatscott
authored andcommitted
build: switch devmode output to es2015 (angular#44505)
To make our test output i.e. devmode output more aligned with what we produce in the NPM packages, or to be more aligned with what Angular applications will usually consume, the devmode output is switched from ES5 to ES2015. Additionally various tsconfigs (outside of Bazel) have been updated to match with the other parts of the build. The rules are: ES2015 for test configurations, ES2020 for actual code that will end up being shipped (this includes the IDE-only tsconfigs). PR Close angular#44505
1 parent 8388151 commit c46d533

87 files changed

Lines changed: 134 additions & 250 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

packages/animations/browser/test/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ ts_library(
3030

3131
jasmine_node_test(
3232
name = "test",
33-
bootstrap = ["//tools/testing:node_es5"],
33+
bootstrap = ["//tools/testing:node_es2015"],
3434
deps = [
3535
":test_lib",
3636
],

packages/animations/test/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ts_library(
2020

2121
jasmine_node_test(
2222
name = "test",
23-
bootstrap = ["//tools/testing:node_es5"],
23+
bootstrap = ["//tools/testing:node_es2015"],
2424
deps = [
2525
":test_lib",
2626
],

packages/bazel/src/ng_module/ng_module.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,10 @@ def _ngc_tsconfig(ctx, files, srcs, **kwargs):
275275
if not is_devmode:
276276
# Note: Keep in sync with the `prodmode_target` for `ts_library` in `tools/defaults.bzl`
277277
tsconfig["compilerOptions"]["target"] = "es2020"
278+
else:
279+
# For devmode output, we use ES2015 to match with what `ts_library` produces by default.
280+
# https://github.com/bazelbuild/rules_nodejs/blob/9b36274dba34204625579463e3da054a9f42cb47/packages/typescript/internal/build_defs.bzl#L83.
281+
tsconfig["compilerOptions"]["target"] = "es2015"
278282

279283
return tsconfig
280284

packages/bazel/src/ngc-wrapped/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"lib": ["es5", "es2015.collection", "es2015.core"],
3+
"lib": ["es2015"],
44
"types": ["node"],
55
"esModuleInterop": true,
66
"downlevelIteration": true

packages/bazel/test/ngc-wrapped/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"compilerOptions": {
3-
"lib": ["es5", "es2015.collection", "es2015.core"],
3+
"lib": ["es2015"],
44
"types": ["node", "jasmine"],
55
"esModuleInterop": true
66
}

packages/benchpress/test/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ts_library(
1515

1616
jasmine_node_test(
1717
name = "test",
18-
bootstrap = ["//tools/testing:node_es5"],
18+
bootstrap = ["//tools/testing:node_es2015"],
1919
deps = [
2020
":test_lib",
2121
"//packages/benchpress",

packages/common/http/test/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ts_library(
2727

2828
jasmine_node_test(
2929
name = "test",
30-
bootstrap = ["//tools/testing:node_es5"],
30+
bootstrap = ["//tools/testing:node_es2015"],
3131
deps = [
3232
":test_lib",
3333
],

packages/common/http/testing/test/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ts_library(
2424

2525
jasmine_node_test(
2626
name = "test",
27-
bootstrap = ["//tools/testing:node_es5"],
27+
bootstrap = ["//tools/testing:node_es2015"],
2828
deps = [
2929
":test_lib",
3030
],

packages/common/test/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ ts_library(
3838

3939
jasmine_node_test(
4040
name = "test",
41-
bootstrap = ["//tools/testing:node_es5"],
41+
bootstrap = ["//tools/testing:node_es2015"],
4242
deps = [
4343
":test_lib",
4444
],

packages/common/upgrade/test/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ts_library(
2323

2424
jasmine_node_test(
2525
name = "test",
26-
bootstrap = ["//tools/testing:node_es5"],
26+
bootstrap = ["//tools/testing:node_es2015"],
2727
deps = [
2828
":test_lib",
2929
],

0 commit comments

Comments
 (0)