Closed ikitommi closed 1 year ago
meta-merge
mimics the functionality in Leiningen, so it does whatever Leiningen's merge logic does.
Ok. I still think this is not correct. What do you think? Instead of having forks/copies that change/add the original Leiningen functionality, could there be a 2.0.0 with the duct-addons and fixes for things like this?
Are you asking this to be changed in Duct or changed in meta-merge?
in meta-merge. Would be good if there wasn't 3 (meta-merge, duct and reitit) bit different meta-merge syntaxes out there.
Changing the behavior of meta-merge would mean that there would be four different meta-merge syntaxes, since meta-merge the library would diverge from the implementation in Leiningen.
There seem to be explicit cases for nil
in the code, so I'd like to know why they were put in place before changing them. There's also the problem that this behavior change would make meta-merge incompatible with Leiningen's profile merging.
It might be a better idea to try to get this behavior changed in Leiningen first. Or at least ask why profiles are merged in such a manner.
Had a discussion about this in the #leiningen slack. Changing that could break anything, so not likely going to happen. I guess same applies here, so I guess the alternatives are:
1) create a meta-merge 2.0 with this change (and maybe other new stuff from duct)
2) I inline a ctrl-merge
impl into reitit with this change (and maybe others from duct)
I would be much happier with the 1 option. What do you think?
I'd need to consider the consequences of changing meta-merge's behaviour in this case. I don't think I'll have time in the near future to do that and create a meta-merge 2.0. It might happen, but not within the next few months.
Ok. I'll re-visit how mandatory & far reaching this is in reitit (would require a major version bump anyway) - if it is, will go with 2 and switch back to meta-merge2 when/if it gets implemented.
Big thanks for making meta-merge a separate library, using it in all the projects now, a fundamental library and superior to the various deep-merge impls out there.
I forked meta-merge to add the missing features I need. I'll ping you @weavejester when it's done, happy to PR changes back here if you think it could it could be part of meta-merge2.
https://github.com/metosin/ctrl-merge/blob/master/CHANGELOG.md
I could create a meta-merge2.core
namespace to implement these breaking changes, but I think it makes more sense to keep meta-merge
as it is and instead develop a new library instead. This means meta-merge maintains backward compatibility, but new libraries are free to extend and improve upon meta-merge.
That makes sense, thanks. Closing this.
Should
nil
values be merged like normal merge does, e.g. last value wins?