Fork me on GitHub
#polylith
<
2024-02-04
>
jdhollis18:02:40

It doesn’t seem that poly is picking up :dev alias :extra-deps in my bases. That seems to be by design judging by the docs.

tengstrand19:02:49

This should work. You can export your workspace with poly ws out:jdhollis.edn and send it to me, and I will have a look.

tengstrand19:02:22

What version of the poly tool do you use?

jdhollis19:02:54

Looks like poly 0.2.18.

tengstrand19:02:24

Thanks, will have a look.

jdhollis19:02:57

If it helps, the specific thing that sent me down this rabbit hole is that I've specified ring-devel in my base as a dev dep. But running in the REPL using Cursive, I get a classpath error when trying to require to ring.middleware.reload.

jdhollis19:02:46

Everything is configured per the Polylith Cursive docs. And Cursive is picking up the dev deps just fine.

seancorfield19:02:50

Aliases in dependencies are ignored. You can't have :dev in a base or component deps.edn file.

jdhollis19:02:09

But there's still :test?

seancorfield19:02:18

poly specifically pulls some things from :test aliases in bricks but that's not how the CLI/`tools.deps` works in general.

jdhollis19:02:33

That's what I figured from the docs.

jdhollis19:02:05

At least upon re-reading.

seancorfield19:02:35

For something like ring-devel, I would put it in the workspace deps.edn under the :dev alias for REPL usage.

seancorfield19:02:03

(well, personally, I would never use ring-devel or any similar reloading/refreshing library)

jdhollis19:02:50

I've been avoiding it up until now, but I've been testing some handler changes. Thought I might try to save myself some extra evals.

seancorfield19:02:35

I eval every change I make in my editor, into the running REPL. No reload/refresh needed.

seancorfield19:02:29

(also, with my admin hat on, can you please use threads in future instead of multiple top-level posts -- and that applies in pretty much all channels here)

seancorfield19:02:25

A single top-level post, with details in a thread, makes it much easier for people to a) follow a single discussion and b) be able to have multiple conversation active in a single channel without them overlapping each other.

jdhollis19:02:20

Eh. In this case, I just need to use integrant/repl. Which I can add to my top-level :dev alias.

Patrix02:02:41

As far as the thinking behind this... In my understanding Whether something uses ring-devel or not is a deploy-time (aka project-level) decision. When you deploy this app somewhere, you define its deps (Without ring-devel) in its project/project-name brick, so the decision to include ring-devel or not should be considered the same. This is why "development" is for all purposes a project, it just gets activated with the :dev alias at the root deps.edn. So using anything like ring-devel, or a system.edn (for integrant) with some dev IAM keys and so on.. also happens with the development project.

Patrix02:02:55

(I wrote and rewrote parts of this reply in between other tasks, so hopefully it makes sense)

Patrix02:02:02

It's the same btw with other deps, like integrant.repl -- that would be defined in your dev alias, and not in individual components or bases making use of (go) etc

1
jdhollis18:02:48

What’s the thinking behind this?

jdhollis18:02:57

I can move my ring/ring-devel up to the top-level development deps.edn easily enough. It just seems tidier to have that specified in the base where I’m using Ring.

jdhollis19:02:05

I may just be missing something about the overall philosophy.

tengstrand20:02:11

It looks like the introduction of separate config files for projects and bricks degrades the user experience by making it harder to get an overview and edit the configuration for projects and bricks. It would be good to get more feedback about this, because now we are leaning toward rolling back this functionality, and to keep the brick and project config in workspace.edn as it is today. If you haven't already, please check out the latest https://cljdoc.org/d/polylith/clj-poly/0.2.19-SNAPSHOT/doc/readme release, and evaluate the https://cljdoc.org/d/polylith/clj-poly/0.2.19-SNAPSHOT/doc/reference/commands#migrate command in a separate branch, and give your feedback in a thread here.

Patrix01:02:37

I have honestly held back on trying 0.2.19 because of this -- mostly because I don't want to have to update my understanding of polylith in the middle of a big project and some other life events. I was hesitant exactly of what you said - spreading the workspace config in multiple files/bricks. Feedback from people who have actually tried 0.2.19 should be given more weight, of course.

tengstrand03:02:50

I've had a good nights sleep, and I just decided to rollback how we store project and brick configuration in workspace.edn, but to keep the changes in the internal workspace structure. I have other thought also, but will post them separately.

🙏 1