cljsjs

frederic 2017-04-12T07:39:33.512078Z

@juhoteperi would you give me some advice re: my message just above?

juhoteperi 2017-04-12T07:53:07.689747Z

@frederic Both options are fine. Keeping the currents paths is okay, but I guess changing them also is fine as I think it should only cause minimal breakage, foreign-libs get automatically used from new paths and probably users get compile time errors if the css path has changed.

frederic 2017-04-12T07:56:38.737912Z

Oh, ok. Thank you.

frederic 2017-04-12T07:58:31.763066Z

I think I’ll change them then. It doesn’t seem to have a lot of traction on clojars, might as well get it right with limited breakage

frederic 2017-04-12T13:35:32.840730Z

@juhoteperi I found out that building cljsjs packages (boot package install target) on windows boxes can result in invalid deps.cljs files

frederic 2017-04-12T13:35:41.844052Z

Here’s an example :

frederic 2017-04-12T13:35:43.844836Z

{:foreign-libs [{:file "cljsjs/quill/development/quill.inc.js", :provides ["cljsjs.quill"], :file-min "cljsjs/quill/production/quill.min.inc.js"}], :externs ["cljsjs\\quill\\common\\quill.ext.js"]}

frederic 2017-04-12T13:36:02.851676Z

(note the backslashes in the :externs)

frederic 2017-04-12T13:36:22.859457Z

would you be interested in a pull-request to either document the problem or fix it?

frederic 2017-04-12T13:37:46.890237Z

I believe the problem could be fixed by a simple string substitution in cljsjs.boot-cljsjs.packaging/deps-cljs

frederic 2017-04-12T13:38:18.901775Z

but that might be a kludge

juhoteperi 2017-04-12T14:24:07.025979Z

Hmm. why do :file and :file-min work correctly but not :externs

juhoteperi 2017-04-12T14:24:13.028487Z

they all use boot.core/tmp-path

frederic 2017-04-12T15:15:56.411218Z

The only difference I can see is that quill.ext.js comes directly from the resources directory on a windows file system, while quill.inc.js and quill.min.inc.js are sift :moved from a downloaded, uncompressed .tar.gz archive

frederic 2017-04-12T15:16:15.419478Z

My guess would be that boot handles those inconsistently

frederic 2017-04-12T15:17:30.452671Z

However, both are valid windows paths (although they’re rarely used, forward slashes are valid path separators even on windows)

frederic 2017-04-12T15:18:42.483976Z

So, I would argue that, although it would be nicer if boot were more consistent, what they are doing is not technically incorrect

frederic 2017-04-12T15:19:45.511611Z

Which makes me think that cljsjs should normalize the paths

timgilbert 2017-04-12T15:28:06.734466Z

Hey, I'm seeing something kinda weird... I'm using this as my (manually-built) deps.cljs:

{:foreign-libs [{:provides ["cljsjs.react-three-renderer"]
                 :requires ["cljsjs.react" "cljsjs.react-dom" "cljsjs.three"]
                 :file     "cljsjs/react-three-renderer/development/react-three-renderer.inc.js"
                 :file-min "cljsjs/react-three-renderer/production/react-three-renderer.min.inc.js"}]
 :externs ["cljsjs/react-three-renderer/common/react-three-renderer.ext.js"]}

timgilbert 2017-04-12T15:29:07.761423Z

...but then in my compiled sources for an app using this library I see this:

% grep -r react_dom *
resources/public/js/compiled/out/cljs_deps.js:goog.addDependency("../cljsjs/react-three-renderer/development/react-three-renderer.inc.js", ['cljsjs.react_three_renderer'], ['cljsjs.react', 'cljsjs.react_dom', 'cljsjs.three']);

timgilbert 2017-04-12T15:29:52.781470Z

...and the JS throws an error Undefined nameToPath for cljsjs.react_dom, apparently having mangled the name to use underscores instead of dashes

juhoteperi 2017-04-12T15:35:42.937636Z

Yes

juhoteperi 2017-04-12T15:35:51.941734Z

Underscores are changed to dashes

juhoteperi 2017-04-12T15:36:10.949822Z

But you should use "cljsjs.react.dom" in :requires anyway

juhoteperi 2017-04-12T15:45:59.204778Z

^ @timgilbert

timgilbert 2017-04-12T15:46:27.216890Z

Aha. I'll check that, thanks @juhoteperi

juhoteperi 2017-04-12T15:46:53.228485Z

Though that's pretty much the same thing that I already mentioned in #clojurescript

👍 1