From 21e45828cdeb2e90f7884b382239f1bce13307c5 Mon Sep 17 00:00:00 2001 From: Dan Vanderkam Date: Wed, 23 Oct 2013 13:09:15 -0500 Subject: [PATCH] comments & cleanup --- compile-with-closure.sh | 11 ++++++++--- dygraph-exports.js | 4 ++++ dygraph-internal.externs.js | 4 ++++ 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/compile-with-closure.sh b/compile-with-closure.sh index d39e5d0..50a93f2 100755 --- a/compile-with-closure.sh +++ b/compile-with-closure.sh @@ -1,6 +1,13 @@ #!/bin/bash + +# This script runs dygraphs through the Closure Compiler. This checks for +# errors (both in the JS and in the jsdoc) and flags type errors as WARNINGS. + +# It outputs minified JS to a temp file. This should be ignored for now, until +# it's fully functional. + java -jar ../../closure-compiler-read-only/build/compiler.jar \ - --compilation_level SIMPLE_OPTIMIZATIONS \ + --compilation_level ADVANCED_OPTIMIZATIONS \ --warning_level VERBOSE \ --output_wrapper='(function() {%output%})();' \ --js ../../closure-library-read-only/closure/goog/base.js \ @@ -33,5 +40,3 @@ java -jar ../../closure-compiler-read-only/build/compiler.jar \ --externs dygraph-internal.externs.js \ --externs gviz-api.js \ --js_output_file=/tmp/out.js - -# --js=dygraph-constants.js \ diff --git a/dygraph-exports.js b/dygraph-exports.js index 7c0b2c6..8cee86d 100644 --- a/dygraph-exports.js +++ b/dygraph-exports.js @@ -1,3 +1,7 @@ +// This is the complete set of symbols that dygraphs exports for use by +// clients. Exporting a symbols forces the Closure Compiler to preserve it in +// the minified JS (symbols not in this list are mangled). + goog.exportSymbol('Dygraph', Dygraph); goog.exportSymbol('Dygraph.prototype.adjustRoll', Dygraph.prototype.adjustRoll); diff --git a/dygraph-internal.externs.js b/dygraph-internal.externs.js index 90d0d6d..92e5cc3 100644 --- a/dygraph-internal.externs.js +++ b/dygraph-internal.externs.js @@ -1,3 +1,7 @@ +// This file: +// - declares symbols that are provided outisde of dygraphs (e.g. by excanvas) +// - defines custom types used internally + /** * @param {Object} dict * @return {!Array.} -- 2.7.4