This release marks a huge step forward for dry-system, bringing support for Zeitwerk and other autoloaders, plus clearer configuration and improved consistency around component resolution for both finalized and lazy loading containers. Read the announcement post for a high-level tour of the new features.
Added
New component_dirs setting on Dry::System::Container, which must be used for specifying the directories which dry-system will search for component source files.
Each added component dir is relative to the container's root, and can have its own set of settings configured:
class MyApp::Container < Dry::System::Container
configure do |config|
config.root = __dir__
# Defaults for all component dirs can be configured separately
config.component_dirs.auto_register = true # default is already true
# Component dirs can be added and configured independently
config.component_dirs.add "lib" do |dir|
dir.add_to_load_path = true # defaults to true
dir.default_namespace = "my_app"
end
# All component dir settings are optional. Component dirs relying on default
# settings can be added like so:
config.component_dirs.add "custom_components"
end
end
The following settings are available for configuring added component_dirs:
auto_register, a boolean, or a proc accepting a Dry::System::Component instance and returning a truthy or falsey value. Providing a proc allows an auto-registration policy to apply on a per-component basis
add_to_load_path, a boolean
default_namespace, a string representing the leading namespace segments to be stripped from the component's identifier (given the identifier is derived from the component's fully qualified class name)
loader, a custom replacement for the default Dry::System::Loader to be used for the component dir
memoize, a boolean, to enable/disable memoizing all components in the directory, or a proc accepting a Dry::System::Component instance and returning a truthy or falsey value. Providing a proc allows a memoization policy to apply on a per-component basis
This release marks a huge step forward for dry-system, bringing support for Zeitwerk and other autoloaders, plus clearer configuration and improved consistency around component resolution for both finalized and lazy loading containers. Read the announcement post for a high-level tour of the new features.
Added
New component_dirs setting on Dry::System::Container, which must be used for specifying the directories which dry-system will search for component source files.
Each added component dir is relative to the container's root, and can have its own set of settings configured:
class MyApp::Container < Dry::System::Container
configure do |config|
config.root = __dir__
# Defaults for all component dirs can be configured separately
config.component_dirs.auto_register = true # default is already true
# Component dirs can be added and configured independently
config.component_dirs.add "lib" do |dir|
dir.add_to_load_path = true # defaults to true
dir.default_namespace = "my_app"
end
# All component dir settings are optional. Component dirs relying on default
# settings can be added like so:
config.component_dirs.add "custom_components"
end
end
The following settings are available for configuring added component_dirs:
auto_register, a boolean, or a proc accepting a Dry::System::Component instance and returning a truthy or falsey value. Providing a proc allows an auto-registration policy to apply on a per-component basis
add_to_load_path, a boolean
default_namespace, a string representing the leading namespace segments to be stripped from the component's identifier (given the identifier is derived from the component's fully qualified class name)
loader, a custom replacement for the default Dry::System::Loader to be used for the component dir
memoize, a boolean, to enable/disable memoizing all components in the directory, or a proc accepting a Dry::System::Component instance and returning a truthy or falsey value. Providing a proc allows a memoization policy to apply on a per-component basis
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Bumps dry-system from 0.18.1 to 0.19.1.
Release notes
Sourced from dry-system's releases.
... (truncated)
Changelog
Sourced from dry-system's changelog.
... (truncated)
Commits
e633504
Update changelog11d53ea
Bump version to 0.19.13bdf957
Check for actual registered string keys in AutoRegistrar (#175)ad3977f
Use released dry-configurable67c94e9
Bump dry-system to 0.19.0f9e0eb2
[devtools] synca8e921a
Update changelogc55354b
[devtools] syncd2a4ff0
Update changelogb386458
[devtools] syncDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)