Skip to content

Releases: dry-rb/dry-system

0.8.1

17 Oct 06:39
Compare
Choose a tag to compare

Fixed

  • Aliasing an external component works correctly (solnic)
  • Manually calling :init will also finalize a component (solnic)

Compare v0.8.0...v0.8.1

0.8.0

17 Oct 06:38
Compare
Choose a tag to compare

Added

  • Support for external bootable components (solnic)
  • Built-in :system components including :settings component (solnic)

Fixed

  • Lazy-loading components work when a container has default_namespace configured (GustavoCaso)

Changed

  • [BREAKING] Improved boot DSL with support for namespacing and lifecycle before/after callbacks (solnic)

Compare v0.7.3...v0.8.0

0.7.3

17 Oct 06:41
Compare
Choose a tag to compare

Fixed

  • Container.enable_stubs! calls super too, which actually adds stub API (solnic)
  • Issues with lazy-loading and import in stub mode are gone (solnic)

0.7.2

17 Oct 06:40
Compare
Choose a tag to compare

Added

  • Container.enable_stubs! for test environments which enables stubbing components (GustavoCaso)

Changed

  • Component identifiers can now include same name more than once ie foo.stuff.foo (GustavoCaso)
  • Container#boot! was renamed to Container#start (davydovanton)
  • Container#boot was renamed to Container#init (davydovanton)

Compare v0.7.1...v0.7.2

0.7.1

17 Oct 06:40
Compare
Choose a tag to compare

Changed

  • Accept string values for Container's root config (timriley)

0.7.0

15 Jun 13:12
Compare
Choose a tag to compare

Added

  • Added manual_registrar container setting (along with default ManualRegistrar implementation), and registrations_dir setting. These provide support for a well-established place for keeping files with manual container registrations (timriley)

  • AutoRegistrar parses initial lines of Ruby source files for "magic comments" when auto-registering components. An # auto_register: false magic comment will prevent a Ruby file from being auto-registered (timriley)

  • Container.auto_register!, when called with a block, yields a configuration object to control the auto-registration behavior for that path, with support for configuring 2 different aspects of auto-registration behavior (both optional):

    class MyContainer < Dry::System::Container
      auto_register!('lib') do |config|
        config.instance do |component|
          # custom logic for initializing a component
        end
    
        config.exclude do |component|
          # return true to skip auto-registration of the component, e.g.
          # component.path =~ /entities/
        end
      end
    end
  • A helpful error will be raised if a bootable component's finalize block name doesn't match its boot file name (GustavoCaso)

Changed

  • The default_namespace container setting now supports multi-level namespaces (GustavoCaso)
  • Container.auto_register! yields a configuration block instead of a block for returning a custom instance (see above) (GustavoCaso)
  • Container.import now requires an explicit local name for the imported container (e.g. import(local_name: AnotherContainer)) (timriley)

Compare v0.6.0...v0.7.0