Fork me on GitHub

@idiomancy If you have a project based on project.clj but you'd also like to use deps.edn, then you can use lein-tools-deps


(Then you can trivially depend on a :local/root or git :sha by just changing deps.edn)


Hey guys I’m trying to build a mental picture/roadmap on the conceptual similarities between some of the common React related libraries and their somewhat equivalent counterparts in cljs. If I understand things correctly, Reagent, Om, and React work in the same space which is essentially the view. To build on top of that and support a more managed/organized global application state, you use something like Redux or in cljs world, Re-frame or Om Next. Furthermore, if you’re looking for a library to help you efficiently (via one network call vs several roundtrip calls) and declaratively manage remote data calls, you would use libraries like Relay or Om Next. Is this description sound about right?


I would say that’s pretty much right. reagent is like react with mobx built in and a thin abstraction layer on top to make the ergonomics of react more lispy. re-frame is like a beefy redux with additional tooling. i think it is fair to say that (and fulcro) are more ambitious efforts to integrate data fetching in a declarative way.

👍 4
🙏 4

Thanks for all the insights delivered at my doorstep this morning. @mfikes I prefer the fn approach over the re-quote-replacement. Much cleaner and more explicit working with a Matcher than magic characters in strings.

👍 4

@lee.justin.m consider blogging about those JS/CLJS homologues - that would be a useful starting point for people getting started with CLJS coming from React


one day.. 🙂


Hi Folks, I just wonder if anyone can guide me to find the best way to add a hash to final javascript bundle name. For instance, at the moment, :cljsbuild configuration has a output-to a single file which is app.js but this is not optimal, I want to add a has or something to differentiate bundle file of each build in order to prevent browser caching. you help and advice is highly appreciate.


I'm trying to use via :npm-deps, and I'm seeing the following error in the console: Uncaught Error: Undefined nameToPath for module$Users$yogthos$src$react_dnd_test$node_modules$react_virtualized$dist$es$ArrowKeyStepper it looks like the path exists node_modules/react-virtualized/dist/es/ArrowKeyStepper/ in the project


has anyone else run into anything similar, is there any workaround for this?


@yogthos yes many people have run into this. the workaround is to use webpack or shadow-cljs


thanks, do you know what the underlying issue is though, and can it be fixed in cljs compiler?


npm-deps just doesn't work for a sizable portion of npm modules


the doublebundle technique works with lein cljsbuild too of course


@yogthos I tried to use that same package some days ago 🙂 I ran into that problem and many others. I switched to shadow-cljs and now I'm happy


awesome thanks, sounds like shadow-cljs is the way to go then


@yogthos Sometimes the issue is in the ClojureScript compiler, sometimes it is in Closure itself, sometimes it is in the library


so sounds like the consensus is that you can try your luck with :npm-deps and if that fails setup shadow-cljs to build js libs using native tooling


Yeah. Another inexpensive thing to try is ClojureScript master and / or later versions of Closure.


(Master is already set up to use the latest Closure, IIRC.)


works well and I’ve had great luck with figwheel-main and its support for npm


having granular control over what’s going is really nice


@bhauman thanks that looks like the easiest approach to integrate with the existing setup