This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-06-17
Channels
- # announcements (2)
- # aws (4)
- # babashka (20)
- # beginners (256)
- # calva (15)
- # chlorine-clover (1)
- # cider (12)
- # clj-kondo (25)
- # cljsrn (16)
- # clojure (115)
- # clojure-europe (7)
- # clojure-finland (5)
- # clojure-italy (10)
- # clojure-nl (35)
- # clojure-spec (13)
- # clojure-uk (83)
- # clojurescript (42)
- # code-reviews (81)
- # conjure (8)
- # cursive (6)
- # data-science (1)
- # datomic (3)
- # duct (18)
- # emacs (2)
- # figwheel-main (40)
- # fulcro (21)
- # helix (1)
- # jackdaw (7)
- # java (2)
- # lein-figwheel (5)
- # luminus (1)
- # observability (12)
- # off-topic (32)
- # parinfer (5)
- # pedestal (19)
- # re-frame (5)
- # reagent (8)
- # reitit (17)
- # rewrite-clj (47)
- # rum (19)
- # shadow-cljs (48)
- # spacemacs (4)
- # sql (40)
- # tools-deps (22)
- # vrac (1)
- # xtdb (25)
I got a project where there is an existing clojurescript codebase (made with figwheel-main, reagent and re-frame) where the company now wants to try to move to something else than clojurescript. And for this migration phase, they would like to be able to either write components in vanilla JS and use them from the existing clojurescript codebase, or have a application in vanilla JS and use the existing clojurescript components in there. I have some ideas on how this could be possible, but wondering if anyone has any examples of this being done in the wild? Would love to see any existing implementations of this done before
sounds like what cljsjs has done
yeah, that would be "publishing" the vanilla js components somewhere, and import them as foreign lib into the cljs app
@UEJ5FMR6K curious what’s the rationale for “trying to move to something else than CLJS”?
@U050KSS8M me too! I got as far as the developer who initially built the frontend and knows cljs is leaving the company, and none of the devs who will continue working there wants to learn cljs
I see… well I guess the thing to research would be “calling ClojureScript from JavaScript” and/or “calling JavaScript from ClojureScript”; I’m not an expert in either, but my gut feeling is that the latter would be somewhat easier (since it’s more or less common to use JavaScript libs from ClojureScript)
So if I am working in cljs in a namespace called foo
, and I want to define a macro that I use from foo
, is that possible from foo.cljc, or does it have to be in some non-foo namespace?
Does anyone have a helper function for generating a uuid from a string (any string)?
there’s one already in core cljs
@U01458A7CBX I mean like (uuid "my string")
that returns a consistent result from a hash that is unique
oh you mean hashing
you can use javascript hashing functions as well
Hashing to a uuid format, yes
Hello, my serverside clojure is using rum to generate an html page... how can i include a reference to a vanilla js function in the on-click event?
probably a string! yes... thanks... hmm
Aha. Thanks. Had me puzzled for a minute. {:on-click (str "promote2question();")}
kinda hacky, but simplifies my serverside rendering approach
in my shadow-cljs.edn
I have :source-paths ["src/main"}
and the file src/main/com/uxo/chrome-ext/background.cljs
has this ns decl: (ns com.uxo.chrome-ext.background)
, yet shadow-cljs watch
keeps erroring with: The required namespace "com.uxo.chrome-ext.background" is not available.
any clojurescript projects supporting gitpod (https://www.gitpod.io/blog/gitpodify/) yet? would be neat to see a typical emacs/cider/figwheel project on gitpod...
(in fact, getting cljs stuff on gitpod would lower the barrier to entry dramatically and remove one of the biggest stumbling blocks for new folks coming in to the language)
I don't think it would dramatically reduce the barrier to entry. The JVM is one of the best contained machines in the world. Most libraries requiring native bindings ship a jar containing what you need in a magic way. You literally install the JVM and you're good to go.
no, i think you're missing a lot of the development environment setup (emacs, cider, etc etc) here. and psst, this is #clojurescript , not #clojure it sounds like you don't really yet understand what gitpod actually is. i'd suggest reading up on it.
There isn't a development environment. My development environment doesn't live in the library, and has no place there.
not sure also what you mean by "library" but i'd be inclined to agree that a development environment doesn't belong there
how can I indicate a parent element with cljs?
.-parentElement seems to work actually 🙂
so I'm using rum to hydrate a component, but i think i need to tell rum/hydrate the parent component so it knows how to find it... it would seem
getting strange nesting behavior