WebUI: Clean up more closure compiler references
- Fix a potential build issue by ensuring builds that manually override
enable_js_type_check only add the webui_closure_compile target on
ChromeOS Ash.
- Update documentation to indicate closure should never be used on other
platforms.
Bug: 1316438
Change-Id: I44d35f9805ca56d3825a3c4106964740bdec5b7b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4185395
Reviewed-by: Demetrios Papadopoulos <[email protected]>
Reviewed-by: Bruce Dawson <[email protected]>
Commit-Queue: Rebekah Potter <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1095761}
diff --git a/BUILD.gn b/BUILD.gn
index ea356bd..e8b687f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -115,7 +115,7 @@
deps += [ "//third_party/abseil-cpp:absl_tests" ]
}
- if (enable_js_type_check) {
+ if (is_chromeos_ash && enable_js_type_check) {
deps += [ ":webui_closure_compile" ]
}
diff --git a/docs/closure_compilation.md b/docs/closure_compilation.md
index 874e7ce..7286126 100644
--- a/docs/closure_compilation.md
+++ b/docs/closure_compilation.md
@@ -1,5 +1,9 @@
# Closure Compilation
+**Important: Closure Compilation is only supported on ChromeOS Ash. On all
+other platforms, Closure Compiler is deprecated; TypeScript should be used
+for type checking.** See [bug](https://www.crbug.com/1316438)
+
## What is type safety?
[Statically-typed languages](https://en.wikipedia.org/wiki/Type_system#Static_type_checking)
diff --git a/styleguide/web/web.md b/styleguide/web/web.md
index f41de47c..8ed0a3a 100644
--- a/styleguide/web/web.md
+++ b/styleguide/web/web.md
@@ -341,10 +341,10 @@
feature when the code needs to handle null/undefined gracefully.
-### Closure compiler
+### Closure compiler (ChromeOS Ash code only)
-* Closure compiler should only be used by legacy code that has not yet been
- converted to use TypeScript.
+* Closure compiler can only be used on ChromeOS Ash. All other platforms
+ are required to use TypeScript to add type checking.
* Use the [closure
compiler](https://chromium.googlesource.com/chromium/src/+/main/docs/closure_compilation.md)