-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discussion]Utility method to create json diff commands #51
Comments
Or should we consider instead a special json diff command wich aligns everything directly on the server side ? |
Hi @vhemery , |
Right, I agree that a client-side utility/library for simplifying the mapping from form updates to model server commands would be great -- otherwise this code will get replicated over and over again. However, I think this utility needs to support custom commands too, as this tends to get a popular use case. So clients should be able to specify custom commands for particular changes. |
Thanks for bringing that up @vhemery ! |
I will close this issue as this should be part of the new package that is to be created specifically for the theia tree editor. Maybe any more concerns or comments can be discussed there: eclipse-emfcloud/theia-tree-editor#34 |
In my application, I ended up with some code quite similar to
https://github.com/eclipse-emfcloud/coffee-editor/blob/573830104d9ad541568e6b46f8b3359e8dd0948d/web/coffee-editor-extension/src/browser/coffee-tree/coffee-tree-editor-widget.tsx#L232
(except I use the newer command API, have more comments and minor differences)
I guess any implementation using json forms will have to, at some point, implement such a method to align the modified json with the original by building and executing commands.
Which makes me wonder : shouldn't we provide a utility method wich builds on its own all the commands, rather than letting each user re-implement this ?
I'm not 100% sure all the possible cases are correctly handled here... so maybe there is extra work to perform to make such a utility method. Also, it would probably nice to have an extra configuration attribute to either build the commands for modifications directly on the concerned element or to deep-check for differences in element's children.
Does anyone have extra considerations to bring on this matter ?
The text was updated successfully, but these errors were encountered: