-
-
Notifications
You must be signed in to change notification settings - Fork 274
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
Single-update undo/redo #1374
Merged
Merged
Single-update undo/redo #1374
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
1575413
Use drafts, remove throttling
apedroferreira ee45df3
Forgot one dom
apedroferreira 9a8d071
Merge remote-tracking branch 'origin/master' into atomic-undo-redo
apedroferreira a3bb650
Fix types
apedroferreira 28d5799
Try not using nested functions
apedroferreira 6b332f7
Atomic column normalization
apedroferreira 4c667d8
Use draft page nodes
apedroferreira 65e7e7f
Fix element removal
apedroferreira a157576
Merge remote-tracking branch 'origin/master' into atomic-undo-redo
apedroferreira ea42bfb
Fix moving elements
apedroferreira 4ae076d
Re-add throttling
apedroferreira d5f6b69
Remove some domAPI methods
apedroferreira 6bc3985
Merge remote-tracking branch 'origin/master' into atomic-undo-redo
apedroferreira 0237579
Fix type errors
apedroferreira d7a5664
Hide selected node while dragging new node
apedroferreira 1e3722e
Merge remote-tracking branch 'origin/master' into atomic-undo-redo
apedroferreira 892e2ec
Fix not being able to drop in selected node when dragging new node
apedroferreira 203070d
Merge remote-tracking branch 'origin/master' into atomic-undo-redo
apedroferreira 34f59a1
Merge remote-tracking branch 'origin/master' into atomic-undo-redo
apedroferreira baabb44
Remove batching test
apedroferreira ab64a1c
Debounce text input changes (#1459)
apedroferreira 8c10a84
Merge remote-tracking branch 'origin/master' into atomic-undo-redo
apedroferreira 1f7779e
Use updater function in DOM API updates
apedroferreira 5d1fd30
Readd method
apedroferreira 1d8b49e
Merge remote-tracking branch 'origin/master' into atomic-undo-redo
apedroferreira File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙂 I think this is why I suggested to use a function in
domApi.update
. This callback invalidates on every dom change, and it's also not 100% sure it will get the lastdom
. e.g. imagine a function:Those would get the same initial version of
dom
, meaning only one connection is added. While I would expect to have two connections. It would be different ifThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it work to restore and use methods such as
domApi.setNodeNamespacedProp
(which I had deleted) in cases like this?And use
domApi.update
as I'm using it but only when a temporary DOM is needed?domApi.update
replaces the whole DOM anyway so in those cases maybe it's fine?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still thinking of better alternatives, your proposal does seem more "atomic", it's just more difficult to use in
RenderOverlay
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll try supporting
domApi.update((draft) => ...
and use it as much as possible where I can, except in the few cases where it's hard to use, I think that should be possible.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can support both methods, like
Also, wouldn't necessarily recommend it, but nothing prevents you from doing:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I was able to use an updater function everywhere after all!
Commit: 1f7779e
After the refactoring I had made in
RenderOverlay
I guess it wasn't so difficult there.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this PR is using the updater function now I will merge this part already!