build(devtools): target es2020 explicitly (#50086)

We do this because of a bug caused by https://github.com/evanw/esbuild/issues/2950 and a recent change to how angular static properties are attached to class constructors. Targeting esnext or es2022 will cause the static initializer blocks that attach these static properties on class constructors to reference a class constructor variable that they do not have access to.

Because of this we explicitly target es2020 in our Angular DevTools builds.

PR Close #50086
This commit is contained in:
AleksanderBodurri
2023-04-30 22:49:50 -04:00
committed by Alex Rickabaugh
parent aee526a08b
commit a1dc3bb503
2 changed files with 18 additions and 3 deletions
@@ -64,7 +64,12 @@ esbuild(
minify = True,
platform = "browser",
splitting = False,
target = "esnext",
# todo(aleksanderbodurri): here we target es2020 explicitly.
# We do this because of a bug caused by https://github.com/evanw/esbuild/issues/2950 and an Angular v16 change
# to how angular static properties are attached to class constructors.
# Targeting esnext or es2022 will cause the static initializer blocks that attach these static properties on class
# constructors to reference a class constructor variable that they do not have access to.
target = "es2020",
deps = LINKER_PROCESSED_FW_PACKAGES + [":src"],
)
@@ -76,7 +81,12 @@ esbuild(
minify = True,
platform = "browser",
splitting = False,
target = "esnext",
# todo(aleksanderbodurri): here we target es2020 explicitly.
# We do this because of a bug caused by https://github.com/evanw/esbuild/issues/2950 and an Angular v16 change
# to how angular static properties are attached to class constructors.
# Targeting esnext or es2022 will cause the static initializer blocks that attach these static properties on class
# constructors to reference a class constructor variable that they do not have access to.
target = "es2020",
deps = [":devtools"],
)
+6 -1
View File
@@ -45,7 +45,12 @@ esbuild(
entry_points = [":main.ts"],
platform = "browser",
splitting = True,
target = "es2016",
# todo(aleksanderbodurri): here we target es2020 explicitly.
# We do this because of a bug caused by https://github.com/evanw/esbuild/issues/2950 and an Angular v16 change
# to how angular static properties are attached to class constructors.
# Targeting esnext or es2022 will cause the static initializer blocks that attach these static properties on class
# constructors to reference a class constructor variable that they do not have access to.
target = "es2020",
deps = LINKER_PROCESSED_FW_PACKAGES + [":demo"],
)