Add a static fromChanges method to ChangeSet class #24
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "add-static-method-to-change-set"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
If we want to create a ChangeSet from a deserialized Change list we need to have a way to pass the changes to the constructor.
Currently the constructor is marked @internal So adding this method.
What's wrong with calling
ChangeSet.create(...).addSteps(...)?For a large document there can be too many steps. To avoid fetching all those steps we decided to save the
Change[]in db. This way we can load the the list and createChangeSetand apply the recentStep[]on top.Ah, I see, you're asking for a direct serialization format. But it appears
SpanandChangealso don't export their constructors. Could you take a look at attached patch and let me know whether it'd solve your problem?I like the symmetry in your patch with serializing Nodes and Steps. This would serve our use case nicely and avoid needing to extend the types with declaration merging in our app.
I made a comment for the patch. In summary the question is: how should we pass the optional parameters?
Pass
undefinedif you don't want to pass a non-default value.Thanks you. That would do!
I can confirm these changes work well with a vendored copy of this patch in our codebase.
I've published a version 2.4.0
Pull request closed