boot-clj / boot-cljs

Boot task to compile ClojureScript programs.
Eclipse Public License 1.0
176 stars 40 forks source link

Add support to load foreign-libs from remote url in deps.cljs files #158

Closed nathandao closed 7 years ago

nathandao commented 7 years ago

Seems like boot-cljs only supports local files for :foreign-libs. Would be great if that also works for remote urls - which is the case for ClojureScript compiler options: https://github.com/clojure/clojurescript/wiki/Compiler-Options#foreign-libs

boot-cljs.clj #L50:

(defn- read-cljs-edn
  [tmp-file]
  (let [file (core/tmp-file tmp-file)
        path (core/tmp-path tmp-file)]
    (assoc (read-string (slurp file))
           :path     (.getPath file)
           :rel-path path
           :id       (string/replace (.getName file) #"\.cljs\.edn$" ""))))
Deraen commented 7 years ago

The included code snippet doesn't have anything to do with deps.cljs or foreign-libs handling?

Nothing in Boot-cljs should affect this, and I have validated that this works both Boot-cljs and bare Cljs:

:foreign-libs [{:provides ["cljsjs.react"]
                :file "https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.js"}
               {:provides ["cljsjs.react.dom"]
                :requires ["cljsjs.react"]
                :file "https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.js"}]

Cljs 1.9.495 (this feature is broken at least in 456).

Reagent dep with cljsjs/react and cljsjs/react-dom exclusion.

nathandao commented 7 years ago

sorry about this - clearly screwed up my issue report ._.

Turned out to be an existing ClojureScript issue - which happens when defining :foreign-libs in deps.cljs files.