forked from clojure/clojurescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New Closure has three changes that affect ClojureScript: Closure doesn't add goog.provide/require calls to the processed files. Goog.provide call is used by ClojureScript compiler to check which names are available. Easiest fix to be seems to emit the call ourselves instead of trying to find places where it is needed. Another change is that all CJS exports are now under `default` property, so compiler needs to emit ["default"] when accessing vars from JS modules. Closure now uses ES2017 as default languageIn option, and some optimization passes don't work with that. We can default to ES5 as JS modules are transpiled separately. Advanced optimization now removes unncessary backslashes from regex literals, so pr-str test was changed. google/closure-compiler@179b62c This commit also adds new closure-snapshot lein profile which can be used to test ClojureScript with the latest Closure snapshot, e.g. lein with-profile +closure-snapshot repl
- Loading branch information
1 parent
2f9e50c
commit 72e2ab6
Showing
10 changed files
with
161 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,24 @@ | ||
(ns npm-deps-test.string-requires | ||
(:require [react :refer [createElement]] | ||
["react-dom/server" :as ReactDOMServer] | ||
["lodash-es/toArray" :refer [default] :rename {default toArray}] | ||
["lodash-es/toFinite" :as toFinite] | ||
["lodash-es/array" :as array] | ||
[npm-deps-test.string-requires-in-classpath])) | ||
|
||
(enable-console-print!) | ||
|
||
(println "ReactDOMServer exists:" ReactDOMServer | ||
(.-renderToString ReactDOMServer)) | ||
;; CJS namespace access | ||
(println ReactDOMServer) | ||
|
||
;; CJS method call | ||
(ReactDOMServer/renderToString nil) | ||
|
||
;; es6 default with refer rename | ||
(toArray nil) | ||
|
||
;; es6 :as and default | ||
(toFinite/default nil) | ||
|
||
;; es6 | ||
(array/findIndex #js [1 2] 2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.