Merged
Conversation
I finally realized that using relation's name object as a setting was a mistake because it's a rich object used at runtime, it's not part of the configuration. Breaking it down into explicit :id and :dataset settings makes it very clear what is what and we can easily infer them too. Still there's additional complexity caused by backward compatibility but it will be moved to rom/compat. Specs are now running EVEN faster after this clean up, that's cool too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 replaces class-level config values with a new settings API powered by dry-configurable. All components have explicit settings defined now and there's a backward-compatibility shim added to
rom/compatwhich makes sure that old-way of configuring classes through class attributes still works.Here's how the default
Relationsettings look like:There's actually a very strict convention behind this grouping:
auto_structat runtime to know how mappers should be inferredcomponentroot key are used by configuration when establishing connections to gateways, figuring out which plugins should be enabled but first-and-foremost - IF a given component should become registered and what its:idshould be. ie withcomponent.idset to ":users" a relation will be available asrom.relations[:users]but alsorom["relations.users"]schemain this example, are defaults that will be used when a given component defines its subcomponents. ie a relation can define its schema, so whatever you set here, will end up as defaults for that schemaOn top of this, both class definitions and DSL usage is expected to work consistently when it comes to handling configuration settings and DSL options are now automatically translated to component configs.
For example, defining a component class vs defining a component via DSL ends up with the exact same config: