-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Remove ActiveSupport dependency? #903
Comments
@cllns thanks for opening this issue. For a while, we'd avoided including AS because of the same reasons you'd mentioned. We've obviously become more lax on this, and I think you bring up a good point about assessing whether it's a necessary dependency. Looking through the source for some of those files, I don't think it makes sense right now to introduce similar behavior while avoiding AS - that's a significant amount of code that has the risk of being outdated, buggy, or otherwise needs maintenance over time. The overhead cost of doing that versus leveraging an existing gem is very high. Were there a community-adopted alternative that didn't rely on reopening classes, it makes sense to consider introducing it given it was actively-maintained and widely-used, across all the versions of Ruby we support. |
Thanks for the quick and thoughtful response @joshuaclayton. Hanami::Utils offers some of the functionality that's needed (like inflectors), but not all of it. Also, it only supports MRI 2.2, MRI 2.3 and JRuby. |
Bummer that some is missing - for the 5.0 release of FG/FGR, I'm planning on dropping support for MRI Ruby below the latest 2.2.x; however, I think we should continue to push towards RBX compatibility, at least for FG 5.0. Again, thanks for putting forth the investigative work on this! |
Now that I'm looking into it, I think all the Note: the 'require' links to where lines where the methods are called. in lib/factory_girl/evaluator.rb
In lib/factory_girl/factory.rb
In lib/factory_girl.rb
Historically, I can reach out to see if they'd want to support Rubinius again, if you're interested in converting |
Ping @joshuaclayton (figured you didn't see my response since this Issue is closed) |
@cllns thanks again for the work here. I've thought about this and believe it makes sense to continue with ActiveSupport. The largest is due to developer adoption and use of AS itself. For both developers who are interested in contributing to FG and for those who're interested in understanding what the library does, seeing a library that's not AS would likely be confusing and increase cognitive load ("What is Hanami?", "Why is AS avoided?", "Does Hanami (or another tool) do something different/better than AS that I should further source dive?"). Secondarily, as most developers using this are doing so within the context of a Rails application, introducing another dependency doesn't seem worth it. I understand the size aspects of AS, but it's also a safe, trusted, widely adopted piece of software that is working as expected. Thanks again for bringing this up for consideration; I truly appreciate it. I'm going to leave the issue closed. |
Thanks @joshuaclayton, I completely understand. Personally, I think adding another dependency for vast majority of users is the more compelling argument. Making people question |
Here are the ActiveSupport dependencies in FactoryGirl:
For Rails apps, using ActiveSupport is a no-brainer since it's already required.
For other Ruby apps, ActiveSupport is a pretty big dependency. (Granted, only for testing, but it's still there)
I can work to remove the dependency on ActiveSupport. Is that a worthwhile effort? Are you interested in a PR that does that?
Things like ActiveSupport::Notifications can still be supported, by just checking if they're defined at the top of the file.
(The concrete use-case for this is several of us in the Hanami Gitter chat would like to use FactoryGirl but don't want to add ActiveSupport, since it monkey-patches)
Thanks!
The text was updated successfully, but these errors were encountered: