Skip to content
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

CommandStack should be serializable #478

Open
PabloDons opened this issue Aug 10, 2020 · 1 comment
Open

CommandStack should be serializable #478

PabloDons opened this issue Aug 10, 2020 · 1 comment
Labels
backlog Queued in backlog enhancement New feature or request

Comments

@PabloDons
Copy link

Is your feature request related to a problem? Please describe.

When trying to implement editor specific features, having the ability to edit the commandStack is a very useful feature. There are already undo and redo methods, but no restoration of a stack from external sources, like backups. A very common feature generally considered a requirement for modern editors is the ability to restore dirty states without saving.

Describe the solution you'd like

The commandStack should be serializable so that a set of changes can be restored from a backup/cache, including restoring commandStack history.

Describe alternatives you've considered

Overwriting the commandStack module is an approach I could look into, but plugins shouldn't change core functionality due to compatibility issues. However other than that it would be a very reasonable approach.

I have thought about monitoring the _stack member and editing it externally along with any other relevant members, however this can cause unexpected results as it is not intended usage and therefore not well documented.

Additional context

I do recognize that command contexts are complex javascript objects and may not always be serializable, so adding a requirement to make it serializable is a breaking change. However I would still suggest this because I would argue scope dependent callbacks can and should always be avoided, especially since the context is supposed to be static. Also it would only be a breaking change if serialize and deserialize methods were used, which could be labeled unstable instead.

@PabloDons PabloDons added the enhancement New feature or request label Aug 10, 2020
@pinussilvestrus
Copy link
Contributor

pinussilvestrus commented Sep 3, 2020

Thanks for reporting! That's a valid feature request. We also heard in the past, that serializing the command would be very helpful. One another usage would be collaboration across multiple editors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Queued in backlog enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants