Fork me on GitHub
Tema Nomad08:12:03

What is the difference between including a library in shadow-cljs.end or package.json if I can to use both sources to require a lib in my cljs file? For exampel clojars hub has react lib and npm hub has it too


I wouldn't use the Clojars version of React. Someone has to maintain it, probably someone who's not involved with React itself. CLJSJS is not something you need today. It can easily be outdated or missing some required externs. Pretty much always it's better and simpler to use the NPM version.

Tema Nomad08:12:23

So you prefer to use only NPM and use shadow-cljs only to compile cljs->js ?

Tema Nomad08:12:50

or I dont understand your: > CLJSJS is not something you need today


I myself - yes. But you don't have to use shadow-cljs. AFAIK Figwheel works with NPM too. Maybe other tools, but I don't use them so can't really tell.

Tema Nomad08:12:24

hmm I thought shadow-cljs is a basic frontend compile tool for clojurescript on production apps So you dont use it in your commercial apps and use figwheel?


basically you use npm for npm packages


and shadow-cljs.edn for cljs dependencies. thats it


react is a npm package and as far as I'm concerned doesn't exist on clojars


yes, you can use shadow-cljs for everything. there is no special license for commercial projects or whatever


what p-himik meant is that there is a 3rd party effort called "cljsjs" which provided npm packages in a way they could be accessed over clojars


but that became obsolete as soon as npm packages became directly accessible via npm

Tema Nomad10:12:09

I see now, thanks


some packages are still maintained there but most are out of date


so best to just use npm directly


for JS dependencies, CLJS is just clojars and not on npm


I know it sucks a little but thats how it works

Tema Nomad10:12:28

So I just use cljs related packages (like reagent, re-frame etc) via shadow-cljs and other (react, testing-library etc) via mom right ?



🙏 1