thheller / shadow-cljs

ClojureScript compilation made easy
https://github.com/thheller/shadow-cljs
Eclipse Public License 1.0
2.27k stars 179 forks source link

failed to migrate foreign-dep for quil #121

Closed shaunlebron closed 7 years ago

shaunlebron commented 7 years ago

quil fails to build under shadow because a transitive dep uses a foreign-dep to include processing.js: https://github.com/quil/processing-js/blob/master/resources/deps.cljs

processing.js is published to npm: https://github.com/processing-js/processing-js

The following shim results in an empty Processing object:

(ns org.processingjs.Processing
  (:require ["processing-js" :as processing-js]))

(js/goog.exportSymbol "Processing" processing-js)
thheller commented 7 years ago

processing-js is not proper UMD and forcibly exports to window.Processing = e("./src/")(r);.

So just removing the (js/goog.exportSymbol "Processing" processing-js) should fix it as its already done by the package itself.

thheller commented 7 years ago

Alternatively you could skip the browserify package they provide and directly use the sources.

(:require ["processing-js/src/index" :as processing-js])

I would recommend doing this.

thheller commented 7 years ago

Or not ... their build prepends on file you won't get when using the sources directly but seems to be required. Seems best to stick to using their Processing global.

shaunlebron commented 7 years ago

thanks, that worked. just sticking to their Processing global.