This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-25
Channels
- # announcements (4)
- # babashka (3)
- # beginners (79)
- # biff (4)
- # calva (17)
- # cider (18)
- # clj-kondo (21)
- # cljdoc (45)
- # cljs-dev (14)
- # cljsrn (9)
- # clojure (90)
- # clojure-europe (86)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-portugal (1)
- # clojure-uk (9)
- # clojurescript (20)
- # code-reviews (23)
- # conjure (14)
- # cursive (12)
- # datascript (12)
- # emacs (5)
- # events (2)
- # fulcro (13)
- # gratitude (1)
- # holy-lambda (9)
- # lambdaisland (2)
- # malli (6)
- # nbb (1)
- # nextjournal (2)
- # nrepl (30)
- # off-topic (63)
- # pathom (1)
- # portal (24)
- # reagent (5)
- # reitit (13)
- # releases (2)
- # remote-jobs (1)
- # sci (90)
- # shadow-cljs (52)
- # spacemacs (5)
- # sql (13)
- # testing (20)
- # tools-build (17)
- # xtdb (27)
Cross post from #beginners https://clojurians.slack.com/archives/C053AK3F9/p1650802840149179
If you prefer to stay as close to React as possible, then there's https://github.com/lilactown/helix
If you prefer to have a higher level abstraction, then there's https://github.com/reagent-project/reagent
Don't know about the former as I don't use it, but the latter has a lot of examples that cover pretty much 100% of all use cases, including using stateful React libraries like tldraw
.
Does anyone know of a way to embed compiled cljs directly into an html file? I'm looking for a way to create a single-file html report that could be viewed offline. Is it possible to do this with figwheel-main?
Just your regular <script>
tag. Not sure about figwheel-main but you can do it with some CLJ script that uses e.g. Selmer or some Hiccup library.
Hmmm ok, thanks. I was hoping there might be some tooling to automate the process or something. I might have to do a bit of experimentation. I wonder if I just take the .js file that figwheel-main spits out and paste it into a <script>
tag, if that will work.
That should work. Because that's pretty much what <script>
with a URL does, except that the browser loads that URL first.
Right, ok. I'm a bit surprised this doesn't seem to be a common use-case but maybe I'm using the wrong search terms or looking in the wrong places.
Probably not what you are looking for but there is also https://github.com/babashka/scittle.
cljs on node.js noob question: Does anyone know of an example that TCP connects at ip-address/port, writes a string, reads all available data for a specified period of time, disconnects, and prints all of the data that was read?
The net module in the Nodejs std lib can do this. Would be a good example to get used to JS interop :)
I'm really struggling (e.g., Days of research) to understand how to write a node.js application. I've been doing Clojure/JVM for years with core.async, but I can't seem to get anything to work on CLJS/Node. My main program just terminates, and nothing runs the way I expect it to. I believe I'm missing some, hopefully simple, concept, and/or bit of code, that will lead me to an Ah Ha moment. Any thoughts?
Ok the way I would approach this would be to first write (copy from an example/tutorial) the Nodejs code. And then I would try to translate it step by step with CLJS interop. That’s how I learned CLJS interop, comming from JS.
Here is a simple TCP client example: https://www.hacksparrow.com/nodejs/tcp-socket-programming-in-node-js.html
There is also often a listen
/ run
or similar method on Nodejs that you have to call in order to actually await on messages.
And this is really useful as a cheat sheet for JS interop: https://lwhorton.github.io/2018/10/20/clojurescript-interop-with-javascript.html