This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-10-18
Channels
- # aws (10)
- # beginners (43)
- # calva (1)
- # cider (7)
- # cljs-dev (83)
- # clojure (132)
- # clojure-dev (20)
- # clojure-europe (6)
- # clojure-greece (4)
- # clojure-italy (2)
- # clojure-nl (6)
- # clojure-spec (21)
- # clojure-sweden (16)
- # clojure-uk (21)
- # clojuredesign-podcast (16)
- # clojurescript (74)
- # cursive (41)
- # datomic (7)
- # emacs (3)
- # fulcro (30)
- # graalvm (3)
- # graphql (2)
- # instaparse (1)
- # jobs (1)
- # joker (13)
- # kaocha (14)
- # off-topic (118)
- # pathom (13)
- # re-frame (5)
- # reagent (22)
- # shadow-cljs (67)
- # spacemacs (7)
- # sydney (1)
- # testing (1)
- # tools-deps (82)
- # vim (4)
- # xtdb (1)
I'm trying to build an app with re-frame and shadow-cljs, but I need a backend server as well. What's the best way to have shadow-cljs running with a ring server running as well on the same url/process?
@donyorm you simply need to serve the files built by shadow-cljs by your backend server. there’s nothing special to do
I wouldn’t try and have the build in the same process as your backend server, as you can end up with dependency conflicts and whatnot that you won’t get when you deploy your app
it’s easy to run shadow-cljs that builds your front-end in one process, and your backend server in another process. your backend can serve up the built JS files and everything will work
^ @donyorm The latter is what I would have recommended. I only suggested the #shadow-cljs channel in case they know of any easy way to run the backend process inside shadow itself...
Hello! Im planning to scrape a website and thought it could be a nice project to learn some clojure. Im just wondering how good of a fit it would be?
hi! i haven’t started yet, but i’m planning to use enlive
and specter
that was suggested. they both seem nice
Would be an excellent fit. Checkout the libraries enlive
and specter
(And JSoup
through Java Interop).
why dividing java.lang.Long
like this (/ number 100)
produces a fraction - I need integer number
is it allowed (and idiomatic) to have namespace segments with -
? for example (ns example.with-dash.package)
ok thanks! in this case my directory is with-dash
, should i avoid such directory names?
You'll have to rename that directory to with_dash
for it to work. I think it's perfectly fine, and you see it all the time when the project name has a dash in it.
ok, but is there a way to have a directory with a dash in it and still represent it in a namespace?
Not that I know of. I imagine it would be very hacky though, as the whole reason we need to use underscores instead is to play nice with Java.
I would like to pass something like {:foo (func arg)
to a macro, manipulate the func
form, then have the value of that as the value of :foo
. I'm getting stuck on how I would achieve this.
I suppose a simpler way to phrase it would be: I want to do (m {:foo (inc 1})
where m
is the macro, and end up with {:foo 2}
. I'm using a macro because I need to do a bit more than that, but this is where I'm stuck.
@auroraminor Where are you getting stuck? Maybe you could post a code snippet in a gist?
Ok, how about this?
(defn update-value
[m x]
(reduce-kv (fn [m k v]
(assoc m k (v x))) ; ??? results in the value of k applied to x
{} m))
=> #'user/update-value
(update-value {:t inc :u dec} 1)
=> {:t 2, :u 0}
You can’t use a macro to work with values, because values won’t be available at macro expansion time. You can only use a macro to rewrite code.
right, there's more to it because what I'm doing is trying to reconstruct parts of xml zippers
thank you @manutter51!
:thumbsup:
hi, wasn't sure which channel is best to ask this in, but it seems likely this is a good start! What's the current state of play for the various webui frameworks? If you were starting a new project tomorrow, which would you use? Did om-next arrive? Is it still reagent, reframe, something else?
You may get an answer here, but I wanted to suggest that the #clojurescript channel is perhaps a more target rich environment for that question.
that is a great idea! thanks!
reagent is the most popular react wrapper in CLJS land. reframe and fulcro are more systemic libraries for SPA development. I'm sure there are lots of other options, but these are main ones (in terms of popularity, and probably maturity too)
I lean towards fulcro for SPA development. But I haven't used either in anger, so take this with a heap of salt.
I use react and re-frame and have ton of fun as well.