Fork me on GitHub
Jungin Kwon06:04:14

Do I have to copy and paste the dependencies of bases and components to deps.edn in the root directory every time?

👍 3

There should be no copying and pasting, could you elaborate?


Bases and components have external libraries in their deps.edn, and those will not go to the development project's deps.edn in the root. And the bases/components do not list dependencies to components at all (though they still need to require them in the code), and they are only in the project

🙏 2
Jungin Kwon06:04:18

Then how do I import all dependencies (in bases and components) to local REPL? This realworld example has all dependencies here.


If you use the :local/root syntax (which is supported by most IDE’s except Cursive) these dependencies will be picked up and you will not have to repeat them. If you add your bricks with extra-paths in ./deps.edn then you also have to add their libraries manually to ./deps.edn.

🙏 1

@U2BDZ9JG3 who is the author of the realworld example app, is also a Cursive user, which is the reason he added the bricks as extra-paths.


If you only use VSCode/Calva or Emacs/Cider then the :local-root syntax is to be preferred. We wanted the examples to work for all users and that’s why we haven’t used the :local/root syntax.


In our project I started using both :local/root and :extra-paths - and added a comment to the latter that it's only a crutch for us Cursive users. Is there any reason why I shouldn't use both?


This conversation cleared up quite a bunch of questions for me ty!


> Is there any reason why I shouldn't use both? I suppose possibility for bugs, when someone forgets to do both and still works in their env?

Jungin Kwon08:04:13

Thank you! :local/root works fine with Calva. Cursive doesn't work with multiple bases.


What kind of tooling do you use to bundle (CLJS) frontend code in the polylith backend, so it can be deployed together? Or does everyone use a separate domain and mechanism to serve the frontend files


Well, I think I'll go with babashka and just shell commands to run npx, cp, etc

Pieter Koornhof16:04:47

we run figwheel-main for dev with the config inside of the base deps.edn file. Then on deploy we build the assets and have a small clojure script that hashes the files and copies them into the resource folder before we build the uberjar