Fork me on GitHub
#clojurescript
<
2022-12-13
>
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

p-himik08:12:33

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

p-himik08:12:13

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?

thheller10:12:06

basically you use npm for npm packages

thheller10:12:23

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

thheller10:12:39

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

thheller10:12:39

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

thheller10:12:22

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

thheller10:12:48

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

Tema Nomad10:12:09

I see now, thanks

thheller10:12:15

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

thheller10:12:20

so best to just use npm directly

thheller10:12:39

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

thheller10:12:56

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 ?

thheller10:12:46

correct

🙏 1