-
-
Notifications
You must be signed in to change notification settings - Fork 232
feat: make deep_merge a soft-requirement
#367
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
base: master
Are you sure you want to change the base?
Conversation
The goal here is to remove deep_merge and rely entirely on ActiveSupport's `Hash#deep_merge` implementation. This does mean that if you want to keep the existing behavior, or rely on DeepMerge's specific options, you need to add the following to your Gemfile: ```ruby gem 'deep_merge', '~> 1.2', '>= 1.2.1' ```
60fcabd to
85d692e
Compare
|
I think it's fine to relay on
All of that would be a good change (less deps is typically better), but require significant changes and I am not 100% sure if it's worth it? @cjlarose what do you think? |
deep_merge a soft-requirementdeep_merge a soft-requirement
|
@Nuzair46 what do you think about this one? |
| begin | ||
| gem 'deep_merge', '~> 1.2', '>= 1.2.1' | ||
| require 'deep_merge/core' | ||
| rescue LoadError |
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 think here like @pkuczynski said, it is better to raise an error if deep_merge is not available in a non Rails codebase. Since this gem is can be used in any ruby codebase, it is better to warn for Rails and raise error for non rails app if it is not available. Imo if ActiveSupport deep_merge cannot support all the features of this gem, it might not be worth modifying the code to disable those features. It might be worth keeping this dependency for better DX.
The goal here is to remove deep_merge and rely entirely on ActiveSupport's
Hash#deep_mergeimplementation.This does mean that if you want to keep the existing behavior, or rely on DeepMerge's specific options, you need to add the following to your Gemfile:
@pkuczynski Opening this as a proof-of-concept, would you be willing to take on this type of change?
I decided not to touch the config methods, even though they are no-op when
deep_mergegem isn't included. Wanted to get feedback first, and I figure the warning is enough.