Fork me on GitHub

I'm looking for a cljs lib/function that turns html in text into a hiccup structure, and I can't seem to find anything. Any suggestions?


re-html-template also has that, but it is clj side functionality


can be used as macro in cljs, but not runtime


... found this page I'll try the options listed there


Can anyone confirm this exception please? When using clojurescript 1.10.914 and shadow-cljs 2.16.12 the following exception gets thrown at multiple places in :

TypeError: Cannot read properties of undefined (reading 'get')
This happens in instant.cljs:2:11, day_of_week.cljs:2:16, etc.. so basically everytime goog.object/get is called somewhere. I'm using a transitive dependency


It's pulled in by fulcro-rad, which has the exact same deps I just updated to: So something weird must be going on here


Some libraries might still be using goog.object without requiring it, relying on it implicitly being there. A recent version of CLJS has removed that, but there's a flag to restore that feature if you need it:


Also, just in case - don't specify CLJS version when using shadow-cljs. Instead, use the version that shadow-cljs provides - this way, you'll avoid potential conflicts which can be rather hard if not impossible to circumvent.


Thank you 🙂, this is indeed the issue! Adding :global-goog-object&array true to the shadow-cljs compiler options fixes it. So it's a bug in introduced by clojurescript:1.10.914. For others finding this later, here are some additional links: •

👍 1

I think you must be pulling in an older version bc was released to address this issue ( goog.object is explicitly required)


huh, fair enough. sorry for the confusion. I just realized it's even stated in the commit message of fulcro here: Maybe something else is overriding this with an older version, I'll check the dependency tree


no worries. probably the first time cljs upgrade causes such issues. and hopefully last


well, you were totally right. even though the latest fulcro-rad pulls in cljc-java-time 0.1.18 it doesn't end up in my classpath. so the old version is still there. Guess I try to wipe the .m2 cache and see if that makes a difference


Better yet, inspect a proper dependency tree and see what overrides the dependency. If you're using deps.edn, you can use clj with -Stree or, if that doesn't give enough details, with -Strace and check the resulting trace.edn. Also, clj has its own cache - it's more likely to blame than ~/.m2, unless someone replaced some artifact without changing the version or you yourself put something in .m2, maybe via some tool.


Yeah, I'm on it, .m2 wasn't to blame. I see in my trace.edn the same thing as in the picture above, the latest fulcro-rad pulls in the wrong/old java-time for some reason. So .cpcache in my project is my next target. Thanks for your help guys, this is getting weird


I think it's an issue with fulcro-rad. Compare this line: to this line: In other words, they didn't regenerate their pom.xml after changing deps.edn. Feel free to submit an issue to their repo. :)


well, deleting .cpcache didn't do anything as well. So i guess the issue is somewhere else


Ah damn, i didn't notice @U2FRKM4TW, that must be it!


(I assume that pom.xml takes precedence over deps.edn when you use tools.deps - I don't actually know that for sure)


Finally! Updating the pom.xml in a local fork of fulcro-rad fixed it. Now the correct version is pulled in. So yes, the pom.xml takes precedence over a deps.edn . (I just found it mentioned here for Local jar attributes: What a journey, I learned a lot today


As a guess - if you use git coords, perhaps the pom file is not used. Unless fulcro-rad has some necessary build process, you could try that instead of having to use a local fork.


I made a small PR with the updated pom and it's already released :) But I'll try the git cords, cause now I'm curious! Thanks again for your help, and sorry again to @U051B9FU1 for jumping to conclusions at first

🎉 1

hey no worries. glad you got it sorted


Hi! We are using lambdaisland/fetch ( to send HTTP Requests from a React Native App. We have custom Transit Handlers for some formats, but if I read the code correctly, there is no way of adding them to the cljs lib, is there?

(def transit-json-writer
  (delay (transit/writer :json)))
imho the custom handlers would be passed as the second parameter to transit/writer. Can you think of any workaround, or a different CLJS library that uses js/fetch as a HTTP client?

oxalorg (Mitesh)12:02:54

IIRC all option you pass to the request will be passed along to transit/writer

🙌 1
oxalorg (Mitesh)12:02:22

Try doing that, it should mostly work!

oxalorg (Mitesh)12:02:13

If not, please create an issue and I'll be happ y to look into it 🙂


That was quick 🙂 We will try that, thanks!


From looking at the code, I get that if in the opts there is no value for the key `:transit-json-writer `, it uses the default writer I linked, else you can provide your own. Still validating, but looking good, thanks again!

💯 1
oxalorg (Mitesh)12:02:37

Yeah just checked the code, to be more precise: pass in your custom transit-json-writer in the request body like a key :transit-json-writer (t/writer :json {:handlers....}

👍 1
oxalorg (Mitesh)12:02:18

I'll add it to the docs thanks!

👍 1

Awesome 🙂

Alex Miller (Clojure team)14:02:17

fyi, there is now a #transit channel ...

👍 2

Already joined 😉


Btw. Your solution worked for us Mitesh like a charm. After some fixes and learning on our side. Thanks ✌️:skin-tone-3:

💚 1
oxalorg (Mitesh)20:02:18

Glad to hear that! bowtie nyantocat

fogus (Clojure Team)14:02:00

If I want to point someone to an online CLJS REPL, is the one that I should point to?


I would look for a more recent one. That one uses a quite old version of CLJS:

cljs.user=> *clojurescript-version*


With that being said, I couldn't really find one...


Actually, if you aren't in a hurry, I might deploy one soon, assuming the process isn't too rough.


I've used this one: (It is on version "1.10.520")


I guess that isn't a REPL though


Oh, it uses 1.10.520. Neat, thanks!


This is a REPL that runs interpreted CLJS via SCI: So not the official one, hopefully still cool. Just updated to the latest shadow release.

👍 1

Just published a self-hosted ClojureScript 1.10.914 REPL at by updating the dependencies of and changing a few things there. My first attempt at self-hosted CLJS, so please do tell if something doesn't work.

👍 7
🎉 9
Drew Verlee17:02:09

how would you add a feature that required routing that was only known at runtime? That is, when the browser loads, the server is going to need to inform the browser client of some set of routes? I assume this means making the routing state full through the use of an atom and then updating it. Does it make sense to store that state in something like a reagent atom? In the re-frame database? What have people done in the past?


Two ways: • Request the routes with AJAX • Embed the routes in a static resource that you serve - I usually use some <meta> or <script type="text/transit+json"> in my index.html for that, which I later read in CLJS code Regarding where to store it - unless the routes change after you have set them up, I don't think you need to store them. Just get them and set them up like you do it usually.

👀 1

Are there any ready made components that visualize clojure data structures, allow to filter them, fold/unfold and etc.?


I would look at how other projects do it, like djblue/portal, re-frisk, cjls-devtools, re-frame-10x,...


@U2FRKM4TW thank you, portal looks great

👍 1

Is there an obvious reason for why things like defn, def, fn are not available in a self-hosted CLJS?


cljs.core analyzer data not loaded?


Is that the one in core.cljs.cache.aot.json? Should be loaded, let me check.


There's data that looks like this.


And the original data in the core.cljs.cache.aot.edn doesn't have a mention of defn.


To give more details - I'm trying to port the code of to a modern version of ClojureScript. Originally, it uses Boot with some ancient plugins, so I decided to also migrate it to shadow-cljs. Given that the REPL there is the source of CLJS code, it sounds like a :target :bootstrap build is not needed. And everything seems to be buildable with just :target :browser.


what gave you that impression? :target :bootstrap AND :browser are both most definitely needed


Yeah, I think I misunderstood that article... Do you have any clue how the original code at works at all then? It just extracts the core.cljs.cache.aot.edn from the CLJS jar and loads it via cljs/load-analysis-cache! in the browser. And yet stuff like defn works.


Alright, the method you describe in the article worked immediately, thanks. :) Still wonder why their original code works though... Maybe things were different in the age of CLJS 1.8.40.


things are different in plain cljs yes. but it inlines cljs.core analyzer data as code which makes it about 2x larger and slower to load


plus :bootstrap solves the issue of pre-compiling other namespaces as well. and providing the ability to access react and stuff


Actually, it doesn't inline it! It loads it via XHR. Having other namespaces does sound useful.


Just published a self-hosted ClojureScript 1.10.914 REPL at by updating the dependencies of and changing a few things there. My first attempt at self-hosted CLJS, so please do tell if something doesn't work.

👍 7
🎉 9