This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-05-26
Channels
- # announcements (2)
- # babashka (55)
- # beginners (107)
- # calva (65)
- # cider (5)
- # clara (4)
- # clj-kondo (17)
- # cljs-dev (38)
- # cljsrn (16)
- # clojure (117)
- # clojure-australia (8)
- # clojure-europe (13)
- # clojure-italy (4)
- # clojure-nl (5)
- # clojure-provo (2)
- # clojure-sweden (9)
- # clojure-taiwan (1)
- # clojure-uk (41)
- # clojurescript (40)
- # code-reviews (1)
- # conjure (40)
- # cursive (4)
- # datomic (11)
- # events (2)
- # fulcro (33)
- # graalvm (1)
- # jobs (2)
- # jobs-discuss (19)
- # lsp (18)
- # off-topic (58)
- # polylith (2)
- # quil (2)
- # react (28)
- # reagent (35)
- # reitit (3)
- # remote-jobs (1)
- # ring (9)
- # sci (76)
- # shadow-cljs (19)
- # sql (10)
- # testing (5)
- # vim (13)
- # xtdb (5)
@thheller Would it be possible to compile an advanced build of reagent and let people provide React using a script tag, so the version of React becomes a choice in the HTML?
npm packages in general don't go through advanced so renaming is generally not an issue (if you have externs of course)
For completeness, I had to configure it like this:
:js-options
{:resolve {"react" {:target :global
:global "React"}
"react-dom" {:target :global
:global "ReactDOM"}}}
You might want to update the example in the bookwhat do I need to update? isn't that the example in the book? :resolve
is purely from shadow, CLJS handles this differently via :foreign-libs
@thheller "react-dom"
. When I left that out, my website got stuck in an infinite loop (since there were still some node modules in the project, things got weird)
hmm, the dev build worked fine with React from a CDN, but still got some problems when compiling with
EDIT: probably some other dev build running in the background, messing things up.release
. Somehow it also re-creates a package.json, etc, while, I think it shouldn't have to?
Hi, I am new in clojurescript world. I was trying to do breakpoint debugging in VSCode with Calva. But could not able to do that. I followed this doc: https://calva.io/debugger/#:~:text=You%20can%20insert%20a%20breakpoint,level%20form%20with%20alt%2Benter%20. Is there any Video instructions available for it?
At the very top of that page: > The debugger currently does not support ClojureScript And there's also the #calva channel here.

is there some simple cljs http library for node? (preferably one that just blocks for me so i don't have to play around with go chans etc)
It's possible when using fibers 😄
(defn <!!
[c]
(let [f js/Fiber.current]
(go
(.run f (<! c)))
(.yield js/Fiber)))
But it's Node.js only and it works terribly bad with channels
Await does not block for you 😮
It's just a syntax sugar for Promises. If you looking for such sugar then check Promesa out.
promesa isn't much different from just calling .then and .catch though (in cljs world)
Do you thing that async/await is in some sort different?
<p! is nice but you must use it in a go block which makes passing things around much more difficult
I'm trying to avoid channels on Clojurescript as much as I can now. It makes the bundle size really huge even for simple operations. Actually promesa is something you seek for: https://cljdoc.org/d/funcool/promesa/6.0.1/api/promesa.core#plet
oh wei that plet really looks amazing. reminds me of manifold's let-flow. thanks, i'll check that out!
It’s really got soft. To full async/await alike flow only try/catch as a macro would be needed. Plet it's even better than pure async/await and with bluebird you can get a really good performance!
httpurr is really nice: https://funcool.github.io/httpurr/latest/ https://github.com/funcool/httpurr/blob/master/src/httpurr/client/node.cljs
If I have a map like (ns quux) (def namespaces {'foo foo/bar})
in my code, is my assumption correct that the map will only contain a reference to the function foo/bar
and Closure will not actually duplicate a copy of that function to the quux
namespace?
I wonder about this since in this report https://borkdude.github.io/scittle/report.html you see that it pulls in about 300kb from cljs.core but also has about 300kb in sci.impl.namespaces
, which is a bit suspicious imo, since sci.impl.namespaces
should mostly contain references to other functions.
you are creating huge amounts of vars with metadata, the actual code probably is only a fraction of that. yes, the maps will only contain references, it won't duplicate the code.