bpmn-io / bpmn-js-differ

A diffing utility for BPMN 2.0 documents.
44 stars 16 forks source link

Detect flow source / target changes #22

Closed nikku closed 1 month ago

nikku commented 1 month ago

Proposed Changes

The PR does not use plain object diffing for moddle elements, but rather uses the moddle meta-data to figure what is supposed to be diffed.

This ensures we're able to diff otherwise hidden references, too, such as Flow#target.

Closes https://github.com/bpmn-io/bpmn-js-differ/issues/18.

Checklist

To ensure you provided everything we need to look at your PR:

nikku commented 1 month ago

CC @nithinssabu

nikku commented 1 month ago

@nithinssabu via https://github.com/bpmn-io/bpmn-js-differ/pull/22/commits/7ffa85264743b9560683f815476ff97fd5a42b31 I sketched how a special differ, aware of moddle elements can be added to the diff utility. As discussed we may then want to use the moddle introspection utilities to iterate through all available properties.

nikku commented 1 month ago

Via https://github.com/bpmn-io/bpmn-js-differ/pull/22/commits/142c8b1dea79d5e9491cf15dc1f52e62443f81cf I sketch how the actual diffing would work; still two rough edges to sort out.

nikku commented 1 month ago

I moved this to review as it works good on my machine. Feedback welcome.

nikku commented 1 month ago

As discussed @philippfromme, please have a look.

nikku commented 1 month ago

This is relased as v3.0.0.

nithinssabu commented 3 weeks ago

This could have introduced a bug in the library. See https://github.com/camunda/web-modeler/pull/10621#issuecomment-2311946929

nithinssabu commented 3 weeks ago

This could have introduced a bug in the library. See camunda/web-modeler#10621 (comment)

Created a minimal reproducer. Just change the bpmn-js-differ versions between 2.0.2 and 3.0.0 to see the difference in changes count.

nikku commented 3 weeks ago

Thanks for the report and steps to reproduce @nithinssabu.

As always, let's create a new bug report and take it from there :arrow_right: https://github.com/bpmn-io/bpmn-js-differ/issues/24.