Fork me on GitHub
#polylith
<
2022-04-22
>
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
Hukka06:04:45

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

Hukka06:04:39

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. https://github.com/furkan3ayraktar/clojure-polylith-realworld-example-app/blob/master/deps.edn

tengstrand06:04:33

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
tengstrand06:04:48

@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.

tengstrand06:04:09

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.

imre07:04:54

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?

dgb2308:04:55

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

Hukka08:04:59

> 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.

Hukka10:04:08

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

Hukka10:04:42

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