Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor and simplify plugin API #648

Merged
merged 1 commit into from
Jul 4, 2021
Merged

Conversation

solnic
Copy link
Member

@solnic solnic commented Jul 4, 2021

  • Replace deeply nested plugin registries with a single one
  • Add a backward-compatibility Resolver
  • Reduce and fix the number of requires

Specs run ~4 seconds faster on my machine with this so I suspect it's
going to have an impact in applications too.

You can now easily inspect what plugins have been loaded:

> ROM.plugin_registry.keys
["schema.timestamps", "relation.registry_reader", "relation.instrumentation", "command.schema", "command.timestamps", "sql.relation.instrumentation", "sql.relation.auto_restrictions", "sql.relation.nullify", "sql.relation.pagination", "sql.command.associates", "sql.relation.pg_explain", "sql.relation.pg_full_text_search"]

> ROM.plugin_registry["sql.relation.pagination"]
#<ROM::Plugin:0x00007f66761f8798 @name=:pagination, @mod=ROM::SQL::Plugin::Pagination, @type=:relation, @adapter=:sql>

- Replace deeply nested plugin registries with a single one
- Add a backward-compatibility Resolver
- Reduce and fix the number of requires

Specs run ~4 seconds faster on my machine with this so I suspect it's
going to have an impact in applications too.
@solnic solnic merged commit 20012d9 into master Jul 4, 2021
@solnic solnic deleted the simplify-plugin-registry branch July 4, 2021 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant