-
Notifications
You must be signed in to change notification settings - Fork 475
fix: replace deprecated deep-assign with lodash merge #601
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
Conversation
Hey @dylmye We've already had an attempt at changing this dependency, but (as far as I remember) the problem is that different libraries produce different merge results, so we decided to drop idea of changing. I'd ideally have one version of "deep-merge" used, but it's tricky due to the fact the implementation of If we were to apply that change, I'd release it as a breaking change. What do you think @tido64 ? |
Glad to hear JS is being JS. It would just seem in my humble opinion that a breaking change with a maintained package would be a safe bet for the future of this package. Or an internal implementation. |
@krizzu: Do you remember what exactly is different with |
Just ran few tests to see the differences between Merging two objects:
Should gives us final object with What I found also interesting, is array overriding, where items are not merged together, but rather have their items replaces at indexes. So in our example, (both libs) gives the array Said that, I think we're good to use |
Is this something that should be included in the PR? Happy to make those changes |
@krizzu: Just for my own understanding, merging the following objects: const test1 = {
prop: 'hello!',
};
const test2 = {
prop1: undefined,
}; Should return: const testMerged = {
prop: 'hello!',
}; Correct? If |
Yes, exactly.
Yeah, I guess we agree on getting this merged anyway, but I'll inform about this potential breaking change in release notes. @dylmye can we also have this used in the |
Sorry to leave this for so long! Implemented in tests as you requested @krizzu . CI windows broken:
|
Sorry about that. I've got a PR to renew the certificate here: #633 |
The certificate issue should be fixed now. CI should pass if you rebase on latest. |
@dylmye do you need any help here? |
I'm on holiday for the next few weeks, sorry about the hold up |
@dylmye: Do you have time to finish this? Should one of us take over this PR? @krizzu: It seems that the other suggestion, merge-options, is a much smaller and more up-to-date implementation of merge. Should we consider using it instead? |
@tido64 sounds good. |
Superseded by #657. Let us know if you're seeing issues. |
Sorry to not get back about this @tido64 - glad to see it progressed. Thanks everyone who helped out! |
Summary
Replace deep-assign with lodash.merge, as per #374. I understand it's better to use actively maintained packages because it's more likely people already have the package installed, and because if there are any security issues there's a better chance they'll be handled. I know 'if it ain't broke, don't fix it' but this also removes the deprecated warning many people get in their install process.
Other changes:
endOfLine
option to prettier rc to avoid this:Test Plan
yarn build e2e:android
doesn't work on my Windows machine, I'll test on my Mac when I next can. Behaviour should be the same minus some small edge cases.