-
Notifications
You must be signed in to change notification settings - Fork 117
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
Require Zeitwerk 2.6.1 #258
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems fine but would we call this a breaking change? We're removing support for <2.6.4, so I thought this could be released in the major version.
Not a breaking change since upgrading to Zeitwerk 2.6.4 should not break any app. |
312b411
to
efde788
Compare
@@ -20,8 +20,8 @@ def extract_relevant_paths(root, environment) | |||
|
|||
sig { returns(T::Hash[String, Module]) } | |||
def extract_application_autoload_paths | |||
Loader.autoloaders.inject({}) do |h, loader| | |||
h.merge(loader.dirs(namespaces: true)) | |||
Rails.autoloaders.inject({}) do |h, autoloader| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rails.autoloaders.inject({}) do |h, autoloader| | |
Rails.autoloaders.inject({}) do |h, loader| |
Loader.autoloaders.inject({}) do |h, loader| | ||
h.merge(loader.dirs(namespaces: true)) | ||
Rails.autoloaders.inject({}) do |h, autoloader| | ||
h.merge(autoloader.dirs(namespaces: true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
h.merge(autoloader.dirs(namespaces: true)) | |
h.merge(loader.dirs(namespaces: true)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loader is more correct here since those loaders can autoload or eagerload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why Rails uses autoloaders
naming then. 🤔 Will update!
I wasn't 100% sure if adding version constraints is a breaking change, that's why I suggested the conditional logic in the original PR. However, I think Rafael is correct, bundler should be able to decide if an app can meet the version constraint or not. Rails' constraint is |
Require Zeitwerk 2.6.1 so that we can always use the public introspection API to get application autoload paths.
efde788
to
f5d5af4
Compare
What are you trying to accomplish?
Followup on #251.
Require Zeitwerk 2.6.1 so that we can always use the public introspection API to get application autoload paths.
What approach did you choose and why?
The loader approach previously used was good, but if we can just require a later version of Zeitwerk, we don't need to write branching logic for each version.
What should reviewers focus on?
Is there any reason not to impose a minimum version of Zeitwerk for the gem?
Type of Change
Additional Release Notes
Include any notes here to include in the release description. For example, if you selected "breaking change" above, leave notes on how users can transition to this version.
If no additional notes are necessary, delete this section or leave it unchanged.
Checklist