json icon indicating copy to clipboard operation
json copied to clipboard

Correct equality check on oneOf decoders for virtual DOM diffing.

Open rupertlssmith opened this issue 2 years ago • 1 comments

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

rupertlssmith avatar Mar 11 '22 17:03 rupertlssmith

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.

ggPeti avatar May 10 '23 14:05 ggPeti