shadow-cljs

https://github.com/thheller/shadow-cljs | https://github.com/sponsors/thheller | https://www.patreon.com/thheller
2021-01-02T00:18:48.238300Z

Hi, I am trying to hunt down a strange bug. I have a multifunction defined in multiple files. When I start watch process, the function is not called correctly. When I modify the source file, for instance by adding a log there, Shadow logo shows in the bottom left corner and everything works fine, even after removing the added line. When I restart shadow-cljs, the problem repeats, and it also happens within release build. If I keep the log there and restart watch, the line is not printed to console.

2021-01-02T00:23:33.239600Z

Also reloading the app in the browser causes the same problem, again only fixed after reloading the file. If I write console.log as the top level form, it is called in the beginning. But not inside the multifn. I am running 2.11.11.

Dan Maltbie 2021-01-02T00:39:55.239900Z

It appears so. And the code seems to work. Should I ignore these warnings? I don't get them when I compile with webpack or node.

2021-01-02T00:45:22.241Z

Ok, sorry, I have found it, I had the same method overridden by another file 🙂.

🙂 1
thheller 2021-01-02T01:05:10.241100Z

you seem to have a deps.cljs which you don't really need?

Dan Maltbie 2021-01-02T01:12:38.241300Z

I'm not seeing that. Where would that be specified (which file)?

Dan Maltbie 2021-01-02T01:22:13.241500Z

I can't find a file in the project named deps.cljs. my shadow-cljs.edn file contains two cljsjs packages. could that cause a problem? :dependencies [ [cljsjs/hash "1.1.3-0"] [cljsjs/msgpack-lite "0.1.26-0"] [reagent "1.0.0-alpha2"] [reagent-utils "0.3.3"] ]

thheller 2021-01-02T01:23:20.241800Z

you don't need to include those cljsjs deps since shadow-cljs will not use them anyways

thheller 2021-01-02T01:23:26.242Z

don't know what they would provide

thheller 2021-01-02T01:25:29.242200Z

you can set :npm-deps {:install false}. then it won't warn or attempt to install npm dependencies from deps.cljs. something in your dependencies or you project has a deps.cljs file which declares a :npm-deps dependency on "@ndn/packet" with version "@ndn/tlv@http://localhost:8000/tlv.tgz"

Dan Maltbie 2021-01-02T01:39:20.242500Z

The package.json file for @ndn/packet (in the node_modules directory) has a dependency for the tlv.tgz file. But there isn't a deps.cljs file. And I thought I needed to have the package version specified in the shadow-cljs.edn file for packages I use. Are you saying that I should just install with npm instead of cljsjs?

Dan Maltbie 2021-01-02T01:44:42.242700Z

Where does the :npm-deps statement go?

Dan Maltbie 2021-01-02T01:54:29.242900Z

Ok. I see in the User Guide section 5.2.2 that it says to use npm to manage the JS packages and not cljsjs. got it. But I still can't find where to put the :npm-deps statement. Do I put it in my main.cljs file or create a deps.cljs file?

2021-01-02T16:30:00.245600Z

hi, are there any example of build hooks? what people do with this feature? https://shadow-cljs.github.io/docs/UsersGuide.html#build-hooks