Contents
- 🌳 SharedTree DDS Changes
- Fix false positive error from FormatValidator (#26372)
- Improve error messages when failing to construct nodes (#26388)
- New beta ExtensibleUnionNode API (#26438)
🌳 SharedTree DDS Changes
Fix false positive error from FormatValidator (#26372)
Users of the alpha API FormatValidatorBasic could hit an "Invalid JSON." error when parsing data. This would occur where the result of evaluating "MinimumVersionForCollab < 2.74.0" differed between the client encoding the data and the client decoding it. For example opening an old document with a new client that sets MinimumVersionForCollab = 2.74.0 would throw this error. This has been fixed: this case will no longer throw.
Change details
Commit: adad917
Affected packages:
- @fluidframework/tree
- fluid-framework
⬆️ Table of contents
Improve error messages when failing to construct nodes (#26388)
The error messages when constructing tree nodes have been improved. Several cases now list not only the schema identifiers, but also schema names which can help when there are identifier collisions and make it easier to find the implementations. Additionally some cases which did not include what schema were encountered and which were allowed now include both.
Change details
Commit: 862a65e
Affected packages:
- @fluidframework/tree
- fluid-framework
⬆️ Table of contents
New beta ExtensibleUnionNode API (#26438)
The new ExtensibleUnionNode API allows for creation of unions which can tolerate future additions not yet known to the current code.
const sf = new SchemaFactoryBeta("extensibleUnionNodeExample.items");
class ItemA extends sf.object("A", { x: sf.string }) {}
class ItemB extends sf.object("B", { x: sf.number }) {}
class AnyItem extends ExtensibleUnionNode.createSchema(
[ItemA, ItemB], // Future versions may add more members here
sf,
"ExtensibleUnion",
) {}
// Instances of the union are created using `create`.
const anyItem = AnyItem.create(new ItemA({ x: "hello" }));
// Reading the content from the union is done via the `union` property,
// which can be `undefined` to handle the case where a future version of this schema allows a type unknown to the current version.
const childNode: ItemA | ItemB | undefined = anyItem.union;
// To determine which member of the union was present, its schema can be inspected:
const aSchema = Tree.schema(childNode ?? assert.fail("No child"));
assert.equal(aSchema, ItemA);Change details
Commit: 05f716f
Affected packages:
- fluid-framework
- @fluidframework/tree
⬆️ Table of contents
🛠️ Start Building Today!
Please continue to engage with us on GitHub Discussion and Issue pages as you adopt Fluid Framework!