dry-system icon indicating copy to clipboard operation
dry-system copied to clipboard

Update config in configure blocks only

Open timriley opened this issue 3 years ago • 0 comments

Update all usages of dry-configurable-provided config so that any changes are made inside configure blocks.

This prepares for the changes in https://github.com/dry-rb/dry-configurable/pull/140.

This involves some specific tweaks to how to Dry::System::Container manages its config:

  • Since .configure is now the only way to update config, we can no longer keep our override `configure that immediately finalizes the config, since we still need to be able to configure the container (e.g. in plugins) without finalising the config at the same time
  • For the cases where we do want to configure and finalise config, we provide a new .configure! method to do this. This feels pretty good in working practice since it kind of matches the existing .configured! and .finalize! methods

This was the most involved of all the dry-configurable upgrades so far.

It even necessitated a few changes to the open dry-configurable PR at https://github.com/dry-rb/dry-configurable/pull/140, which I'll write about over in that PR in the next day or so. This is a good thing, though, it hopefully means that PR can be as widely compatible as possible.

timriley avatar Sep 23 '22 23:09 timriley