feat: Document delta updates (DH-18090)#1119
Merged
Merged
Conversation
- Have a dehydrated document that the changes are applied to, then hydrate afterwards
Closed
|
ui docs preview (Available for 14 days) |
mattrunyon
requested changes
Feb 20, 2025
- Wire up NodeEncoder and EventEncoder to use it - Add tests for it as well
mattrunyon
requested changes
Feb 24, 2025
Collaborator
mattrunyon
left a comment
There was a problem hiding this comment.
Looking pretty good. Just a few minor things
Comment on lines
+135
to
+145
| def _transform_node(self, key: str, value: Any): | ||
| if isinstance(value, RenderedNode): | ||
| return self._convert_rendered_node(value) | ||
| elif callable(value): | ||
| return self._convert_callable(value) | ||
| elif not is_serializable(value): | ||
| # This is a non-serializable object. We'll store a reference to the object in the objects array. | ||
| return self._convert_object(value) | ||
| else: | ||
| # Just return the value itself, it should be serializable | ||
| return value |
Collaborator
There was a problem hiding this comment.
There is an edge case here (that we probably don't need to support) if a dict has non-serializable keys. With the previous code this would hit the except block. Here we'd end up returning a dict with non-serializable keys which would fail to serialize later.
Like I said it probably doesn't matter though as I don't think we should support complex keys
Member
Author
There was a problem hiding this comment.
Yea in theory I suppose the transform_node should take an Any instead of just a str for the key... though I don't think we want to support that.
- Change name of is_serializable function/functionality - Clean up some other areas
|
ui docs preview (Available for 14 days) |
mattrunyon
approved these changes
Feb 26, 2025
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
DHLog.setLogLevel(10), then filtering ondocumentUpdated