0

Revert "WebUI: Make useDefineForClassFields: true the default"

This reverts commit ff8881a8ab.

Reason for revert: suspected to cause compile failure
https://ci.chromium.org/ui/p/chrome/builders/ci/linux-cft/b8718779482577792321/overview

Original change's description:
> WebUI: Make useDefineForClassFields: true the default
>
> - Update the default Lit and Polymer configs to remove
>   useDefineForClassFields: false
> - Add a new "_mixed" config that extends the updated Polymer config and
>   applies the extra parameters needed for files using Lit to compile
>   correctly without useDefineForClassFields: false
> - Select the new mixed config in build_webui for UIs that have both Lit
>   and Polymer dependencies.
> - Add "_legacy" TS configs in tools/typescript for use by UIs that have
>   not yet been updated to not rely on useDefineForClassFields: false
>
> Planning to remove the special "389737066" configs and references to
> them in a followup.
>
> Bug: 389737066
> Change-Id: I8b619a64eefa04f28a57f3be36cac05e19a1dfc4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6410314
> Reviewed-by: Rohit Rao <rohitrao@chromium.org>
> Commit-Queue: Rebekah Potter <rbpotter@chromium.org>
> Reviewed-by: Demetrios Papadopoulos <dpapad@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1440937}

No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 389737066
Change-Id: I7ae5951afc7e5997a388c9bf8fdea9b0c2323b74
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6419685
Owners-Override: Francois Pierre Doray <fdoray@chromium.org>
Auto-Submit: Francois Pierre Doray <fdoray@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Cr-Commit-Position: refs/heads/main@{#1440945}
This commit is contained in:
Francois Pierre Doray
2025-04-01 08:46:09 -07:00
committed by Chromium LUCI CQ
parent 0847fb46e0
commit 2efc0ce3a9
30 changed files with 14 additions and 58 deletions
chrome/browser/resources
history
inline_login
lens
overlay
shared
new_tab_page
omnibox_popup
on_device_internals
password_manager
pdf
print_preview
privacy_sandbox
settings
settings_shared
side_panel
bookmarks
commerce
customize_chrome
history
history_clusters
read_anything
reading_list
shared
ios/chrome/app/resources/profile_internals
tools/typescript
ui/webui/resources
cr_components
certificate_manager
tools

@@ -59,7 +59,6 @@ build_webui("build") {
html_to_wrapper_template = "detect"
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_definitions = [
"//tools/typescript/definitions/chrome_send.d.ts",
"//tools/typescript/definitions/metrics_private.d.ts",

@@ -17,7 +17,6 @@ build_webui("build") {
non_web_component_files = [ "inline_login_browser_proxy.ts" ]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_definitions = [
"//chrome/browser/resources/gaia_auth_host/authenticator.d.ts",
"//chrome/browser/resources/gaia_auth_host/saml_password_attributes.d.ts",

@@ -106,7 +106,6 @@ build_webui("build_overlay") {
]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
mojo_files_deps =
[ "//chrome/browser/lens/core/mojom:mojo_bindings_ts__generator" ]
mojo_files = [

@@ -19,7 +19,6 @@ build_webui("build") {
css_files = [ "searchbox_shared_style.css" ]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_deps = [
"//third_party/polymer/v3_0:library",
"//ui/webui/resources/cr_elements:build_ts",

@@ -1,5 +1,5 @@
{
"extends": "../../../../tools/typescript/tsconfig_base_polymer_legacy.json",
"extends": "../../../../tools/typescript/tsconfig_base_polymer.json",
"compilerOptions": {
"typeRoots": ["../../../../third_party/node/node_modules/@types"],
"types": ["dom-speech-recognition"]

@@ -12,7 +12,6 @@ build_webui("build") {
web_component_files = [ "app.ts" ]
non_web_component_files = [ "omnibox_popup.ts" ]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_deps = [
"//third_party/polymer/v3_0:library",
"//ui/webui/resources/cr_components/color_change_listener:build_ts",

@@ -40,7 +40,6 @@ build_webui("build") {
"tools.css",
]
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_deps = [
"//third_party/lit/v3_0:build_ts",
"//ui/webui/resources/cr_elements:build_ts",

@@ -117,7 +117,6 @@ build_webui("build") {
html_to_wrapper_template = "detect"
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_definitions = [
"//tools/typescript/definitions/chrome_event.d.ts",

@@ -177,8 +177,6 @@ build_webui("build") {
# TypeScript Compiler parameters
if (enable_ink) {
ts_tsconfig_base = "tsconfig_base.json"
} else {
ts_tsconfig_base = "//tools/typescript/tsconfig_base_lit_legacy.json"
}
ts_composite = true
ts_definitions = [

@@ -1,5 +1,5 @@
{
"extends": "../../../../tools/typescript/tsconfig_base_polymer_legacy.json",
"extends": "../../../../tools/typescript/tsconfig_base_polymer.json",
"compilerOptions": {
"noUncheckedIndexedAccess": true
}

@@ -94,7 +94,6 @@ build_webui("build") {
html_to_wrapper_template = "detect"
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_definitions = [
"//tools/typescript/definitions/chrome_event.d.ts",
"//tools/typescript/definitions/chrome_send.d.ts",

@@ -46,7 +46,6 @@ build_webui("build") {
]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ]
ts_deps = [
"//third_party/lit/v3_0:build_ts",

@@ -375,7 +375,6 @@ build_webui("build") {
]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_definitions = [
"//tools/typescript/definitions/autofill_private.d.ts",
"//tools/typescript/definitions/chrome_event.d.ts",

@@ -38,7 +38,6 @@ build_webui("build") {
]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_definitions = [
"//tools/typescript/definitions/chrome_event.d.ts",
"//tools/typescript/definitions/chrome_send.d.ts",

@@ -46,7 +46,6 @@ build_webui("build") {
mojo_files = [ "$root_gen_dir/chrome/browser/ui/webui/side_panel/bookmarks/bookmarks.mojom-webui.ts" ]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_definitions = [
"//tools/typescript/definitions/bookmark_manager_private.d.ts",
"//tools/typescript/definitions/bookmarks.d.ts",

@@ -1,8 +1,8 @@
{
"extends": "../../../../../tools/typescript/tsconfig_base_polymer_legacy.json",
"extends": "../../../../../tools/typescript/tsconfig_base_polymer.json",
"compilerOptions": {
"allowUmdGlobalAccess": true,
"typeRoots": [ "../../../../../third_party/node/node_modules/@types" ],
"types": [ "d3" ]
}
}
}

@@ -80,7 +80,6 @@ build_webui("build") {
]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_lit_legacy.json"
ts_deps = [
"../shared:build_ts",
"//third_party/lit/v3_0:build_ts",

@@ -18,7 +18,6 @@ build_webui("build") {
]
css_files = [ "app.css" ]
ts_tsconfig_base = "//tools/typescript/tsconfig_base_lit_legacy.json"
ts_deps = [
"../shared:build_ts",
"//third_party/lit/v3_0:build_ts",

@@ -19,7 +19,6 @@ build_webui("build") {
css_files = [ "app.css" ]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_lit_legacy.json"
ts_deps = [
"../shared:build_ts",
"//third_party/lit/v3_0:build_ts",

@@ -59,7 +59,6 @@ build_webui("build") {
html_to_wrapper_template = "detect"
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_lit_legacy.json"
ts_deps = [
"//chrome/browser/resources/side_panel/shared:build_ts",
"//third_party/lit/v3_0:build_ts",

@@ -36,7 +36,6 @@ build_webui("build") {
html_to_wrapper_template = "detect"
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_lit_legacy.json"
ts_deps = [
"../shared:build_ts",
"//third_party/lit/v3_0:build_ts",

@@ -32,7 +32,6 @@ build_webui("build") {
html_to_wrapper_template = "detect"
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_deps = [
"//third_party/lit/v3_0:build_ts",
"//third_party/polymer/v3_0:library",

@@ -15,7 +15,6 @@ build_webui("build") {
html_to_wrapper_template = "detect"
ts_definitions = [ "//tools/typescript/definitions/chrome_send.d.ts" ]
ts_tsconfig_base = "//tools/typescript/tsconfig_base_lit_legacy.json"
ts_deps = [
"//third_party/lit/v3_0:build_ts",
"//ui/webui/resources/js:build_ts",

@@ -1,7 +1,6 @@
{
"extends": "./tsconfig_base.json",
"compilerOptions": {
"target": "ES2024",
"lib": ["ES2024", "DOM", "DOM.Iterable"]
"useDefineForClassFields": false
}
}

@@ -1,6 +0,0 @@
{
"extends": "./tsconfig_base.json",
"compilerOptions": {
"useDefineForClassFields": false
}
}

@@ -1,7 +0,0 @@
{
"extends": "./tsconfig_base_polymer.json",
"compilerOptions": {
"target": "ES2024",
"lib": ["ES2024", "DOM", "DOM.Iterable"]
}
}

@@ -3,6 +3,7 @@
"compilerOptions": {
"noUncheckedIndexedAccess": false,
"noUnusedLocals": false,
"strictPropertyInitialization": false
"strictPropertyInitialization": false,
"useDefineForClassFields": false
}
}

@@ -1,6 +0,0 @@
{
"extends": "./tsconfig_base_polymer.json",
"compilerOptions": {
"useDefineForClassFields": false
}
}

@@ -92,7 +92,6 @@ build_webui("build") {
"//tools/typescript/definitions/metrics_private.d.ts",
]
ts_composite = true
ts_tsconfig_base = "//tools/typescript/tsconfig_base_polymer_legacy.json"
ts_deps = [
"//third_party/lit/v3_0:build_ts",
"//third_party/polymer/v3_0:library",

@@ -370,15 +370,8 @@ template("build_webui") {
has_polymer =
filter_include(invoker.ts_deps,
[ "//third_party/polymer/v3_0:library" ]) != []
has_lit = filter_include(invoker.ts_deps,
[ "//third_party/lit/v3_0:build_ts" ]) != []
if (has_polymer) {
if (has_lit) {
# Config with Lit parameters also for migrating UIs.
tsconfig_base = "//tools/typescript/tsconfig_base_mixed.json"
} else {
tsconfig_base = "//tools/typescript/tsconfig_base_polymer.json"
}
tsconfig_base = "//tools/typescript/tsconfig_base_polymer.json"
# Detect whether the target corresponds to an Ash-only WebUI and use
# tsconfig_base_polymer_cros.json instead in such cases.
@@ -397,8 +390,12 @@ template("build_webui") {
tsconfig_base = "//tools/typescript/tsconfig_base_polymer_cros.json"
}
}
} else if (has_lit) {
tsconfig_base = "//tools/typescript/tsconfig_base_lit.json"
} else {
has_lit = filter_include(invoker.ts_deps,
[ "//third_party/lit/v3_0:build_ts" ]) != []
if (has_lit) {
tsconfig_base = "//tools/typescript/tsconfig_base_lit.json"
}
}
}