Fork me on GitHub

hmmm... multiple class loaders... my project has a dockerfile that our CI uses for building which I wasn't using... next time I might try using it; it should be a cleaner environment...


Yeah, emit-constant dispatches on class in JVM ClojureScript, so you’d have to suspect multiple classloaders if there is somehow more than one JSValue class.

👍 4

I am looking for a way to use both Clojure and ClojureScript for a project. The goal is essentially to manipulate files at the OS level (using Clojure) and display the data in the browser (leveraging ClojureScript). Are there any frameworks/libraries/tools to run both Clojure and ClojureScript side-by-side? As far as I know, when using ClojureScript the result will only be JavaScript and not Clojure + JavaScript.


@zakora_clojurians sounds like you're trying to get the browser to communicate with a http server? So the obvious answer is that you write a http api in clojure, and call it from clojurescript. You can use cljc files to share logic in cljs & clj.


@dominicm I'll have a look at cljc files, thanks!


I was wondering if there were idiomatic ways to do this, but it might be a use case not very common.


I don't fully understand what you're asking. We use cljc a lot for some kinds of logic though. It's all dependent.


@dominicm Yeah sorry, I see that my question is not clear. I guess I expected something like "This tool X provides an interface/protocol between Clojure and ClojureScript, so you can write code in Clojure to manage files, then use the X protocol to send data to ClojureScript, which in turns will use the X interface to parse the data; the X tool abstracts over WebSocket to do communication, it also provides a wrapper so you run a single command that will launch your Clojure app, your ClojureScript app and also setup the web server for them to communicate."


Not sure if what I am asking is more clear now :face_with_rolling_eyes:

dominicm08:07:49 something like this might help with that.


I will look into it, thanks!


@zakora_clojurians, you can also write the server component in clojurescript and run it on node, consider


Looks interesting, thanks


can anyone point me towards a primer on how to include static files for reagent/reframe projects? basically I have a [:img {:src <what goes here and where should I put the file>}] problem


@idiomancy if you're using a re-frame template project, there is a resources/public/... directory


that directory is considered the "web root". so a file @ resources/public/image.png would be referenced as :src "/image.png"


okay, awesome, thanks. That's exactly what I needed 🙂


@au-phiware A patch now exists in, which may help in sorting out which bit of code of yours is throwing under boot. Instructions on how to apply a patch like this are in


@zakora_clojurians If you look at some lower-level, older schemes for getting up-and-running with you CLJS, you'll see that all the CLJS build stuff sits on top of a clojure API. Check out the .clj files here, for instance:

🙂 4

So, technically speaking, the backend of any CLJS repl is actually running in Clojure already. You just want that brepl process to be running in the process of the Clojure server. So you could follow the mies template structure to get your self going down that road. There's probably already ring handler that does all that though.


... if I understand your question correctly


I have a clj server with a cljs client where I share some specs. Some of the specs include uuid?. Client/Server speak transit. I was surprised when a spec validation failed on the client for data that I would expect to be valid. It also validated on the server without problem. Looking a bit deeper I found that the cljs transit reader return a transit/UUID (as documented) not a cljs.core/UUID. The transit/UUID do not validate with uuid?, therefor my validation fails. On the server side the clj reader return a java.util.UUID which passes the uuid? test. Can anyone give any hints on: 1. What is the rational for cljs transit to not return a cljs.core/UUID? 2. Is there any reasonable workaround? Maybe make my own validation spec instead of uuid??


I ran into this, too. If I remember correctly, it's because transit-cljs was released before uuid was a native cljs type. To fix, just include the line

(extend-type com.cognitect.transit.types/UUID


Will try, thx!


Thanks for the info! The extend-type workaround solved my problem. +1 for adding it to transit since it is quite a surprise that it do not work out of the box


The user ns shouldn’t be relevant given the profiles active. I’m not sure why it tries to find it. It also still is a successful build


do you have a user file? in /dev?


To anyone interested in Firebase, I’ve created a small template for Reagent / Re-frame / Firebase / Material UI


@UA7P1BSJJ What's your opinion on firestore?


wrt integrating with CLJS? Have you worked with it?


I would love to work with it, but as I find a few issues within’ beta state of firebase functions (like you cannot change the region just yet), I don’t want to dive into another beta programme


But if your app is not going into production, then I would say sure, go for it — that’s the future of Firebase.

👍 4

@mikerod and are you using a more recent version of CLJS? The only thing I recall changing WTR user is this:


@john I do have a dev/user.clj, but it isn’t in the :source-paths or :resource-paths when running this (intentionally)


also only applies to REPLs


I don’t see how that change would impact builds


I’m not sure why lein-cljsbuild would be looking for it. I don’t have a minimum repro or anything though, so just seeing if anyone recognizes the error enough for any pointers


using [org.clojure/clojurescript "1.10.312"]


Ok, unrelated question: Google closure externs - I find it hard to find much documentation about the rules to how to write/read them. The example is really basic and doesn’t show more cases. I look at examples that are more intricate like, as an example Which is Node.prototype.nodeName; - Does it the actual need the class name given, Node, or could it just be Object.prototype.nodeName;? Would doing something like Object.prototype.nodeName cover anything referred to as nodeName or is there some sort of type inference in play that makes Node more restricted to only apply to things found to be a Node? In general, it’d be nice to gather some more understanding of how these externs are interpreted.


As of now, the only method I know is to go read some of the closure code to find out (which may be on the agenda).


that’s right


Object is less specific than Node


there’s really not much else to it


you can put as little information as you like in an externs file


the more stuff you put like @constructor, @param, @returns etc. mean Closure will do more checking

dnolen22:07:57; is fine

dnolen22:07:08 = function() {} is more informative etc.


Yeah, I knew that closure had more it can do with the annotations and such. Just never knew what parts were “necessary” to avoid the name munging vs other things.