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

Add Zeitwerk autoloader #42

Open
solnic opened this issue Jul 1, 2022 · 2 comments
Open

Add Zeitwerk autoloader #42

solnic opened this issue Jul 1, 2022 · 2 comments

Comments

@solnic
Copy link
Member

solnic commented Jul 1, 2022

No description provided.

@Ptico
Copy link
Collaborator

Ptico commented Mar 14, 2023

I'm looking at the implementation in other gems and have a question: would it work if we will make zeitwerk a soft dependency?

I mean, for the zeitwerk environments it's already added to Gemfile, so we may do something like:

require "zeitwerk" rescue nil

class Inflector 

  if defined?(Zeitwerk)
    def self.loader
      # ...
    end
  end

If so, the power of Zeitwerk will be added without introducing new dependencies for those who don't need it

@solnic
Copy link
Member Author

solnic commented Mar 15, 2023

This wouldn't be enough. We'd also have to make explicit requires optional depending on the presence of Zeitwerk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Icebox
Development

No branches or pull requests

2 participants