diff --git a/.changeset/afraid-rice-feel.md b/.changeset/afraid-rice-feel.md index 63ca8bc3ad60..e30f21219f3f 100644 --- a/.changeset/afraid-rice-feel.md +++ b/.changeset/afraid-rice-feel.md @@ -6,7 +6,7 @@ TreeAlpha.create now accepts unhydrated nodes [TreeAlpha.create](https://fluidframework.com/docs/api/fluid-framework/treealpha-interface#create-methodsignature) now accepts [unhydrated](https://fluidframework.com/docs/api/fluid-framework/unhydrated-typealias) nodes. -`TreeAlpha.create`'s documentation has been fixed to indicate support instead of being self contradictory about it. +`TreeAlpha.create`'s documentation has been updated to clarify that this is supported. Additionally `TreeAlpha.create` no longer throws a "Tree does not conform to schema" error when given a tree omitting an identifier. -Instead the identifier behaves like it would for other ways to build unhydrated nodes: remaining unreadable until hydrated. +Instead, the identifier behaves like it would for other ways to build unhydrated nodes: remaining unreadable until hydrated. diff --git a/.changeset/gentle-eggs-heal.md b/.changeset/gentle-eggs-heal.md index f3f3c317f0b1..70f0c4e1a888 100644 --- a/.changeset/gentle-eggs-heal.md +++ b/.changeset/gentle-eggs-heal.md @@ -2,7 +2,7 @@ "@fluid-experimental/tree-react-api": minor "__section": feature --- -New experimental objectIdNumber API has been added +New experimental objectIdNumber API -A new `objectIdNumber` has been added, which is handy when an identifier is needed which corresponds to an object identity. +A new `objectIdNumber` has been added, which is useful when you need an identifier which corresponds to an object identity. For example: when specifying a React "key" that corresponds to a `TreeNode`. diff --git a/.changeset/old-bees-itch.md b/.changeset/old-bees-itch.md index ad5045dd1778..728948ff0e4d 100644 --- a/.changeset/old-bees-itch.md +++ b/.changeset/old-bees-itch.md @@ -3,7 +3,7 @@ "@fluidframework/tree": minor "__section": tree --- -comparePersistedSchema (alpha) has had its canInitialize parameter removed +The comparePersistedSchema function (alpha) has had its canInitialize parameter removed [comparePersistedSchema](https://fluidframework.com/docs/api/tree/#comparepersistedschema-function) has had its `canInitialize` parameter removed. This parameter was only used to add to the output [SchemaCompatibilityStatus](https://fluidframework.com/docs/api/fluid-framework/schemacompatibilitystatus-interface). diff --git a/.changeset/public-houses-add.md b/.changeset/public-houses-add.md index 71ee6eae7849..99368da7fcd9 100644 --- a/.changeset/public-houses-add.md +++ b/.changeset/public-houses-add.md @@ -4,4 +4,6 @@ --- "getPresence(container: IFluidContainer): Presence" now supported -`getPresence` is now supported and may be used to directly acquire `Presence` instead of using `ExperimentalPresenceManager` in container schema and calling `getPresenceViaDataObject`. (Both of those are now deprecated.) +You can now use the `getPresence` function to directly acquire `Presence`. In previous releases, you were required to +use `ExperimentalPresenceManager` in container schema and calling `getPresenceViaDataObject`, but that is no longer +required. Both `ExperimentalPresenceManager` and `getPresenceViaDataObject` are now deprecated. diff --git a/.changeset/public-snakes-fetch.md b/.changeset/public-snakes-fetch.md index 748e3025c10f..5240268d30b4 100644 --- a/.changeset/public-snakes-fetch.md +++ b/.changeset/public-snakes-fetch.md @@ -6,7 +6,7 @@ TreeNodes now implicitly generate identifiers on access instead of throwing Accessing a defaulted [identifier](https://fluidframework.com/docs/api/fluid-framework/schemafactory-class#identifier-property) on an [Unhydrated](https://fluidframework.com/docs/api/fluid-framework/unhydrated-typealias) `TreeNode` no longer throws a usage error. -Instead a new UUID is allocated for the identifier and returned. +Instead, a new UUID is allocated for the identifier and returned. These UUIDs will be more compressible than random ones, since they all come from a single sequence (starting with a random UUID). They will not be fully compressed like the identifiers generated after hydration that leverage the document's [IIdCompressor](https://fluidframework.com/docs/api/id-compressor/iidcompressor-interface). diff --git a/.changeset/tabaxi-fellas-inspire.md b/.changeset/tabaxi-fellas-inspire.md index b225bc14b8ec..9e48394aca84 100644 --- a/.changeset/tabaxi-fellas-inspire.md +++ b/.changeset/tabaxi-fellas-inspire.md @@ -3,7 +3,7 @@ "@fluidframework/tree": minor "__section": tree --- -TableSchema (alpha) APIs have been added +New TableSchema (alpha) APIs A `TableSchema` utility has been added to Shared Tree for managing dynamic, tabular data. This new `TableSchema` namespace contains APIs for creating column, row, and table [node schema](https://fluidframework.com/docs/api/fluid-framework/treenodeschema-typealias). diff --git a/.changeset/tough-parts-kick.md b/.changeset/tough-parts-kick.md index 3262eb98ee85..19be9103a3ba 100644 --- a/.changeset/tough-parts-kick.md +++ b/.changeset/tough-parts-kick.md @@ -2,6 +2,7 @@ "@fluidframework/tree": minor "__section": feature --- -TreeAlpha.key2 API added +New TreeAlpha.key2 API -The `TreeAlpha.key2` method is meant to eventually replace the public `Tree.key` method. This new method now returns undefined in the case where there is a root node. +The `TreeAlpha.key2` method is meant to eventually replace the public `Tree.key` method. +This new method returns `undefined` in the case where there is a root node. diff --git a/.changeset/tricky-shrimps-hunt.md b/.changeset/tricky-shrimps-hunt.md index ca9bf7989e0c..abcc7a8d07cd 100644 --- a/.changeset/tricky-shrimps-hunt.md +++ b/.changeset/tricky-shrimps-hunt.md @@ -3,9 +3,10 @@ "@fluidframework/tree": minor "__section": feature --- -TreeAlpha identifier APIs for converting, retrieving, and generating identifiers have been added +New TreeAlpha identifier APIs for converting, retrieving, and generating identifiers #### TreeAlpha.identifier + You can retrieve the long identifier with `TreeAlpha.identifier(node)`, where `node` is a `TreeNode`. The long identifier is a stable, compressible UUID generated by the tree. In cases where the node does not yet have an identifier assigned, this will return `undefined`. These cases include: @@ -13,45 +14,56 @@ These cases include: - The node is a non-hydrated node with a user provided identifier. Note that if it is a non-hydrated node without an identifier provided, it will throw an error. #### TreeAlpha.identifier.shorten + You can shorten a long identifier with `TreeAlpha.identifier.shorten(branch, identifier)`, where `branch` is a `TreeBranch`, and `identifier` is a `string`. If the method returns a valid short identifier, this identifier can be passed into `TreeAlpha.identifier.lengthen` to get the original valid long `identifier` back. In the cases where it's not possible to shorten the `identifier`, it will return `undefined`. These cases include: + - A compressible long identifier, but it is unrecognized by the tree that the node belongs to. This can occur if the identifier is not generated from the tree. - An identifier which is not compressible by the tree. This can occur if the node's identifier was a user provided string. #### TreeAlpha.identifier.lengthen + You can lengthen a short identifier with `TreeAlpha.identifier.lengthen(branch, identifier)`, where `branch` is a `TreeBranch`, and `identifier` is a `number`. If the method returns a valid long identifier, this identifier can be passed into `TreeAlpha.identifier.shorten` to get the original `identifier` back. In the cases where it's not possible to lengthen the `identifier`, this method will throw an error. These cases include: + - An unrecognized short identifier. This can occur if the identifier is not generated from the tree. #### TreeAlpha.identifier.getShort + You can retrieve the short identifier from a node with `TreeAlpha.identifier.getShort(node)` where `node` is a `TreeNode`. If it is not possible to retrieve the short identifier, it will return `undefined` ##### Example for a node with valid identifier + ```typescript // This will retrieve the short identifier from the node. const shortIdentifier = TreeAlpha.identifier.getShort(nodeWithValidIdentifier) ``` ##### Examples for when you get undefined + In cases where the node provided does not contain an identifier that is recognized or compressible by the tree that the node belongs to, this method will return undefined. This will occur in the following cases: + - The node is an non-hydrated node with a user provided identifier. Note that if it is an non-hydrated node without an identifier provided, it will throw an error. - The node does not contain an identifier field. - The node contains a compressible long identifier, but it is unrecognized by the tree that the node belongs to. This can occur if the identifier is not generated from the tree. - The node contains an identifier which is not compressible by its id compressor. This can occur if the node's identifier was a user provided string. + ```typescript // This will return undefined const shortIdentifier = TreeAlpha.identifier.getShort(node) ``` #### TreeAlpha.identifier.create + You can create a long identifier from a branch with `TreeAlpha.identifier.create(branch)` where `branch` is a `TreeBranch`. + ```typescript const createdIdentifier = TreeAlpha.identifier.create(branch) ```