Fork me on GitHub
#polylith
<
2022-01-07
>
cyppan10:01:56

Hi, I’m often renaming components across the codebase lately and Cursive doesn’t help me doing so... Is a new polylith command like brick:rename old-name new-name that goes into all the ns and requires and rewrite them properly something conceivable?

pavlosmelissinos11:01:02

For lack of a better answer (and until the poly tool adds such a command), you could add the new namespaces/defns/etc, https://guide.clojure.style/#deprecated and let your linter do all the work: e.g. clj-kondo will show a warning when a deprecated function is used so it will be easier for you to find out what to change. Having to rename components "often" does sound a bit strange, so I'd also reconsider that need if I were you (if you haven't already, that is)... A rename implies providing something (the new name) and taking away something else (the old name). Do you really need to take that away from the user, even if the user is you?

cyppan13:01:01

> you could add the new namespaces/defns/etc, https://guide.clojure.style/#deprecated and let your linter do all the work: e.g. clj-kondo will show a warning when a deprecated function is used so it will be easier for you to find out what to change. good idea but it’s for a private company project so we prefer to migrate in one step > Having to rename components “often” does sound a bit strange I agree, you have an interesting way of stating this 🙂, actually we see patterns emerging with how we use Polylith over the months, so I think it’s a good think we introduce some better naming conventions now (aws- and domain- prefixes in the screenshot)

👍 1