Fork me on GitHub
#cljsjs
<
2015-12-04
>
eggsyntax19:12:43

The library I'm adding to CLJSJS, MathBox, is actually MathBox 1 -- the author has quite recently released MathBox 2, which is radically different and not at all backward compatible. They're effectively two distinct libraries. Also, MathBox 2 is still alpha, according to the author (as of 9/27). For CLJSJS purposes, any suggestions on the best way to handle that? I may very well only be adding MathBox 1, but someone else may want to later. Is it better to explicitly label mine mathbox1, with mathbox2 as an eventual separate package? Alternately, I could just call this one mathbox, with an eventual mathbox2. Or treat them as the same package, and trust version numbering to avoid confusion? (although honestly, I think there'd still be plenty of confusion if I did that). Any feedback appreciated. @martinklepsch ?

domkm20:12:43

Is CLJSJS used to package Closure-compatible JS or only JS that requires deps/externs?

eggsyntax21:12:24

@domkm: As far as I know, Closure-compatible libs have no need to be on CLJSJS, they can just be added straight to your project. But I haven't done that myself, and I'm no expert; this is just a placeholder answer until someone more knowledgeable comes along 😉

domkm22:12:36

@eggsyntax: I want a Maven package so I don't have to vendor the JS code.

eggsyntax22:12:44

Should be easy, I believe. See the "Including external JavaScript within your compilation” section of http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html But again, if you hit any trouble you’ll want info from someone more knowledgeable.

domkm22:12:47

@eggsyntax: Hmm, does that help with avoiding including the JS files in my project directly?

eggsyntax22:12:30

Yeah, you should be able to just include :libs ["libs/foobar.js”] in your compiler options (in project.clj). Of course, the JS code (or at least the subset you’re using) will get added to the build, but you shouldn’t have to download & include it explicitly other than that.

eggsyntax22:12:07

But I should seriously shut up at this point — again, I’m just giving my vague understanding without ever having actually done it.

eggsyntax22:12:10

Looks like you could also include it right from https://github.com/nberger/libphonenumber-cljs : [nberger/libphonenumber-cljs "7.1.0-SNAPSHOT”]

martinklepsch23:12:30

@eggsyntax: @domkm closure compatible stuff can be packaged via :libs (similar to :foreign-libs). See the openlayers Package for an Exempel

eggsyntax23:12:49

Thanks @martinklepsch . Any thoughts about my question above (@ 2:28)?

martinklepsch23:12:27

@eggsyntax: I'd suggest using regular versions

eggsyntax23:12:06

My worry is that if someone then adds MathBox2, no one will ever run across mine — which is fine by me, but they’re different enough that some folks may prefer the first version, which is simpler. They’re quite different.

martinklepsch23:12:02

@eggsyntax: old releases will always remain available via clojars

martinklepsch23:12:25

@eggsyntax: if there is a real need we can do it as we did with jquery

eggsyntax23:12:24

How’s that? I just see the one jquery (along with a couple of specific things like jquery-daterange-picker).

martinklepsch23:12:18

@eggsyntax: check its readme/build.boot

eggsyntax23:12:41

@martinklepsch: Ah, gotcha, the v1/v2 stuff. OK, cool, that answers my worries. Thanks!