adds optional options argument; adds deepmerge to options#4
adds optional options argument; adds deepmerge to options#4apeltz wants to merge 4 commits intosynacor:masterfrom
Conversation
|
@developit @pl12133 this may be a solution looking for a problem, but addresses conflicts in which a non-primative prop is passed to a consuming component by multiple wrappers, and the consuming component would like the resulting prop to be a merged version |
|
@apeltz Totally forgot about this, I can review tomorrow. This is definitely an issue which creates very unexpected behavior so I might even prefer skipping |
|
To summarize the problem here: You create a So far so good, your Component gets an The problem surfaces when a component somewhere else in the tree adds additional keys to the nested object: Now, you may be expecting that However by adding As far as default behavior goes, it's extremely confusing. 👻 Rather than adding an option to disable it, I think we should probably move forward with a |
|
I forgot about this until now. Is this something we still think is useful? @pl12133 @Aneurysm9 |
|
Yup, we should definitely get this merged. I'm thinking mostly we just need to test it on some existing components and see if it breaks anything. |
|
Agreed with @pl12133 - the current behaviour was never meant to handle returning merged objects, only leaf values. |
|
It should be merged as a major semver update since it's breaking anyway. Then we can selectively update components to validate that nothing is broken or patch what is? |
|
Interestingly @billneff79 might have found a way to solve this at the |
|
@pl12133 some updates in this latest commit:
|
|
@pl12133 I added some test cases that are more readable and also fixed an error in a docblock example use case I had. @billneff79 's synacor/preact-context-provider#3 does provide a path to accomplish the same thing that the functionality here does, but this addition will allow us to continue to use preconf as we currently are while without an additional provider wrapper. |
|
I believe this solves a similar, but different problem to synacor/preact-context-provider#3.
Part of me leans toward #3 as I find the default functionality redundant with the new capabilities provided by |
|
Going to close this PR after discussions with @billneff79 resulted in a new approach. |
|
To be clear, I think our new approach will be to take the functionality that preconf provides and move it more generically into a new function in |
No description provided.