Fork me on GitHub

Can I get help importing 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


or as usual try without the $default, also see my answer here on how to figure this out


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

Drew Verlee14:06:42

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".

Drew Verlee15:06:39

do I also need to install raven-js via npm?

Drew Verlee15:06:58

adding raven via yarn add raven-js causes the build not to fail because it's missing the js dep raven.

Drew Verlee15:06:43

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.


Ah my mistake shadow-cljsjs

Drew Verlee15:06:06

In a shadow project how would i go about resolving these requires?

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 ?

Drew Verlee15:06:01

err maybe i can just create a deps file with this boot task?


i’ve got a demo repo using codemirror and shadow-cljs if that is helpful to you:

Drew Verlee15:06:15

i get a 404 with that link


it was private. try now


clone it and i’m gonna set it private again

Drew Verlee18:06:22

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

👍 1
Drew Verlee15:06:52

thanks. that makes sense.