bpmn-js-differ icon indicating copy to clipboard operation
bpmn-js-differ copied to clipboard

Detect flow source / target changes

Open nikku opened this issue 1 year ago • 4 comments

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:

  • [x] Brief textual description of the changes present
  • [ ] Visual demo attached
  • [ ] Steps to try out present, i.e. using the @bpmn-io/sr tool
  • [x] Related issue linked via Closes {LINK_TO_ISSUE} or Related to {LINK_TO_ISSUE}

nikku avatar Jul 25 '24 13:07 nikku

CC @nithinssabu

nikku avatar Jul 25 '24 13:07 nikku

@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 avatar Jul 25 '24 16:07 nikku

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 avatar Jul 25 '24 17:07 nikku

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

nikku avatar Jul 26 '24 07:07 nikku

As discussed @philippfromme, please have a look.

nikku avatar Aug 14 '24 13:08 nikku

This is relased as v3.0.0.

nikku avatar Aug 15 '24 09:08 nikku

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

nithinssabu avatar Aug 27 '24 09:08 nithinssabu

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.

nithinssabu avatar Aug 27 '24 10:08 nithinssabu

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.

nikku avatar Aug 27 '24 11:08 nikku