-
Notifications
You must be signed in to change notification settings - Fork 549
build(client): Update changesets for clarity and concision #24712
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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 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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,55 +3,67 @@ | |
"@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 | ||
|
||
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. Should we enable |
||
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: | ||
- The node does not contain an identifier field. | ||
- 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) | ||
``` |
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.
Uh oh!
There was an error while loading. Please reload this page.