Fork me on GitHub
#clojurescript
<
2022-06-01
>
witek07:06:38

Given a collection (for example a vector of maps) - how can I convert it to a JavaScript Array without recursively converting its elements (the maps)?

thheller07:06:16

(into-array coll)

🙏 2
Tala Tarazi09:06:43

Hi all, I'm using re-frame and I'm trying to use virtual scrolling, not sure what's the best approach here. Can anyone advice me? Thanks

p-himik16:06:07

Any React library should be sufficient. I've tried a few and had the most success with react-window with react-virtualized-auto-sizer on top.

ivana10:06:43

Which client side routing is famous nowadays for new project without legacy? Reitit?

ivana10:06:19

At least here https://clojurescript.org/community/libraries only 3 are suggested (secretary, bidi, silk), but in other places they are not recommended and even marked as deprecated ones...

madis10:06:23

Hello. It's my first time writing here, please let me know if I missed some community rules and my apologies in case I did. A thing I've been struggling with (so far without success): how to develop/build/release CLJS library that has transitive dependencies on NPM libraries, so that the application consuming the CLJS library could get the NPM dependencies with minimum overhead. Two scenarios: - App => CLJS lib => NPM lib - App => CLJS lib A => CLJS lib B => NPM lib So far I've tried using shadow-cljs with deps.edn (for the CLJS lib) and on the App side both Leiningen and shadow-cljs (to resolve the dependencies & build). But the only way I've been able to get the NPM lib dependency is by adding it to package.json on the App (or lib) that directly needs it (whose code gets run). > More context: I looked into the JAR files built for the library and they only contain the CLJS files (as expected) so it remains unclear for me how the final user (App) would get information about the NPM dependencies involved. I imagine there would have to be at least deps.edn with :npm-deps as part of the JAR (`pom.xml` or straight deps.edn) or the package.json. But this is more speculation, I'm not familiar how Clojure(Script) resolves the dependencies Has anybody had this scenario? Any recommendations? Any help appreciated! Clojure is awesome!

madis10:06:33

I might have misunderstood how deps.edn is used. Trying with deps.cljs now https://www.reddit.com/r/Clojure/comments/go9oou/depsclj_vs_depscljs/

👀 1
madis12:06:46

After fiddling around quite a bit with deps.cljs , I'm still where I started. @U050B88UR or others here, any advice would be appreciated. I'll put the question hopefully in clearer form: How to configure, build & release a CLJS library that depends on another NPM library so that the user of the CLJS library doesn't have to specify NPM dependencies in package.json but rather would get them automatically > My preferred toolchain would be shadow-cljs & deps.edn but if it's only possible with some other tools, I'd be also curious to find it out I've created an example CLJS library that uses NPM library and a simple Application that uses both in https://github.com/madis/cljs-library-demo/pull/1 > The tree can be seen at https://github.com/madis/cljs-library-demo/tree/transitive-npm-deps-on-cljs-lib/test-lib

p-himik13:06:33

deps.cljs and deps.edn are completely orthogonal files - you can't just rename one into the other to make something work. There's no single documentation page that describes deps.cljs in its entirety, but there's a relevant issue with some useful links: https://github.com/clojure/clojurescript-site/issues/224

👀 1
dnolen14:06:06

@services474 you are on the right track - you have to do this w/ deps.cljs