Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a new implementation of the setup/configure/finalize code which drastically simplifies internals and makes it possible to easily extend ROM with more component types. This could be simplified further but a prerequisite is to simplify command compiler first, which I'll most likely do in a separate PR.
This is meant to be backward compatible, I'll test it out with other adapters and apps to ensure things work.
Here's a simple example of how things work internally now:
This is a gigantic improvement because it demystifies how rom loads its components and isolates component-specific setup/build code in dedicated component classes. It opens up doors to a lot of interesting features that we'll be able to add later. ie using different configurations for the same component, providing pre-configured components from "the outside" (ie a bunch of preconfigured relations provided by a gem) and so on, lots of possibilities.
A quick follow-up after this is merged will be adding
Components::Struct
andComponents::Repository
- making them 1st-class core components that are easy to set up and use.I will also make ROM's container 100% compatible with dry-system/hanami2 so that things like
my_container.import(persistence: rom_container)
will work OOTB.Refs #607