polylith

flowthing 2024-11-27T17:02:35.292199Z

Is my understanding correct that with Polylith, you generally develop using a single Clojure runtime that you run in the root of the project, instead of a separate runtime for each :local/root? If so, what happens e.g. if two components use different versions of the same lib?

seancorfield 2024-11-27T17:14:51.562429Z

Yes, normally the :dev project is where you run your REPL (so you typically jack-in and add the :dev alias to that command, or start your REPL manually with the :dev alias). If your :dev project has both of those components, you'll get the latest version of the library, because that's how the Clojure CLI / deps.edn works.

seancorfield 2024-11-27T17:21:07.454389Z

Can you give a concrete example that you're concerned about? I would assume that these two components are only ever used in different projects (and you have specific code that needs the older version of that library)?

flowthing 2024-11-27T20:14:16.906319Z

Thanks! Yeah, I'm not sure I have a concrete example in mind yet (other than the, in this community, luckily unlikely situation where a library has a breaking change), just trying to understand how this thing's put together. I was going to ask about running tests for a limited set of modules, but I think this is the answer: https://github.com/seancorfield/polylith-external-test-runner

seancorfield 2024-11-27T20:20:24.429759Z

Yeah, that also gives you complete test/process isolation and protects you more against memory leaks in your tests. The trade off being, it spawns a new process for each project, when running tests.

flowthing 2024-11-27T20:20:32.229409Z

(Or just run them from the REPL.)

flowthing 2024-11-27T20:20:39.791799Z

Right, gotcha. 👍

seancorfield 2024-11-27T20:21:43.610239Z

While I'm developing, I tend to run individual tests or a whole ns of tests from my editor via hot keys. You can also ask Polylith to run tests for just a specific project or even just a specific set of bricks.

👍 1