This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-10-09
Channels
- # admin-announcements (9)
- # boot (114)
- # cider (15)
- # cljs-dev (10)
- # clojure (35)
- # clojure-boston (5)
- # clojure-dev (39)
- # clojure-greece (1)
- # clojure-japan (10)
- # clojure-nl (3)
- # clojure-poland (2)
- # clojure-russia (10)
- # clojure-sg (8)
- # clojure-switzerland (1)
- # clojure-uk (34)
- # clojurescript (76)
- # clojurescript-ios (3)
- # clojurewerkz (1)
- # clojurex (9)
- # cursive (3)
- # datomic (1)
- # devcards (137)
- # emacs (5)
- # events (1)
- # hoplon (99)
- # jobs (1)
- # ldnclj (50)
- # off-topic (1)
- # om (3)
- # onyx (10)
- # re-frame (4)
- # reagent (1)
- # ring-swagger (15)
- # yada (35)
Anyone interested in inline-css styling? We’ve been working on a project that’s meant to replace sass/less with cljs, and I’m pushing my company to let us open-source it, as it’s really limited right now and we’re probably suffering from tunnel vision. But here’s the general direction: https://gist.github.com/wildermuthn/178dee2896a833e7c362
defdiv
first constructs a map of css styles with garden + cljs functions, then uses goog.style to add a generated classname, then returns a keyword for use in reagent, like :div.modal-header
.
I'm really just looking for enlive style css templating
with no ties to reagent, react, what have you
@wildermuthn: super interested in that, I've been using both garden and reagent and want to start moving a lot of my css to inline.
That does look pretty useful
@wildermuthn: looks interesting. My feedback would be, try to offer an API that can be used from any DOM templating API (React or not) and then on top of that build specific variants (Hiccup, Enlive, etc.)
@redbeardymcgee, that makes sense to avoid coupling to reagent. The functions could be modified to return the generated class as a string, but I’m not familiar enough with Om to know if that would be useful.
@bensu: thanks! I’ve used Enlive for scraping, and you’re the second person to mention it. I’ll check it out.
has anyone tried to use the figwheel component as described here: https://github.com/bhauman/lein-figwheel#scripting-with-component ?
if I start the cljs-repl
within the REPL that started the server it shows this: cljs.user=> DEBUG: unknown status need-input
Sorry man this is frustrating, I spent a lot of time writing and clarifying this. Please see the docs in the readme above about editor REPLs.
No problem this is impossible. Already gotten 3 other folks asking same question. I'm going to clarify it further.
didn't see that section, only looked at https://github.com/bhauman/lein-figwheel/wiki/Running-figwheel-in-a-Cursive-Clojure-REPL but couldn't connect that to the component based setup
@gerrit you could replace the script in that tutorial with the component script in the readme
alright, thanks. what I am trying to get to work is a bit different setup though. I want to start figwheel inside the user.clj
, so I can (go)
and (reset)
everything together
@bhauman: great, using piggieback it connects just fine. the only thing that is weird is that it prints this after each form: DEBUG: unknown response keys :printed-value
@gerrit: I had that problem recently too. For me it was a problem with leftover cider-nrepl in my lein profile.
@shaun-mahood: thanks for the hint, I'll have a look
can any of you folks tell me what I need to set to print stuff out in the CLJS repl using Cider? I’m seeing this and I’m stumped:
org.mozilla.javascript.EcmaError: ReferenceError: "console" is not defined. (rhino.clj#40)
@dnolen: thinking about making it so that figwheel doesn't respond to clj
changes in cljc files https://github.com/bhauman/lein-figwheel/issues/255
@bhauman: no opinions about that, to be honest I don’t really understand what Figwheel guarantees wrt. reloading, probably should be written up somewhere
@bensu: a) make macro reloading optional b) have figwheel treat cljc files like cljs files c) ignore it and go eat some ice cream
@dnolen @bensu I'm thinking a good knob would be to allow folks to specify a build function
dnolen: yeah, that seems to be what that error is saying…but how do I print something out in cider w/the cljs repl?
(if you know)
@ddellacosta: this is Rhino stuff, I believe ‘js/print’ or Java printing should work, you need to set *print-fn*
to something reasonable for the Rhino environment
okay, I’ll start with that and see what I figure out—thanks @dnolen
Hi all, got a clojurescript build-tooling question. I'm using lein cljsbuild to build my cljs files, and I'd like to set it up so that the basic index.html that serves my (static SPA-style) app includes the version number from project.clj.
...which I will then use to display to the user and as a cache-busting parameter, eg <script src="app.js?${VERSION}"></script>
Anyone doing something like this already? I'm hoping there's a better option than just running sed over my files after the build
@timgilbert: the best solution I found was sed before the build which is used by the compiler itself: https://github.com/clojure/clojurescript/blob/master/script/build#L36
Hmm, was hoping to avoid a shell script, but that does make sense
the one thing I ended up doing differently was writing to an almost empty namespace (`app.version`) and not tracking it with git
@timgilbert: If you also have Clojure backend, you could easily generate the index.html from Clojure using hiccup or such, then it's easy to generate script url
Yeah, for this app I'm serving from s3, so no server
I do have a deployment step (on circleci) so I can sed the file there without having to muddy the git waters
But I was hoping there would be something that would just get my version out of project.clj without me having to grep it out or something
there was a lein plugin somewhere but for some reason I chose not to use it. I wish I could be more helpful
@timgilbert: do you think is a job suitable for environ
in cljs?
I've used environ on the clj side before, but for some reason every time I tried to use it from cljs it made my head hurt
Thanks, though @bensu, hearing that other people have looked for a solution and not found one actually is helpful
I've never succeeded either with environ + cljs, that's why I ask. It might be time to get that working and solve problems like yours
I've used environ from cljs with no issues, except from the fact that you have to be careful to use it from clojure macros only (can't call it directly from cljs code because the environment is not available when in js runtime) which are then called from cljs. Did you have any other issue?
But now I see you want to grab the version from project.clj
... that's not something where environ
could help
@timgilbert: I’ve seen some boot tasks that help with fingerprinting assets not sure if that’s an option for you
timgilbert, for another option—depends on how you’re serving the HTML, but—we are using enlive to append a cache-buster to the script src which we identify with specific classes.
I think for now I will probably just go with a simplistic shell script. Thanks for the suggestions everyone. This does seem like the kind of thing boot would be good at, but I don't have time to rewrite that stuff at the moment.
yep, that’s pretty reasonable I think.
I think longer term I might look into a lein task that would use enlive as you suggest, @ddellacosta, assuming I don't rewrite everything in boot
@timgilbert yeah to be clear we are not exactly serving static pages, so it makes sense for us
but if you want to pre-compile your HTML then a boot-based/scripted solution may make more sense (although I suppose enlive could still help there)
does anyone know if :closure-defines
should work with :optimizations :whitespace
? http://dev.clojure.org/jira/browse/CLJS-1389 seems to imply that that should work now, but I can’t seem to get it working
it works with :optimizations :none
but only if a :main
is specified
@cvermilion: Yes, should be working with :whitespace
. Have a look at @martinklepsch’s blog post for more information: http://www.martinklepsch.org/posts/parameterizing-clojurescript-builds.html