This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-12
Channels
- # aleph (1)
- # beginners (81)
- # boot (20)
- # cider (46)
- # cljs-dev (6)
- # cljsjs (6)
- # cljsrn (8)
- # clojars (2)
- # clojure (104)
- # clojure-berlin (3)
- # clojure-italy (4)
- # clojure-losangeles (2)
- # clojure-nl (16)
- # clojure-spec (16)
- # clojure-uk (28)
- # clojurescript (88)
- # core-logic (31)
- # cursive (8)
- # data-science (3)
- # datascript (1)
- # datomic (95)
- # docs (1)
- # emacs (6)
- # figwheel-main (24)
- # fulcro (106)
- # graphql (5)
- # hyperfiddle (2)
- # midje (2)
- # nrepl (1)
- # off-topic (14)
- # om-next (1)
- # parinfer (2)
- # pedestal (26)
- # portkey (2)
- # re-frame (11)
- # reagent (27)
- # ring (6)
- # rum (4)
- # shadow-cljs (33)
- # spacemacs (10)
- # specter (53)
- # tools-deps (17)
- # vim (31)
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.
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 🙂
Nothing wrong with multiple cursors
@pesterhazy thanks 🙂
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
@tomi.hukkalainen_slac how are you importing?
Like here https://github.com/reagent-project/reagent/blob/master/examples/material-ui/src/example/core.cljs#L7
sorry are you using the normal compiler and importing each library with a :foreign-libs
declaration, or are you using shadow-cljs
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
Like https://github.com/reagent-project/reagent/blob/master/examples/material-ui/project.clj#L6
Hm. Ok, I might try that. They do declare a different namespace now, so as long as lein will install both versions...
sorry i shouldn’t have jumped in on this issue because I really haven’t thought very carefully how the clojars thing works
Hmm https://github.com/cljsjs/packages/blob/master/material-ui/build.boot#L80 shows that the old lib has both the old and new name
Fortunately this codebase doesn't have that many places to touch. But in bigger projects this would be a headache
@tomi.hukkalainen_slac v0 and v1 use both same artifact-id so they can't be present in single project
that is, cljsjs/material-ui
> Is there any way to use two different versions of a lib in clojurescript?
We could release the v1 on another artifact-id (and remove duplicate provides) and then it would be possible have both
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.