weavejester / integrant-repl

Reloaded workflow functions for Integrant
MIT License
157 stars 17 forks source link

Update integrant-repl to latest integrant version #27

Open agorgl opened 2 weeks ago

agorgl commented 2 weeks ago

Integrant is now on version 0.10.0, but this library still uses 0.8.1.

Also the from 0.9.0 onwards the usage of prep/prep-key is deprecated: https://github.com/weavejester/integrant/blob/master/CHANGELOG.md#090-2024-04-29 and this library uses them with set-prep! at its core

weavejester commented 2 weeks ago

Thanks for the reminder. I've been working on some design issues with Integrant that I wanted to resolve before updating this library. It's been taking longer than I expected, unfortunately, but I think I'm nearly there.

agorgl commented 2 weeks ago

I suppose the work that needs to be done to comply with the new integrant api is to rename all the prep references to expand and all the prepper to expander?

weavejester commented 2 weeks ago

Well, you can use set-prep! and change it from ig/prep to ig/expand. I'm going to be slightly changing the way expand works in future, however, which is why I've been holding off on updating this library. I just haven't worked out exactly how, yet.

agorgl commented 2 weeks ago

I suppose if I'm not using any of the prep or expand stages (just the init/halt), returning the system-map/configuration from the function passed to set-prep! should be enough?

weavejester commented 2 weeks ago

If you're not using integrant.core/prep or integrant.core/expand, you don't need to use integrant.repl/prep at all.

agorgl commented 2 weeks ago

Yes, but this https://github.com/weavejester/integrant-repl/blob/13a771900b4c40e5f7f56863f1115b9007557364/src/integrant/repl.clj#L17 kinda forces you to set a 'prepper'. I guess its all about semantics, maybe some word that would indicate that the library needs an 'init-ready' input should be used :).

Also why not internalize the use of prep/expand, and just require from the user to set the system configuration? A set-conf! api would make more sense