This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-16
Channels
- # announcements (33)
- # atom-editor (1)
- # aws (21)
- # babashka (174)
- # babashka-sci-dev (2)
- # beginners (59)
- # calva (4)
- # chlorine-clover (9)
- # clj-kondo (51)
- # clojars (7)
- # clojure (86)
- # clojure-czech (4)
- # clojure-europe (21)
- # clojure-france (6)
- # clojure-nl (1)
- # clojure-uk (2)
- # conjure (7)
- # core-async (3)
- # core-logic (3)
- # cursive (10)
- # data-science (8)
- # datalevin (14)
- # datomic (12)
- # events (1)
- # fulcro (5)
- # graalvm (10)
- # gratitude (3)
- # honeysql (3)
- # hyperfiddle (3)
- # introduce-yourself (4)
- # joyride (3)
- # leiningen (3)
- # malli (13)
- # minecraft (15)
- # music (1)
- # off-topic (40)
- # pathom (16)
- # polylith (28)
- # portal (25)
- # rdf (15)
- # remote-jobs (3)
- # shadow-cljs (23)
- # specter (1)
- # sql (5)
- # tools-deps (25)
- # xtdb (31)
Can I get help importing react-virtualized-auto-sizer? https://github.com/bvaughn/react-virtualized-auto-sizer
AutoSizer is null when importing with:
["react-virtualized-auto-sizer$default" :as AutoSizer]
@shaunlebron from the example import {AutoSizer, List} from 'react-virtualized';
and see translation listing here https://shadow-cljs.github.io/docs/UsersGuide.html#_using_npm_packages
or as usual try without the $default
, also see my answer here on how to figure this out https://stackoverflow.com/a/72196457/8009006
Thanks! leaving out the $default
returned what I needed I think since it evaluated to a function when logging it, but I gave up on getting it working in reagent
Given shadow-cljsjs has a exportSybmol for Raven why would my shadow-cljs watch not be able to find it? The error i see
[:app] Build failure:
The required JS dependency "raven-js" is not available, it was required by "cljsjs/raven.cljs".
do I also need to install raven-js via npm?
adding raven via yarn add raven-js
causes the build not to fail because it's missing the js dep raven.
If i add the library via yarn and it's declared in my shadow-cljs.edn file as cljsjs/somelib <some-version> how does the app know which version to use the package.json or the shadow-cljs.edn one? I feel like adding them to both must not be the correct way to handle this.
In a shadow project how would i go about resolving these requires?
[cljsjs.codemirror]
[cljsjs.codemirror.mode.clojure]
[cljsjs.codemirror.addon.edit.closebrackets]
[cljsjs.codemirror.addon.edit.matchbrackets]
The first would be
(ns cljsjs.codemirror
(:require ["codemirror" :as cm]))
(js/goog.exportSymbol "CodeMirror" cm)
Is the next one then
(ns cljsjs.codemirror.mode.clojure
(:require ["codemirror/mode/clojure" :as cm]))
;; what would go here?
(js/goog.exportSymbol "CodeMirror" cm)
It's not clear to me in the namespace that uses the functionality how things are used there is just one js/CodeMirror so i assume my guess above is wrong and i'm supposed to somehow shove all the functions into that symbol. Maybe through js/goog.object.set ?err maybe i can just create a deps file with this boot task? https://github.com/cljsjs/packages/blob/master/codemirror/build.boot
i’ve got a demo repo using codemirror and shadow-cljs if that is helpful to you: https://github.com/dpsutton/field-editor
i get a 404 with that link
I'm also using codemirror here https://github.com/thheller/shadow-cljs/blob/master/src/main/shadow/cljs/ui/components/code_editor.cljs#L3-L5
Thanks I'll take a look!
@drewverlee if you are controlling the requires you should just include npm packages directly and not use the cljsjs "bridges". they are really only provided for cases where you can't change them because some library uses them
thanks. that makes sense.