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

feat: Investigate a centralized, configurable plugin autoloading system (Zeitwerk) #417

Closed
jaredcwhite opened this issue Oct 14, 2021 · 1 comment · Fixed by #434
Closed
Labels
enhancement New feature or request process Improve the development process for the repo

Comments

@jaredcwhite
Copy link
Member

jaredcwhite commented Oct 14, 2021

The current manner in which any .rb file in ./plugins is simply loaded (and reloaded on subsequent changes) is out of step with other parts of the system which use Zeitwerk. In addition, there's no way to easily add new paths to the Zeitwerk autoloader or to trigger a reload from an arbitrary part of the system (based on watching files in some particular folder).

It seems to me it'd make sense to double-down on Zeitwerk, ensure there's a centralized/configurable ability to set up load paths, and use that in as many places as necessary. This would be a breaking change however as currently files in plugins are entirely arbitrary. You could have foo.rb define class Bar, or not even have a class in it at all. Once Zeitwerk is in place, it would enforce all the usual naming conventions we have elsewhere, in Rails, etc. But I think ultimately that's desirable anyway.

@jaredcwhite jaredcwhite added enhancement New feature or request process Improve the development process for the repo labels Oct 14, 2021
@jaredcwhite
Copy link
Member Author

This is worth looking at: https://github.com/zw963/hot_reloader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request process Improve the development process for the repo
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant