Fork me on GitHub
#shadow-cljs
<
2019-12-08
>
dabrazhe11:12:57

Which of these references to shadow do I really need ? And what about the versions, should they always be the same and how to keep track? project.clj

:dependencies
[[thheller/shadow-cljs "2.8.59"]]
..

dabrazhe11:12:31

package.json

"devDependencies": {
  "shadow-cljs": "^2.8.53", ...}

thheller11:12:48

ideally they should be in sync. if you don't actually use the shadow-cljs command line then just project.clj is fine.

dabrazhe11:12:53

I am using shadow-cljs to start /stop the servers and release the app )

thheller11:12:22

then its best to keep them in sync just in case something from the command line changes

thheller11:12:28

it does so rarely but it can happen

thheller11:12:03

ideally don't use project.clj 😉

dabrazhe11:12:00

I am using project.clj because of Cursive, i 've understood it's needed for dependencies

thheller11:12:24

use shadow-cljs pom and import the generated pom.xml in Cursive to create the project

thheller11:12:37

run shadow-cljs pom again to update later, Cursive will pick up the changes automatically

dabrazhe11:12:34

alright, thank you. I also noticed that shadow version has somehow changed to node: v13.2.0 My project is at node 10.x , it won't clash, will it?

thheller11:12:44

no, that makes no difference in compile output

dabrazhe11:12:10

on another topic: can I safely manualy delete the target, node_modules folders ? I keep carrying some old libraries I am not using anymore..

thheller11:12:20

target yes, if you have a package-lock.json or yarn.lock (if you use yarn) then you can delete node_modules "safely"

👍 4
thheller11:12:40

otherwise you may end up with a completely different node_modules folder

dabrazhe11:12:27

I was thinking to delete the folders and run yarn again to rebuild them

thheller11:12:46

yes, but without a yarn.lock file the result of rebuilding them can be quite different

dabrazhe12:12:24

Isn't yarn is taking all the relevant dependencies form package.json and installs them anew?

thheller12:12:30

read up on non-determinism regarding npm/yarn. eg. https://yarnpkg.com/blog/2017/05/31/determinism/

👍 4
thheller12:12:02

it has greatly improved over time but it still isn't anywhere near deterministic

thheller12:12:25

all of npm uses version ranges. so you might have had version 1.5 or something and get 1.8 after a new install

thheller12:12:43

and since they aren't good with breaking changes either that may have broken everything

thheller12:12:53

in short: keep a lock file and commit it to git

dabrazhe12:12:35

thanks, the javascript ecosystem is still quite a mystery to me : )

thheller12:12:23

it is to everyone 😉

😁 4