This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # admin-announcements (296)
- # beginners (19)
- # boot (40)
- # cider (77)
- # clojure (139)
- # clojure-australia (2)
- # clojure-bangladesh (6)
- # clojure-dev (19)
- # clojure-japan (25)
- # clojure-russia (23)
- # clojure-sg (1)
- # clojure-uk (4)
- # clojurescript (131)
- # datomic (41)
- # editors (42)
- # ldnclj (35)
- # off-topic (11)
- # reagent (10)
Has anyone here used MathBox (https://github.com/unconed/MathBox.js/) in cljs? It's gonna be my first shot at bringing in an unwrapped js library, so I'd love to hear other people's experiences (or their thoughts on how this library might be to use in cljs). It's pretty object-oriented, but with a strong focus on method chaining, which seems like it translates fairly nicely into cljs's .. syntax.
@dnolen: Yes. There could be a
cljs.jvm to fulfill needs for that “environment” as well.
cljs.js crossed my mind, but sounded too close to
CLJSJS but—written as a namespace—perhaps avoids the ambiguity that exists verbally.
@dnolen @mfikes cljs.js and cljs.jvm have my vote for expressiveness. I was toying with cljs.birth, cljs.womb, cljs.oven etc.
@dnolen @gigasquid : I re-watched the core.async webinar. A thought I had: I think re-usable bits of clojure education like this could scale. For example, many people could use this material to organize lunch sessions for their colleagues, without having to write a talk etc. themselves.
kind of interesting, now that a good chunk of ClojureScript is also technically written in ClojureScript - that’s 21,000 lines of ClojureScript and only about 4,000 lines of Clojure.
cljs.js for now, I like how it keeps door open for
cljs.jvm in the future if needed.
@dnolen: not sure how familiar you are with clj-refactor, but i’m curious what’s needed to support it’s ns editing capabilities for cljs
@robert-stuttaford: not familiar
i see mention of building an AST for the current clean-ns stuff. i guess the big differences in the ns methodologies between jvm and gclosure necessitates completely fresh code
@magnars? is that right?
Looks to require cider with the nrepl-refactor middleware to boot, which narrows repl options.
@robert-stuttaford: I think the latest version of clean-ns doesn't rely on an AST, since it fails on macros (think
(go (<!))), but only looks at the symbols in the source file.
awesome. i’ll be a good patient programmer, then
@robert-stuttaford: I don’t think bootstrap work really changes things here for clj-refactor. If it uses tools.analyzer the bigger issue is the long outstanding ticket to make the ClojureScript AST conform.
i see lots of clojure.tools.analyzer, so that sounds right
a recent talk on clojurescript + react (reagent): video: http://domcode.org/videos/2015/05/26/clojurescript-and-reactjs/ slides: https://github.com/borkdude/domcode-cljs-react
considering what’s included, that’s nothing!
you can fit two copies on a 720kb stiffy disk
@robert-stuttaford: haha true, but that’s also 15X bigger than where ClojureScript applications start (~20K gzipped)
we have a cljs app that’s bigger than that 😒
haha, right I expect very large CLJS applications with many 3rd party JS bits to be around that size.
we don’t need eval though. i doubt many apps would. unless you’re writing amazeballs ios repls
perfect for things like himera and cljskoans
@dnolen: Is it already possible to try out the amd support in the clojurescript compiler?
@mitchelkuijpers: only if you’re feeling adventurous enough to use master
@dnolen: Then ill just write an externs for now, can't do that for now. have to go in production in 2 months.. 😉
@mitchelkuijpers: yeah the module work is great but I would give it some time. Worth experimenting with on non-critical projects.
@dnolen: Will do, thank you!
What’s the accepted way of converting html to hiccup on the ClojureScript side of things? I’m looking to render some markdown I get from the backend. There’s @yogthos’ madkdown-clj, which gets me from md->html. It’s a reagent application, don’t want to dangerouslySetInnerHtml.
I could just use that on the backend and return a hiccup structure… but that requires my sending a “format” parameter. It’d feel cleaner to just have the conversion happen on the client (if desired).
definline uses eval, so anyone using that (or loading clojure.core which uses definline) implicitly uses it.
Backend path could be going md->html via markdown-clj and then html->hiccup via enlive.
@ricardo: I've not used any of these, but have you looked at these options? https://github.com/weavejester/hiccup/wiki/Converting-html-to-hiccup
in which ns does zipmap belong to ?
it’s in the core
@dnolen: I got closure’s dynamic module loading thing working, and wrote a blog on it: https://rasterize.io/blog/cljs-dynamic-module-loading.html
@robert-stuttaford: ^ dynamic module loading
@arohner: you’re a legend +1 for the wiki page
thanks for the ping, @bhauman !
I’m working on an app using the luminus default setup (w/reagent) and am a little confused by the env profiles… they call init! in the cljs project source (which mounts the components, etc)
am I understanding it correctly that the env code (prod.cljs or dev.cljs) gets added to the compiled app.js blob, and so gets called for every requested page?
It’s not very clear to me yet what on the html page is actually triggering the clojurescript to run.
if there's a top-level form in the namespace that has side-effects, it will be run when the namespace is loaded
if your cljs is all 'pure', then you'll have to write some code in a script tag or elsewhere to mount your reagent components.
oh, duh. that’s actually what’s in the prod.cljs file (which is in the project.app ns) - the top-level form.
oh, nvm… I see, it’s :app in the cljsbuild :builds map. one could presumably declare different apps there, with the tradeoff of everything getting more complicated.
changes.md in cljs mentions Clojure
1.7.0-RC1 as a dependency but it works with
1.7.0 just fine. The reason is ask is I want to create a patch for readme to mention that Clojure is a hard dependency - not everyone looks at release notes and this is often a problem for people new to cljs. They can’t compile the project because of version mismatch and the error doesn’t say anything that would help with that.
@meow: Thanks, I have. They all seem to be clj-side, where I can just use enlive. hiccup-bridge actually uses enlive itself.
@annapawlicka: sounds good to me.
@dnolen: so 1.7.0 is ok?
@arohner @meow I haven’t tried hickory yet, seems to be a cljx so I’ll look into it. Hasn’t been updated in a while, but that might not be an issue. Thanks!
@annapawlicka: people have requested it before and I’ve declined but I suppose enough people lose time on this. If you have time to create a patch for
cljs.closure/build that checks the Clojure version number I’m fine with that too.
@dnolen: sure, I’ll do that later tonight
i can imagine that will make some folks life easier
Boot compalins about
Different CLJS version via transitive dependency: 0.0-2816. Can I resolve this?
@dnolen: that pure ui post describes one reason why I am so excited about the possibility of Devcards or something like it
@petrus: specify Clojurescript as a dependency
@petrus: Probably some of your dependencies has transitive dependency to different clojurescript version as the boot-cljs. You should add direct clojurescript dependency to your project.
thanks! I had to add an explicit cljs dep and add boot.properties to get it to build. However, now after adding
[re-com "0.5.4"] dependency, I'm seeing this beastie:
@petrus: maybe best to take this to #C053K90BR ?
@dnolen: I can’t invoke`cljs.closure/build` as I can’t even do
(require '[cljs.closure :as cc]) on
1.7.0-alpha2. It’s failing to load
cljs.util with this error
IllegalAccessError tried to access method clojure.lang.RT.classForNameNonLoading(Ljava/lang/String;)Ljava/lang/Class; from class cljs.util$loading__5340__auto____5 cljs.util$loading__5340__auto____5.invoke (util.cljc:9) which is basically what I’m seeing when I’m trying to compile sample cljs project. Do you have any other suggestions? It’s a first time I’m looking in these parts of cljs
@annapawlicka: any reason you are trying with alpha2 instead of just 1.7?
@dnolen: i was trying to test using older clojure version and locally built cljs
@annapawlicka: I would try again with 1.7, that error seems bizarre
@dnolen: but how does that help with telling the user they need to use > 1.7 ?
gonna do that now, cheers
@annapawlicka: ah right, hrm yeah I didn’t think that through, you will need to put the check before the
cljs.closure ns form
actually before before, or is there another function that’s being called earlier?
@annapawlicka: it needs to come actually before
@annapawlicka: thinking about this even more there are 5 namespaces which are common entry points where this should probably done
@annapawlicka: let’s make a real issue for this and I will write down some notes
adding the same check all over the place doesn’t sound like a good solution 😉
@annapawlicka: please open a JIRA issue and assign to yourself, I’ll leave a comment on how it should probably be done.
@dnolen: thanks! should i ping you with a link or do you get automatic emails?
any pointers where to look to see why goog.require can’t find my project.app ? this is only lightly-modified from the luminus template.
@dnolen: I’m just a mere human and can’t assign anything to anyone. But here’s the link http://dev.clojure.org/jira/browse/CLJS-1340
@annapawlicka: I have granted you superpowers
@dnolen: thanks, looks pretty straightforward. will probably look into that tomorrow