This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-03-03
Channels
- # beginners (37)
- # boot (5)
- # cider (3)
- # clara (19)
- # cljs-dev (188)
- # cljsrn (1)
- # clojure (104)
- # clojure-russia (5)
- # clojure-spec (1)
- # clojure-uk (3)
- # clojurescript (41)
- # core-async (1)
- # data-science (4)
- # datascript (3)
- # figwheel (7)
- # fulcro (14)
- # garden (4)
- # graphql (3)
- # jobs-discuss (2)
- # leiningen (9)
- # london-clojurians (1)
- # off-topic (5)
- # onyx (2)
- # portkey (6)
- # re-frame (9)
- # reagent (5)
- # shadow-cljs (2)
- # specter (1)
- # uncomplicate (2)
@leontalbot server side it more or less just works
all the challenges are client side where we want stuff to pass through Closure Compiler
Thanks!
FYI: I'm planning to create a new release of Doo. If somebody has some work pending that they'd really like to get in, let me know. https://github.com/bensu/doo/issues/169
Hmm. Looking through all the configuration libraries out there (including one I've written myself) and it seems there is no solution for compile-time configuration. I'd like to implement static resource versioning (e.g. store CSS/JS resources under a directory that contains say the latest git short ref in the name: "/static-522af908/css/styles.css"). This is proving rather difficult, as I use server-side rendering: I'd like to know the ref at compile time for my cljc code.
It's something lein-git-version solves for server-side code (generates an EDN file with git information), but this isn't usable at compile-time.
I was trying a cljsjs library (this one to be precise https://clojars.org/cljsjs/react-select)
and in theory I only have to add it to dependencies and it should work in my Clojurescript REPL right?
I get this error however
cljs.user> (require '[cljsjs.react-select])
#object[Error Error: goog.require could not find: cljsjs.react_select]
figwheel$client$file_reloading$figwheel_require (jar:file:/home/andrea/.m2/repository/figwheel/figwheel/0.5.14/figwheel-0.5.14.jar!/figwheel/client/file_reloading.cljs:179:30)
nil
I tried with the cljsjs d3
and that one works fine, so I don't think it's my project
I've never seen a working ClojureScript REPL, but in principle, you add to dependencies, require, and you should be fine. I've actually just added react-select to my project.
mm yeah no it doesn't work for me strangely
so this works for you @jrychter?
(ns your.namespace
(:require [cljsjs.react-select]))
mm wait wat now it works
I also tried to use it via :npm-deps
, but that, like a working ClojureScript REPL and code splitting across modules, is another unicorn that I'm unable to actually touch.
and actually I think cljs repl works great with figwheel, you should just control it via user.clj (which is how one should do development envs anyway in my opinion)
and yes I did a restart (but maybe not a clean)
don't really know what I was doing wrong now it magically works 😕
guessing you were missing a clean and now when you recompiled it ended up added to the appropriate paths
yes well I added D3 after this library and D3 worked before this one
now I just have to understand how to use it from Clojurescript though, there is no autocompletion for these libraries right?
do I just have to look at the JS docs and translate accordingly? Any examples someone have handy?
ah cool, I also have to fit it into Re-frame somehow
I use it with Rum. Oh, you will need to write functions that convert the (strange) format of the data values that they use to ClojureScript and back. Options are JavaScript objects with value
and label
properties.
yeah I was trying
(js/React.createElement
js/Select
(clj->js [{:value 1, :label 2}
{:value 2, :label 3}]))
but it doesn't like it
No, that will work, but please look at the docs. Choices are passed as the :options
argument.
@jiyinyiyong the Quick Start is going to change dramatically for the better (it will be very, very short), we’re not going to mention other tools there, it will be clj
based
@andrea.crotti If you’re still looking at getting d3
and cljs playing well together, perhaps you will find https://github.com/gadfly361/rid3 to be useful