Fork me on GitHub
#clojurescript
<
2018-10-10
>
mfikes00:10:56

@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 https://github.com/RickMoynihan/lein-tools-deps

mfikes00:10:23

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

Sal01:10:18

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?

justinlee02:10:33

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 om.next (and fulcro) are more ambitious efforts to integrate data fetching in a declarative way.

👍 4
🙏 4
ska07:10:33

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
pesterhazy08:10:20

@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

justinlee16:10:01

one day.. 🙂

Majid12:10:49

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.

yogthos14:10:21

I'm trying to use https://www.npmjs.com/package/react-sortable-tree 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

yogthos14:10:38

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

thheller14:10:33

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

yogthos14:10:26

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

pesterhazy14:10:48

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

pesterhazy15:10:11

the doublebundle technique works with lein cljsbuild too of course

joelsanchez15:10:56

@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

yogthos15:10:10

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

mfikes16:10:55

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

yogthos16:10:07

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

mfikes16:10:40

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

mfikes16:10:39

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

bhauman16:10:09

works well and I’ve had great luck with figwheel-main and its support for npm https://figwheel.org/docs/npm.html

bhauman16:10:01

having granular control over what’s going is really nice

yogthos16:10:33

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