This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-04-26
Channels
- # aleph (6)
- # announcements (1)
- # babashka (18)
- # beginners (13)
- # calva (18)
- # cider (5)
- # clojure (144)
- # clojure-europe (34)
- # clojure-nl (1)
- # clojure-norway (29)
- # clojure-uk (4)
- # emacs (9)
- # etaoin (51)
- # events (1)
- # gratitude (1)
- # hyperfiddle (9)
- # lsp (4)
- # off-topic (6)
- # pathom (61)
- # rdf (1)
- # releases (3)
- # shadow-cljs (16)
- # vrac (1)
- # yada (1)
- # yamlscript (3)
Is there a way of using a different naming scheme for classes in shadow-cljs. Because I have a cljc file, I think the class names are different for clojure and clojurescript, which means (I think) that when I try to hydrate something server-side rendered, it barfs. Thoughts?
there is not no. although I do not understand this error? I mean isn't the point of hydration to use the same code?
I mean what you can do is pull the css defition "up" into a let or def, so (def $the-class (css ...))
and in both spots use $the-class
instead of (css ..)
forms?
I was thinking it’s because it’s a cljc file so when I generate the markup in clojure on the server and on the client the class names don’t match because there are conditional cljs lines (e.g. cljs only library requires) , which makes the line number different between both… but I’m not 100% sure that’s it
cljc preserves the location info, so that doesn't change regardless of which branch you are in
ah ok, maybe something got stale, thanks!
Getting this hydration working with SSR without errors is proving difficult
ahahh
what do you do instead? do you do everything on the client?
no, mix of everything. I wrote an entire blog series about it https://code.thheller.com/
oh yes, I forgot about that. Maybe it's time for me to go all in on the thomas heller approach