Fork me on GitHub
#cljsjs
<
2017-04-12
>
frederic07:04:33

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

juhoteperi07:04:07

@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.

frederic07:04:38

Oh, ok. Thank you.

frederic07:04:31

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

frederic13:04:32

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

frederic13:04:41

Here’s an example :

frederic13:04:43

{: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"]}

frederic13:04:02

(note the backslashes in the :externs)

frederic13:04:22

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

frederic13:04:46

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

frederic13:04:18

but that might be a kludge

juhoteperi14:04:07

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

juhoteperi14:04:13

they all use boot.core/tmp-path

frederic15:04:56

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

frederic15:04:15

My guess would be that boot handles those inconsistently

frederic15:04:30

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

frederic15:04:42

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

frederic15:04:45

Which makes me think that cljsjs should normalize the paths

timgilbert15:04:06

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"]}

timgilbert15:04:07

...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']);

timgilbert15:04:52

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

juhoteperi15:04:51

Underscores are changed to dashes

juhoteperi15:04:10

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

timgilbert15:04:27

Aha. I'll check that, thanks @juhoteperi

juhoteperi15:04:53

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