-
Notifications
You must be signed in to change notification settings - Fork 534
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: Add alpha tree configuration APIs #22701
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
14162e9
Add alpha tree configuration APIs
CraigMacomber fe8daec
Add note about public APi
CraigMacomber f728197
Merge branch 'main' into AlphaConfig
CraigMacomber fa6c729
Merge branch 'main' into AlphaConfig
CraigMacomber b601566
docs
CraigMacomber 53d1395
Merge branch 'main' into AlphaConfig
CraigMacomber 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
"fluid-framework": minor | ||
"@fluidframework/tree": minor | ||
--- | ||
--- | ||
"section": tree | ||
--- | ||
|
||
Add alpha API for providing SharedTree configuration options | ||
|
||
A new alpha `configuredSharedTree` had been added. | ||
This allows providing configuration options, primarily for debugging, testing and evaluation of upcoming features. | ||
The resulting configured `SharedTree` object can then be used in-place of the regular `SharedTree` imported from `fluid-framework`. | ||
|
||
```typescript | ||
import { | ||
ForestType, | ||
TreeCompressionStrategy, | ||
configuredSharedTree, | ||
typeboxValidator, | ||
} from "@fluid-framework/alpha"; | ||
// Maximum debuggability and validation enabled: | ||
const SharedTree = configuredSharedTree({ | ||
forest: ForestType.Expensive, | ||
jsonValidator: typeboxValidator, | ||
treeEncodeType: TreeCompressionStrategy.Uncompressed, | ||
}); | ||
// Opts into the under development optimized tree storage planned to be the eventual default implementation: | ||
const SharedTree = configuredSharedTree({ | ||
forest: ForestType.Optimized, | ||
}); | ||
``` |
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
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
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.
Given that we default to V3 (thus dubbing it our actual "V1") and that we do not support documents in V1 (and maybe V2?), how would you feel about only exposing V3?
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.
My instinct is this is a foot-gun, otherwise.
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.
Personally I think we should just expose a single framework wide enum which lists every framework minor version which had an opt in compat impacting change, and its value of v2.0 would map to v3 in our internal format numbers.
Fixing that is mostly orthogonal to this change.
That said, if someone has legacy documents (from before 2.0), and wants to generate test documents so they can ensure their old production documents will continue to work, these extra option might be useful to them.
Since this is just alpha, I think we can sort out these details later, but I do agree this isn't want we want long term and/or when this goes public.
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.
Note that we haven't done the work needed to create separate public vs internal configuration, but as long as these are targeted at alpha / debugging usage I think it may be better to keep using the internal types here rather than adding all the complexity needed to create distinct public API configuration, at least for now.
I have added a TODO to the APi's private remarks. I'll let API reviewers decide if they want to block exposing these as alpha on that work.
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.
What happens if you set this to V1? Do we support writing legacy documents (which are immediately broken/unsupported)? I thought we only support writing N and N-1.
I'll agree that allowing V2 writing seems fine for the (possibly nonexistent) customers that want to test support for that, but exposing V1 at all seems very strange to me. @noencke thoughts?
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.
(regardless, I did approve and don't think this needs to block this since it's alpha)
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.
If we don't support V1 then I don't see why we'd expose V1, but exposing V2 makes sense for now, particularly since this is alpha.
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.
Should we leave some of the context from this discussion in
@privateRemarks
in the code for future reference?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.
Is there something more you want beyond what's already in fe8daec ?
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.
Oh, no, I didn't see that. Looks good to me!