forked from dry-rb/dry-system
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchangelog.yml
294 lines (287 loc) · 12.7 KB
/
changelog.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
---
- version: 0.13.2
date: '2019-12-28'
fixed:
- More keyword warnings (flash-gordon)
- version: 0.13.1
date: '2019-11-07'
fixed:
- Fixed keyword warnings reported by Ruby 2.7 (flash-gordon)
- Duplicates in `Dry::System::Plugins.loaded_dependencies` (AMHOL)
- version: 0.13.0
date: '2019-10-13'
changed:
- "[BREAKING] `Container.key?` triggers lazy-loading for not finalized containers.
If component wasn't found it returns `false` without raising an error. This is
a breaking change, if you seek the previous behavior, use `Container.registered?`
(flash-gordon)"
added:
- |-
`Container.resolve` accepts and optional block parameter which will be called if component cannot be found. This makes dry-system consistent with dry-container 0.7.2 (flash-gordon)
```ruby
App.resolve('missing.dep') { :fallback } # => :fallback
```
- version: 0.12.0
date: '2019-04-24'
changed:
- Compatibility with dry-struct 1.0 and dry-types 1.0 (flash-gordon)
- version: 0.11.0
date: '2019-03-22'
changed:
- "[BREAKING] `:decorate` plugin was moved from dry-system to dry-container (available
in 0.7.0+). To upgrade remove `use :decorate` and change `decorate` calls from
`decorate(key, decorator: something)` to `decorate(key, with: something)` (flash-gordon)"
- "[internal] Compatibility with dry-struct 0.7.0 and dry-types 0.15.0"
- version: 0.10.1
date: '2018-07-05'
added:
- Support for stopping bootable components with `Container.stop(component_name)`
(GustavoCaso)
fixed:
- When using a non-finalized container, you can now resolve multiple different container
objects registered using the same root key as a bootable component (timriley)
- version: 0.10.0
date: '2018-06-07'
added:
- |-
You can now set a custom inflector on the container level. As a result, the `Loader`'s constructor accepts two arguments: `path` and `inflector`, update your custom loaders accordingly (flash-gordon)
```ruby
class MyContainer < Dry::System::Container
configure do |config|
config.inflector = Dry::Inflector.new do |inflections|
inflections.acronym('API')
end
end
end
```
changed:
- A helpful error will be raised if an invalid setting value is provided (GustavoCaso)
- When using setting plugin, will use default values from types (GustavoCaso)
- Minimal supported ruby version was bumped to `2.3` (flash-gordon)
- "`dry-struct` was updated to `~> 0.5` (flash-gordon)"
- version: 0.9.2
date: '2018-02-08'
fixed:
- Default namespace no longer breaks resolving dependencies with identifier that
includes part of the namespace (ie `mail.mailer`) (GustavoCaso)
- version: 0.9.1
date: '2018-01-03'
fixed:
- Plugin dependencies are now auto-required and a meaningful error is raised when
a dep failed to load (solnic)
- version: 0.9.0
date: '2018-01-02'
added:
- Plugin API (solnic)
- "`:env` plugin which adds support for setting `env` config value (solnic)"
- "`:logging` plugin which adds a default logger (solnic)"
- "`:decorate` plugin for decorating registered objects (solnic)"
- "`:notifications` plugin adding pub/sub bus to containers (solnic)"
- "`:monitoring` plugin which adds `monitor` method for monitoring object method
calls (solnic)"
- "`:bootsnap` plugin which adds support for bootsnap (solnic)"
changed:
- "[BREAKING] renamed `Container.{require=>require_from_root}` (GustavoCaso)"
- version: 0.8.1
date: '2017-10-17'
fixed:
- Aliasing an external component works correctly (solnic)
- Manually calling `:init` will also finalize a component (solnic)
- version: 0.8.0
date: '2017-10-16'
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)"
- version: 0.7.3
date: '2017-08-02'
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)
- version: 0.7.2
date: '2017-08-02'
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)"
- version: 0.7.1
date: '2017-06-16'
changed:
- Accept string values for Container's `root` config (timriley)
- version: 0.7.0
date: '2017-06-15'
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):
```ruby
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)"
- version: 0.6.0
date: '2016-02-02'
changed:
- Lazy load components as they are resolved, rather than on injection (timriley)
- Perform registration even though component already required (blelump)
- version: 0.5.1
date: '2016-08-23'
fixed:
- Undefined locals or method calls will raise proper exceptions in Lifecycle DSL
(aradunovic)
- version: 0.5.0
date: '2016-08-15'
summary: for multi-container setups. As part of this release `dry-system` has been
renamed to `dry-system`.
added:
- |-
Boot DSL with:
- Lifecycle triggers: `init`, `start` and `stop` (solnic)
- `use` method which auto-boots a dependency and makes it available in the booting context (solnic)
- When a component relies on a bootable component, and is being loaded in isolation,
the component will be booted automatically (solnic)
changed:
- "[BREAKING] `Dry::Component::Container` is now `Dry::System::Container` (solnic)"
- "[BREAKING] Configurable `loader` is now a class that accepts container's config
and responds to `#constant` and `#instance` (solnic)"
- "[BREAKING] `core_dir` renameda to `system_dir` and defaults to `system` (solnic)"
- "[BREAKING] `auto_register!` yields `Component` objects (solnic)"
- version: 0.4.3
date: '2016-08-01'
fixed:
- Return immediately from `Container.load_component` if the requested component
key already exists in the container. This fixes a crash when requesting to load
a manually registered component with a name that doesn't map to a filename (timriley
in [#24](https://github.com/dry-rb/dry-system/pull/24))
- version: 0.4.2
date: '2016-07-26'
fixed:
- Ensure file components can be loaded when they're requested for the first time
using their shorthand container identifier (i.e. with the container's default
namespace removed) (timriley)
- version: 0.4.1
date: '2016-07-26'
fixed:
- Require the 0.4.0 release of dry-auto_inject for the features below (in 0.4.0)
to work properly (timriley)
- version: 0.4.0
date: '2016-07-26'
added:
- |-
Support for supplying a default namespace to a container, which is passed to the container's injector to allow for convenient shorthand access to registered objects in the same namespace (timriley in [#20](https://github.com/dry-rb/dry-system/pull/20))
```ruby
# Set up container with default namespace
module Admin
class Container < Dry::Component::Container
configure do |config|
config.root = Pathname.new(__dir__).join("../..")
config.default_namespace = "admin"
end
end
Import = Container.injector
end
module Admin
class CreateUser
# "users.repository" will resolve an Admin::Users::Repository instance,
# where previously you had to identify it as "admin.users.repository"
include Admin::Import["users.repository"]
end
end
```
- Support for supplying to options directly to dry-auto_inject's `Builder` via `Dry::Component::Container#injector(options)`.
This allows you to provide dry-auto_inject customizations like your own container
of injection strategies (timriley in [#20](https://github.com/dry-rb/dry-system/pull/20))
- Support for accessing all available injector strategies, not just the defaults
(e.g. `MyContainer.injector.some_custom_strategy`) (timriley in [#19](https://github.com/dry-rb/dry-system/pull/19))
changed:
- Subclasses of `Dry::Component::Container` no longer have an `Injector` constant
automatically defined within them. The recommended approach is to save your own
injector object to a constant, which allows you to pass options to it at the same
time, e.g. `MyApp::Import = MyApp::Container.injector(my_options)` (timriley in
[#19](https://github.com/dry-rb/dry-system/pull/19))
- version: 0.3.0
date: '2016-06-18'
changed:
- 'Removed two pieces that are moving to dry-web:'
- Removed `env` setting from `Container` (timriley)
- Removed `Dry::Component::Config` and `options` setting from `Container` (timriley)
- Changed `Component#configure` behavior so it can be run multiple times for configuration
to be applied in multiple passes (timriley)
summary: 'Removed two pieces that are moving to dry-web:'
- version: 0.2.0
date: '2016-06-13'
changed:
- Component core directory is now `component/` by default (timriley)
- Injector default stragegy is now whatever dry-auto_inject's default is (rather
than hard-coding a particular default strategy for dry-system) (timriley)
fixed:
- Fixed bug where specified auto-inject strategies were not respected (timriley)
- version: 0.1.0
date: '2016-06-07'
added:
- Provide a dependency injector as an `Inject` constant inside any subclass of `Dry::Component::Container`.
This injector supports all of `dry-auto_inject`'s default injection strategies,
and will lazily load any dependencies as they are injected. It also supports arbitrarily
switching strategies, so they can be used in different classes as required (e.g.
`include MyComponent::Inject.args["dep"]`) (timriley)
- 'Support aliased dependency names when calling the injector object (e.g. `MyComponent::Inject[foo:
"my_app.foo", bar: "another.thing"]`) (timriley)'
- |-
Allow a custom dependency loader to be set on a container via its config (AMHOL)
```ruby
class MyContainer < Dry::Component::Container
configure do |config|
# other config
config.loader = MyLoader
end
end
```
changed:
- "`Container.boot` now only makes a simple `require` for the boot file (solnic)"
- Container object is passed to `Container.finalize` blocks (solnic)
- Allow `Pathname` objects passed to `Container.require` (solnic)
- Support lazily loading missing dependencies from imported containers (solnic)
- "`Container.import_module` renamed to `.injector` (timriley)"
- Default injection strategy is now `kwargs`, courtesy of the new dry-auto_inject
default (timriley)
- version: 0.0.2
date: '2015-12-24'
added:
- Containers have a `name` setting (solnic)
- Containers can be imported into one another (solnic)
changed:
- Container name is used to determine the name of its config file (solnic)
- version: 0.0.1
date: '2015-12-24'
summary: First public release, extracted from rodakase project