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

Side by Side Diff: docs/closure_compilation.md

Issue 2852143002: Add instructions for the Closure externs generator (Closed)
Patch Set: Created 3 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Closure Compilation 1 # Closure Compilation
2 2
3 ## What is type safety? 3 ## What is type safety?
4 4
5 [Strongly-typed languages](https://en.wikipedia.org/wiki/Strong_and_weak_typing) 5 [Strongly-typed languages](https://en.wikipedia.org/wiki/Strong_and_weak_typing)
6 like C++ and Java have the notion of variable types. 6 like C++ and Java have the notion of variable types.
7 7
8 This is typically baked into how you declare variables: 8 This is typically baked into how you declare variables:
9 9
10 ```c++ 10 ```c++
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 ++ '../my_project/compiled_resources2.gyp:*', 189 ++ '../my_project/compiled_resources2.gyp:*',
190 ], 190 ],
191 } 191 }
192 ] 192 ]
193 } 193 }
194 ``` 194 ```
195 195
196 This file is used by the 196 This file is used by the
197 [Closure compiler bot](https://build.chromium.org/p/chromium.fyi/builders/Closur e%20Compilation%20Linux) 197 [Closure compiler bot](https://build.chromium.org/p/chromium.fyi/builders/Closur e%20Compilation%20Linux)
198 to automatically compile your code on every commit. 198 to automatically compile your code on every commit.
199
200 ## Externs
201
202 [Externs files](https://github.com/google/closure-compiler/wiki/FAQ#how-do-i-wri te-an-externs-file)
203 define APIs external to your JavaScript. They provide the compiler with the type
204 information needed to check usage of these APIs in your JavaScript, much like
205 forward declarations do in C++.
206
207 Third-party libraries like Polymer often provide externs. Chrome must also
208 provide externs for its extension APIs. Whenever an extension API's `idl` or
209 `json` schema is updated in Chrome, the corresponding externs file must be
210 regenerated:
211
212 ```shell
213 ./tools/json_schema_compiler/compiler.py -g externs \
214 extensions/common/api/your_api_here.idl \
215 > third_party/closure_compiler/externs/your_api_here.js
216 ```
OLDNEW
« 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