This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-07-24
Channels
- # announcements (5)
- # beginners (184)
- # calva (32)
- # cider (29)
- # clj-kondo (1)
- # cljdoc (29)
- # cljsrn (6)
- # clojure (44)
- # clojure-dev (36)
- # clojure-europe (9)
- # clojure-italy (18)
- # clojure-losangeles (1)
- # clojure-nl (3)
- # clojure-spec (7)
- # clojure-uk (30)
- # clojure-ukraine (1)
- # clojuredesign-podcast (8)
- # clojurescript (65)
- # code-reviews (21)
- # core-async (25)
- # cursive (51)
- # data-science (3)
- # datascript (2)
- # datomic (25)
- # emacs (14)
- # events (1)
- # figwheel-main (3)
- # fulcro (3)
- # graalvm (5)
- # jackdaw (17)
- # kaocha (14)
- # luminus (5)
- # off-topic (17)
- # pathom (7)
- # pedestal (2)
- # re-frame (71)
- # reagent (25)
- # shadow-cljs (83)
- # spacemacs (31)
- # sql (92)
- # tools-deps (23)
- # vim (102)
- # xtdb (5)
$ plk
ClojureScript 1.10.520
cljs.user=> (defn foo [^js x])
#'cljs.user/foo
cljs.user=> ^js {:a 1}
^
WARNING: Use of undeclared Var cljs.user/js at line 1
{:a 1}
cljs.user=>
This seems a bit inconsistent: CLJS warns about the second, but not the first?@thheller why not? in CLJ:
$ clj
Clojure 1.10.0
user=> ^js {:a 1}
Syntax error compiling at (REPL:0:0).
Unable to resolve symbol: js in this context
in clj
the :tag
meta is actually resolved for compilation. in CLJS it is just a blank hint that is never resolved and always used as is
$ plk
ClojureScript 1.10.520
cljs.user=> (let [js 'foo] ^js {:a 1})
{:a 1}
cljs.user=> (meta *1)
{:tag foo}
so for clj-kondo I'll just turn warnings off in CLJS for type hinted function arguments / local bindings
it is news to me that this evaluated at all since all references I found in the code don't
ah yeah actually its a special case for all the collections that this is actually kept for the JS runtime and not just used by the compiler
@borkdude I think this is just a bug. the :tag
meta should probably be elided like all these https://github.com/clojure/clojurescript/blob/3c7c37b27cb24810b2abb6410aa063b599fe2223/src/main/clojure/cljs/analyzer.cljc#L4017
to me it seems like it should be in that list but it is quite pointless to tag CLJS collections since that overrides the actually correct tag
What's the recommended way to script something with clojurescript? I need to fetch some data, munge it and spit out a csv. Development in the REPL (preferrably via CIDER) and npm interop would be heaven
I think I know why, It seems I deal with how component render its children in a wrong way
Is this the correct way to deal with children in reagent?
(defn foo []
(fn [props & children]
(into [:div {...}
children)))
Is this doable with Clojurescript? https://js13kgames.com/
Would be interested to know if anyone’s submitted to these contests before and what your experience was
@christian.gonzalez I'm not aware of anything - the key thing to make it into that competition would be to use ClojureScript at a low level
Right, that makes sense. Probably end up doing a lot of interop, avoiding deps
though at that point it would probably just make sense to do it in js
@christian.gonzalez yeah that's not a ton of advantage other than macros and Closure advanced compilation integration
http://swannodette.github.io/2013/06/10/porting-notchs-minecraft-demo-to-clojurescript best viewed in Chrome (though could be updated to be made fast everywhere these days), this is 4.1K
oh this is awesome thank you
And if you are curious, I found that David's code can be re-cast without mutation 🙂 https://blog.fikesfarm.com/posts/2014-07-14-nolens-notchs-minecraft-without-locals.html
Hi all, is there a good solid book or online resource for either: a) learning cljs for node dev or b) an honest appraisal of the tradeoffs of using cljs for node apps? Google search pushes lots of shallow references, not in-depth ones. (My context: refactoring GraphQL service—with dependencies on js-only libraries like Apollo —as it's starting to get too big and unwieldy already. Not already experienced with TS so learning curve whatever way I choose to go)
Hi. I don't know of any books or some detailed explanations. There's possibly only one framework I know of (and use): https://macchiato-framework.github.io/ which can be used with reitit routing: https://github.com/metosin/reitit You can see a bit of info about Macchiatto on the author's blog: https://yogthos.net/archives.html There is also small demo app I created if you weren't sure how to put it together: https://github.com/nenadalm/spa-demo
Hi David, ah, okay. I suppose I want a specifically cljs resources that are node-oriented, not react/fe-oriented
well React is a framework and there's some machinery between ClojureScript so you need that type of thing
p.s. I enjoy your talks on code very much, always thought-provoking and compelling, thank you for all your efforts
I was interested to build an interface webui like the Twitter one, where one could get events on top etc
I was thinking at reagent but I don't know if o' the webui design level one call such ui in particular term
How do you do Server Side Rendering for your Single Page App for SEO? Do you have battle tested solution?
in quickstart of clojurescript, is suggested clj
isn't clj
depracted in favor of clojure
?
clojure
is the main script, clj
is a wrapper designed for interactive use (adds readline support)
@darioszr clj
isn't deprecated in favor of clojure
(`clj` is really just a wrapper around clojure
that adds rlwrap
to make it easier to use)
I just play around. Actually currently I was trying a way to Don't install 4000 pkgs like the lein reagent projets does
In idéal case I would like to have a webui with reagent, tomcat as server app, websocket for sync data
Between backend and front-end. Nothing special. The thing I'm trying to figure out is mostly how can do a minimal skeleton with reagent in this env.😁
So before having all ready i want to go the hard way, with the Lein reagent there is to much prepared
@darioszr, Clojure is a hosted language. Clojurescript gives another taste of Clojure. If you really like it on the day one. Wait until it saves the day. Clojure/Clojurescript manage risks very well. So, your organization can do much more with it. --I assume your problem is right for the tool--