kommitters / editorjs-undo

Undo/Redo feature for Editor.js
https://www.npmjs.com/package/editorjs-undo
MIT License
163 stars 50 forks source link

Implement usage of the jsondiffpatch library #254

Closed juliandsg0222 closed 3 weeks ago

juliandsg0222 commented 3 weeks ago

Context

Currently, editorjs-undo is undergoing a refactoring process to address the various bugs that have appeared over time and to improve its performance regarding memory consumption and block updates when performing undo and redo actions.

As a first step, we plan to use the jsondiffpatch library, allowing us to capture only the affected blocks in each user interaction through the diff function. Additionally, we will obtain the type of operation with jsonpatchFormatter and maintain the integrity of the editor's basic data with the patch and unpatch functions. We also saw the need to update how we managed data within the this.stack array, switching to one stack for undo actions and another for redo actions. Once this is completed, we will have finished the first part of the refactoring and will continue with the creation of the core functions that update the editor's blocks.

Objective