ClojureScript

CLONE - Supported Closure Compiler options

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

Currently the interface to the Closure compiler in cljs.closure supports only two compiler options:

  • optimizations
  • pretty-print

From the repl it looks like this:

(-compile '(defn add-one [x] (inc x)) {:optimizations :advanced :flags #{:pretty-print}})

Do we want to support all options are just a subset?

Whatever we decide to support, said support will need to be added to cljs.closure.

See:

https://github.com/relevance/clojurescript/blob/master/src/clj/cljs/closure.clj#L110
http://code.google.com/p/closure-compiler/source/browse/src/com/google/javascript/jscomp/CommandLineRunner.java
http://code.google.com/p/closure-compiler/source/browse/src/com/google/javascript/jscomp/CompilerOptions.java

    1. Externs

Currently all default externs are loaded. If we decide to go with a subset of options we may want to follow the lead of CommandLineRunner and allow an option to provide custom externs and one to only use the custom externs.

Imported from github issue #62

Activity

Hide
David Nolen added a comment -

While trying to integrate Facebook's React I encountered just this issue. React uses custom JSDoc directives, there should be some way for users to tell Closure to ignore these - https://code.google.com/p/closure-compiler/wiki/Warnings

Show
David Nolen added a comment - While trying to integrate Facebook's React I encountered just this issue. React uses custom JSDoc directives, there should be some way for users to tell Closure to ignore these - https://code.google.com/p/closure-compiler/wiki/Warnings
Hide
David Nolen added a comment -

All the Google Closure warning knobs now exposed in master - https://github.com/clojure/clojurescript/commit/642de32f66b9cf183a43565fd031e08b6522b030

Show
David Nolen added a comment - All the Google Closure warning knobs now exposed in master - https://github.com/clojure/clojurescript/commit/642de32f66b9cf183a43565fd031e08b6522b030
Hide
David Nolen added a comment -

Going to close this one for now. If people want something specific from Closure not already exposed they should open a ticket for it.

Show
David Nolen added a comment - Going to close this one for now. If people want something specific from Closure not already exposed they should open a ticket for it.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: