Fork me on GitHub
#reagent
<
2018-07-12
>
smnplk05:07:44

Hi. Is it ok to have many reagent cursors pointing to the same ratom from many different namespaces, or do you just define cursors in the same namespace as the big state ratom and just require them where needed.

smnplk05:07:26

What I usually do is if i have deeply nested state ratom and I need a cursor, because they are so handy, and I need it only in one namespace, I just define it in that namespace. But if I need it in many different namespaces, then I just put it in the state namespace. Anyhow, maybe Im just being too pedantic about it 🙂

pesterhazy07:07:04

Nothing wrong with multiple cursors

smnplk07:07:40

@pesterhazy thanks 🙂

Hukka15:07:13

material-ui docs recommend doing the switch piecemeal, by importing both the old and new lib side by side. Is there any way to use two different versions of a lib in clojurescript? Namely, the cljsjs-material-ui's v0 and v1 versions

Hukka15:07:57

And [cljs-react-material-ui.reagent :as ui] before I started the migration

justinlee15:07:36

sorry are you using the normal compiler and importing each library with a :foreign-libs declaration, or are you using shadow-cljs

Hukka15:07:56

I'm using the cljsjs package, which uses :foreign-libs

justinlee15:07:58

sorry you said that I just didn’t read carefully. I actually don’t know how that works. I imagine you should just be able to specify both in your :dependencies vector but I haven’t tried

justinlee15:07:49

hm no you can’t do that can you because they will clash

Hukka15:07:53

Hm. Ok, I might try that. They do declare a different namespace now, so as long as lein will install both versions...

justinlee15:07:53

sorry i shouldn’t have jumped in on this issue because I really haven’t thought very carefully how the clojars thing works

Hukka15:07:50

So I guess they will clash

Hukka15:07:07

The new one provides only the "material-ui" without the cljsjs prefix

Hukka15:07:52

Fortunately this codebase doesn't have that many places to touch. But in bigger projects this would be a headache

juhoteperi16:07:52

@tomi.hukkalainen_slac v0 and v1 use both same artifact-id so they can't be present in single project

juhoteperi16:07:03

that is, cljsjs/material-ui

juhoteperi16:07:28

> Is there any way to use two different versions of a lib in clojurescript?

juhoteperi16:07:38

We could release the v1 on another artifact-id (and remove duplicate provides) and then it would be possible have both

juhoteperi16:07:45

But with foreign-libs that would mean that complete JS is loaded for both versions, output would be huge. Normally when mui is used with JS projects, they use webpack or such to remove unused code.