This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-04-29
Channels
- # announcements (4)
- # architecture (1)
- # beginners (113)
- # boot (17)
- # calva (40)
- # cider (9)
- # clara (1)
- # cljs-dev (21)
- # cljsrn (21)
- # clojure (47)
- # clojure-dev (8)
- # clojure-europe (2)
- # clojure-italy (46)
- # clojure-nl (10)
- # clojure-spec (1)
- # clojure-turkiye (1)
- # clojure-uk (46)
- # clojurescript (102)
- # core-async (21)
- # cursive (35)
- # data-science (1)
- # datomic (7)
- # emacs (2)
- # graphql (1)
- # lumo (15)
- # nrepl (4)
- # nyc (1)
- # off-topic (5)
- # overtone (3)
- # pathom (10)
- # quil (6)
- # re-frame (30)
- # reagent (7)
- # reitit (33)
- # rewrite-clj (1)
- # shadow-cljs (37)
- # spacemacs (73)
- # test-check (3)
- # testing (2)
- # vim (59)
I’m in similar situation as you, coming from js spa world. My personal bet is on fulcro (http://fulcro.fulcrologic.com/). It’s a fullstack framework that js have been missing since meteor.js but without its compromises and locking you to mongodb. Fulcro solves all the mess with state-management/data normalisation that redux/graphql try to deal with but without much of its boilerplate complexity because it’s fullstack in clojure. I’m only starting with it so I don’t know how it works in practice and you could probably hack something similar using reframe, but fulcro seems more like a battery-included complete solution.
I recommend taking a look at http://www.luminusweb.net/ which is nothing more that a collection of libraries commonly used in clj(s) world. otherwise, why not just taking a look at reagent and their template? https://github.com/reagent-project/reagent
Otherwise, since you have experience with redux, take a look at re-frame
😄 https://github.com/Day8/re-frame
My familiarity level is about as follows: - familiar with FP concepts - a few years javascript / SPA experience using hacked together FP (i.e redux like stuff and various stream libs) - few years JVM experience, mainly Java and Kotlin - done some very basic Clojure Koans and such
I’ve watched a figwheel demo and it looks very convincing, and vdom diffing + persistent immutable datastructures seems very solid for SPAs
I’ll give this a shot: https://lispcast.com/clojurescript-fast-start/
This is probably the most up-to-date: https://clojurescript.org/guides/quick-start
You will have to get to know the different build tools and make a decision there. Leiningen is good, and works with figwheel. That's what I use. There's also something called shadow-cljs which seems to be getting some attention lately
I'm somewhat of a beginner in CLJS myself, though I'm probably intermediate at Clojure
the CLJS quickstart linked above, I believe, is the most barebones. The goal with that is to help you understand what's really going on without the getting overwhelmed with the build tool
Unfortunately, it probably seems like there's too many tools options at the moment. Clojure(script)'s standard tooling has changed recently, so the surrounding community tooling is also changing
I just noticed the previous thread. Sorry about that
Mornin'! Anyone know which bindings I might be able to set to tell CLJS which file and line offset the code should be evaluated at? So that (def...
meta data is set accordingly. There's things like *file*
in Clojure but I wasn't sure if CLJS had an equivalent.
Clojure lets me do some fun things (https://github.com/Olical/conjure/blob/c6963558db9de92573c4cf13fa50d06be2acd42e/src/conjure/code.clj#L57-L61) but I won't have access to eval in ClojureScript, so it needs to be configured in the current eval environment. Maybe that's impossible, even if I can only set the path to the current file is better than nothing 😄
I have a feeling cljs.analyzer/*cljs-file*
might be the only hook open to me but I'm not sure.
@U38J3881W do you eval a string or a clojure form?
This is a string being sent through a prepl, but we can think of it as any normal REPL eval.
So imagine trying to set the current file in a REPL eval, that's kinda the context I'm working with.
Yup! Hence the lack of self hosting etc. I'm looking for a pretty generic binding which may not exist.
take a look at that fn impl. SourceLoggingPushbackReader.
contructor accepts a line
and column
arg
the reader will attach the proper metadata to the read CLJS forms and that is that the analyzer/compiler uses
Haha, okay, interesting. I'm already using LineNumberingPushbackReader for the Clojure approach. My constraint is that I don't control the prepl / server side so it might not be possible but I'll have a play.
instead of sending "(def x ...)"
over the wire you send "^{:line 123 :column 456} (def x ...)"
Yeah, did consider that sort of thing but would like to avoid it if I can. A binding or something would be ideal, if I can't do it I can't do it. Not a massive deal. I'm trying to touch the contents of the eval and the remote end as little as possible to ensure compatibility with all envs and future setups.
Besides, it'll probably be mainly compiled by figwheel / shadow-cljs anyway, it's Clojure where I needed the line/file data really.
Is there any 2d drawing library that works nicely with reagent? I tried using quill, but I cannot get it to draw anything. Any ideas?
there is a #quil channel if you ever need it
I would recommend p5.js: https://sneakycode.net/minesweeper-in-clojure
very cool! Thanks @U08E8UGF7
See: https://medium.com/front-end-weekly/the-building-of-threadd-react-three-js-p5-js-fc988e687686
I would try anyway, I usually found out I need way less wrappers if I do it myself in cljs 🙂
And reagent would lend itself perfectly to this because of the state management and perhaps a few "normal html" components to add some controls.
Has anyone had luck getting Handsontable to work with advanced compilation via externs? It's on CLJSJS, but the version there is very old.
or
is a macro. It expands into other code. So if you try to do something like this:
(reduce or [false false false true])
You will get that error. This code is trying to treat or
as a function, but it isn't. You can fix this by wrapping it in a function.
(reduce (fn [x y] (or x y)) [false false false true])
I’m seeing it in figwheel so that’s probably the case. The warning is coming from the line (if (or disabled? all-invoiced?) ...)
where disabled?
and all-invoiced?
are booleans, I would think that would be OK.
CLJS (`1.10.439`) should shim process.env.NODE_ENV
, right? I'm setting :closure-defines {process.env/NODE_ENV "development"}
and I see "process.env\/NODE_ENV":"development"
in CLOSURE_UNCOMPILED_DEFINES
in my generated output.
Alas, I'm still seeing React throw up process is not defined
when it checks for process.env.NODE_ENV
. What am I missing?
Hi, I was hoping someone could help me with using react-dropzone
from cljs. My (hyper-simple) code is here: https://github.com/hoopes/dropzone-poc/blob/master/src/main/demo/core.cljs - I'm using shadow-cljs
, and the error I'm getting is
Uncaught TypeError: Cannot convert a Symbol value to a string
at Array.join (<anonymous>)
at Function.cljs$core$IFn$_invoke$arity$1 (cljs.core.js:10144)
at Object.cljs$core$pr_writer_impl [as pr_writer_impl] (cljs.core.js:33441)
at cljs$core$pr_writer (cljs.core.js:33472)
at cljs.core.js:33992
at Object.cljs$core$pr_sequential_writer [as pr_sequential_writer] (cljs.core.js:33163)
at Object.cljs$core$print_prefix_map [as print_prefix_map] (cljs.core.js:33981)
at cljs$core$print_map (cljs.core.js:34002)
at Object.cljs$core$pr_writer_impl [as pr_writer_impl] (cljs.core.js:33371)
at cljs$core$pr_writer (cljs.core.js:33472)
is that a common error? google doesn't seem to know much about it, unless my google fu is just broken
Would anyone know how to deal with a
Java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter
clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: javax.xml.bind.DatatypeConverter, compiling:(org/httpkit/server.clj:1:1)
error? I'm working on the modern-cljs tutorial, and got a bare-bones web app to run, but whenever I try and run (start-repl) to run the boot-cljs-repl, I get that error. I've tried updating Clojure, ClojureScript, Adzerk and other related dependencies to their newest versions, and have tried $ echo $BOOT_JVM_OPTIONS
to add it to the boot.properties file (which I can open or cd into), to add it, along with "--add-modules" "java.xml.bind"
from the CLI. I would add it in the project.clj(s) file, but there isn't one mentioned in the tutorial yet, and I don't want to add it and mess things up more.cljs-http seems to be mangling binary data in the response (e.g. if i’m requesting a jpg). anyone know how i can avoid that, or is there a nice alternative library I can use? (i’m using node via shadow-cljs)
@wiseman there's goog.net.Xhrio that might be easy enough to use depending on what you're doing specifically
most of the cljs http libraries wrap that in some capacity
i’m doing totally basic http. cljs-http just came up at the top of a google search, but i can probably do whatever the popular approach is.
@hoopes did you ever figure that react-dropzone
thing out? I have a cljs project that I was able to use react-dropzone
in with your sample code, but cloning and running your repo I get your error :thinking_face: ;
@hoopes the issue it that you only depend on re-frame but not reagent. re-frame still seems to depend on [reagent "0.7.0"]
which seems to have issues with the newer react stuff
funny enough it tries to tell you that but can't due to the unprintable Symbol instance 😛
Ah so that's why it still fails in react-dom with ...got: object
after adding the [reagent "0.8.1"]
;
I couldn't find any difference between my and @hoopes’s shadow-cljs.edn
and package-lock.json
that was the magic bullet (I had also noticed the lack of reagent dependency and tried to match other dependency versions) so I'd be interested to learn what fixes that issue even though I am not facing it :thinking_face:. Good luck, @hoopes 😬