Skip to content

Commit

Permalink
Add almost all of the Google Closure Library (#496) (#889)
Browse files Browse the repository at this point in the history
* Add with-in-str (#874)

* Update copyright / date in man page (#879)

* Document using Boot to generate a classpath file (#876)

Planck can access dependencies that are specified on its classpath.
These can be specified by hand but an alternative is to use a tool like
Boot to output the dependencies to a file that can then be fed into
Planck. This PR adds documentation to the Planck docs that explains how
this can be done and closes #343.

It's noted that, due to the introduction of tools.deps and Planck's
support for it via `plk`, this is less important than it was at the
time of the initial discussion.

* Add almost all of the Google Closure Library (#496)

Due to the way Planck is built, the Google Closure Library needs to be
bundled together with the executable. While the entirety of the library
has historically been available during the build process, only a small
subset has actually been included in the bundle.

This commit broadens the scope to almost the entirety of the Google
Closure Library (save for the facilities made available under the
`goog.demos` namespace). While this provides broader support to users,
it does substantially increase the amount of time it takes to complete
the full build process.

To provide an up to date version of the Google Closure Library, this
commit switches the version that is downloaded from the Maven repository
to a more recent distribution. This newer version of the Google Closure
Library caused conformance warnings to be displayed during the build
process. To avoid this, a newer version of the Google Closure Compiler
is also now required. As the newer version of the Google Closure Library
relies on features from ECMAScript 6, the language output of the Closure
Compiler has been switched to this version of ECMAScript.

Finally, the documentation has been updated as required.

* Remove some bundled GCL namespaces (#496)

The initial commit included almost the entirety of the Google Closure
Library. Doing so increased the time taken to compile Planck
considerably. This commit removes some of the namespaces that are not
considered appropriate or desirable for Planck. This reduces the time
taken for a full build by about a third.

The documentation has also been updated.

* Restore GCL localisations

To improve build times for the optimised version of Planck,the previous
commit did not include the localisation namespaces that are part of the
Google Closure Library. This commit restores the namespaces and instead
changes the `planck-cljs/script/bundle` script to skip these files when
optimising.

This commit can now be considered to fix #496. The documentation and
change log have been updated accordingly.

* Fix warning about time for build
  • Loading branch information
pyrmont authored and mfikes committed Mar 22, 2019
1 parent e565175 commit 88ee1fc
Show file tree
Hide file tree
Showing 7 changed files with 5,072 additions and 37 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ All notable changes to this project will be documented in this file. This change
## [Unreleased]
### Added
- Add `planck.core/with-in-str` ([#873](https://github.com/planck-repl/planck/issues/873))
- Document `planck.io/resource` ([#487](https://github.com/planck-repl/planck/issues/487))`
- Document `planck.io/resource` ([#487](https://github.com/planck-repl/planck/issues/487))
- Support `ns-aliases` and `ns-refers` ([#505](https://github.com/planck-repl/planck/issues/505))
- Add almost all of the Google Closure Library ([#496](https://github.com/planck-repl/planck/issues/496))

### Fixed
- Execution error instead of syntax for `08` ([#857](https://github.com/planck-repl/planck/issues/857))
Expand Down
1 change: 1 addition & 0 deletions planck-cljs/deps.edn
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{:deps {org.clojure/clojurescript {:mvn/version "1.10.520"}
org.clojure/google-closure-library {:mvn/version "0.0-20190213-2033d5d9"}
org.clojure/test.check {:mvn/version "0.10.0-alpha3"}
com.cognitect/transit-cljs {:mvn/version "0.8.248"}
fipp {:mvn/version "0.6.14"}
Expand Down
6 changes: 3 additions & 3 deletions planck-cljs/script/bundle
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ for file in `find . -name '*.js' -o -name '*.cljs' -o -name '*.cljc' -o -name '*
do
file=${file:2}
cp -p $file $file.bak
if [ $CLOSURE_OPTIMIZATIONS != "NONE" ] && [ ${file: -3} == ".js" ] && [ "${file: -7}" != "deps.js" ] && [ "${file: -9}" != "bundle.js" ] && [ "${file: -9}" != "jscomp.js" ] && [ "${file: -6}" != "csv.js" ] && [ "${file: -19}" != "performancetimer.js" ]
if [ $CLOSURE_OPTIMIZATIONS != "NONE" ] && [ ${file:0:10} != "goog/i18n/" ] && [ ${file: -3} == ".js" ] && [ "${file: -7}" != "deps.js" ] && [ "${file: -9}" != "bundle.js" ] && [ "${file: -9}" != "jscomp.js" ] && [ "${file: -6}" != "csv.js" ] && [ "${file: -19}" != "performancetimer.js" ]
then
if [ ! -f $file.optim ] || [ $file -nt $file.optim ]
then
if [ -f $file.map ]
then
java -jar ../../compiler/closure-compiler-v$CLOSURE_RELEASE.jar --compilation_level $CLOSURE_OPTIMIZATIONS --language_in ECMASCRIPT3 --language_out ECMASCRIPT3 --process_closure_primitives false --js $file --js_output_file $file.optim --source_map_input $file\|$file.map --create_source_map $file.map.optim
java -jar ../../compiler/closure-compiler-v$CLOSURE_RELEASE.jar --compilation_level $CLOSURE_OPTIMIZATIONS --language_in ECMASCRIPT6 --language_out ECMASCRIPT6 --process_closure_primitives false --js $file --js_output_file $file.optim --source_map_input $file\|$file.map --create_source_map $file.map.optim
else
java -jar ../../compiler/closure-compiler-v$CLOSURE_RELEASE.jar --compilation_level $CLOSURE_OPTIMIZATIONS --language_in ECMASCRIPT3 --language_out ECMASCRIPT3 --process_closure_primitives false --js $file --js_output_file $file.optim --create_source_map $file.map
java -jar ../../compiler/closure-compiler-v$CLOSURE_RELEASE.jar --compilation_level $CLOSURE_OPTIMIZATIONS --language_in ECMASCRIPT6 --language_out ECMASCRIPT6 --process_closure_primitives false --js $file --js_output_file $file.optim --create_source_map $file.map
fi
echo -n "."
fi
Expand Down
Loading

0 comments on commit 88ee1fc

Please sign in to comment.