Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Unified Diff: docs/closure_compilation.md

Issue 2852143002: Add instructions for the Closure externs generator (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/closure_compilation.md
diff --git a/docs/closure_compilation.md b/docs/closure_compilation.md
index 0c59e50a556aefc98538fd6adf1250d10df21771..81a002be57dd7dcb3ce49b298b2309e281b1f8c1 100644
--- a/docs/closure_compilation.md
+++ b/docs/closure_compilation.md
@@ -196,3 +196,21 @@ in `src/third_party/closure_compiler/compiled_resources2.gyp`:
This file is used by the
[Closure compiler bot](https://build.chromium.org/p/chromium.fyi/builders/Closure%20Compilation%20Linux)
to automatically compile your code on every commit.
+
+## Externs
+
+[Externs files](https://github.com/google/closure-compiler/wiki/FAQ#how-do-i-write-an-externs-file)
+define APIs external to your JavaScript. They provide the compiler with the type
+information needed to check usage of these APIs in your JavaScript, much like
+forward declarations do in C++.
+
+Third-party libraries like Polymer often provide externs. Chrome must also
+provide externs for its extension APIs. Whenever an extension API's `idl` or
+`json` schema is updated in Chrome, the corresponding externs file must be
+regenerated:
+
+```shell
+./tools/json_schema_compiler/compiler.py -g externs \
+ extensions/common/api/your_api_here.idl \
+ > third_party/closure_compiler/externs/your_api_here.js
+```
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698