json
json copied to clipboard
Correct equality check on oneOf decoders for virtual DOM diffing.
This fixes the equality check on oneOf decoders, and this solution will work with 0.19.1 in --optimize mode, or without --optimize.
The problem can be seen in this Ellie, the oneOf
decoder there captures stale state from the model, as the vdom diffing fails to detect that it has changed:
https://ellie-app.com/3HKzFLVbBhxa1
Fixes these issues:
https://github.com/elm/json/issues/15 https://github.com/elm/core/issues/904
This PR was adapted from the original PR (now closed):
https://github.com/elm/core/pull/905
Please merge and release this finally @evancz. The PR has been open for 5 and a half years now and people will keep wasting their time debugging unless a fix is released.