Skip to content

Commit

Permalink
WebUI: Clean up more closure compiler references
Browse files Browse the repository at this point in the history
- 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}
  • Loading branch information
Rebekah Potter authored and Chromium LUCI CQ committed Jan 23, 2023
1 parent 0b948e2 commit b2f0fae
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ group("gn_all") {
deps += [ "//third_party/abseil-cpp:absl_tests" ]
}

if (enable_js_type_check) {
if (is_chromeos_ash && enable_js_type_check) {
deps += [ ":webui_closure_compile" ]
}

Expand Down
4 changes: 4 additions & 0 deletions docs/closure_compilation.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
6 changes: 3 additions & 3 deletions styleguide/web/web.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ if (!enterKey) {
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)
Expand Down

0 comments on commit b2f0fae

Please sign in to comment.