-
Notifications
You must be signed in to change notification settings - Fork 532
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
tree: Const schema type parameters, more tests tree and misc cleanups #22927
Merged
+248
−40
Merged
Changes from all commits
Commits
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ import { getUnhydratedContext } from "../createContext.js"; | |
* @remarks | ||
* This is "concise" meaning that explicit type information is omitted. | ||
* If the schema is compatible with {@link ITreeConfigurationOptions.preventAmbiguity}, | ||
* types will be lossless and compatible with {@link TreeBeta.create} (unless the options are used to customize it). | ||
* types will be lossless and compatible with {@link TreeAlpha.create} (unless the options are used to customize it). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. neither of these links works yet, but this is the API thats getting added in #22566 |
||
* | ||
* Every {@link TreeNode} is an array or object. | ||
* Any IFluidHandle values have been replaced by `THandle`. | ||
|
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
33 changes: 33 additions & 0 deletions
33
packages/dds/tree/src/test/snapshots/chunked-forest-schema-compressed/hasAmbiguousField.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"version": 1, | ||
"identifiers": [], | ||
"shapes": [ | ||
{ | ||
"c": { | ||
"type": "test.hasAmbiguousField", | ||
"value": false, | ||
"fields": [ | ||
[ | ||
"field", | ||
2 | ||
] | ||
] | ||
} | ||
}, | ||
{ | ||
"c": { | ||
"type": "test.minimal", | ||
"value": false | ||
} | ||
}, | ||
{ | ||
"d": 0 | ||
} | ||
], | ||
"data": [ | ||
[ | ||
0, | ||
1 | ||
] | ||
] | ||
} |
29 changes: 29 additions & 0 deletions
29
packages/dds/tree/src/test/snapshots/chunked-forest-schema-compressed/hasRenamedField.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"version": 1, | ||
"identifiers": [], | ||
"shapes": [ | ||
{ | ||
"c": { | ||
"type": "test.hasRenamedField", | ||
"value": false, | ||
"fields": [ | ||
[ | ||
"stored-name", | ||
1 | ||
] | ||
] | ||
} | ||
}, | ||
{ | ||
"c": { | ||
"type": "test.minimal", | ||
"value": false | ||
} | ||
} | ||
], | ||
"data": [ | ||
[ | ||
0 | ||
] | ||
] | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/dds/tree/src/test/snapshots/schema-files/hasAmbiguousField.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"version": 1, | ||
"nodes": { | ||
"test.hasAmbiguousField": { | ||
"object": { | ||
"field": { | ||
"kind": "Value", | ||
"types": [ | ||
"test.minimal", | ||
"test.minimal2" | ||
] | ||
} | ||
} | ||
}, | ||
"test.minimal": { | ||
"object": {} | ||
}, | ||
"test.minimal2": { | ||
"object": {} | ||
} | ||
}, | ||
"root": { | ||
"kind": "Value", | ||
"types": [ | ||
"test.hasAmbiguousField" | ||
] | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/dds/tree/src/test/snapshots/schema-files/hasRenamedField.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": 1, | ||
"nodes": { | ||
"test.hasRenamedField": { | ||
"object": { | ||
"stored-name": { | ||
"kind": "Value", | ||
"types": [ | ||
"test.minimal" | ||
] | ||
} | ||
} | ||
}, | ||
"test.minimal": { | ||
"object": {} | ||
} | ||
}, | ||
"root": { | ||
"kind": "Value", | ||
"types": [ | ||
"test.hasRenamedField" | ||
] | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
packages/dds/tree/src/test/snapshots/simple-tree-storedSchema/hasAmbiguousField.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"version": 1, | ||
"nodes": { | ||
"test.hasAmbiguousField": { | ||
"object": { | ||
"field": { | ||
"kind": "Value", | ||
"types": [ | ||
"test.minimal", | ||
"test.minimal2" | ||
] | ||
} | ||
} | ||
}, | ||
"test.minimal": { | ||
"object": {} | ||
}, | ||
"test.minimal2": { | ||
"object": {} | ||
} | ||
}, | ||
"root": { | ||
"kind": "Value", | ||
"types": [ | ||
"test.hasAmbiguousField" | ||
] | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
packages/dds/tree/src/test/snapshots/simple-tree-storedSchema/hasRenamedField.json
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"version": 1, | ||
"nodes": { | ||
"test.hasRenamedField": { | ||
"object": { | ||
"stored-name": { | ||
"kind": "Value", | ||
"types": [ | ||
"test.minimal" | ||
] | ||
} | ||
} | ||
}, | ||
"test.minimal": { | ||
"object": {} | ||
} | ||
}, | ||
"root": { | ||
"kind": "Value", | ||
"types": [ | ||
"test.hasRenamedField" | ||
] | ||
} | ||
} |
Oops, something went wrong.
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.
When combined with the recent corrections to schema variance, this change improves handling of passing array literals to this function as the schema for a union, since it removes the need to specify "as const" at the call site.