-
Notifications
You must be signed in to change notification settings - Fork 535
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
Conversation
@@ -149,6 +152,27 @@ function getCodecVersions(formatVersion: number): ExplicitCodecVersions { | |||
return versions; | |||
} | |||
|
|||
export function buildConfiguredForest( |
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.
This refactor, and splitting out ForestOptions do not strictly have to be part of this change, but are required for the intended use of some of these APIs in #22566 , and seems small and related enough to include here.
⯅ @fluid-example/bundle-size-tests: +441 Bytes
Baseline commit: 0dc54b2 |
} | ||
|
||
// @alpha | ||
export const SharedTreeFormatVersion: { |
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.
Should we leave some of the context from this discussion in
@privateRemarks
in the code for future reference?
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!
@@ -793,6 +821,12 @@ export class SchemaFactory<out TScope extends string | undefined = string | unde | |||
readonly string: TreeNodeSchema<"com.fluidframework.leaf.string", NodeKind.Leaf, string, string>; | |||
} | |||
|
|||
// @alpha | |||
export interface SchemaValidationFunction<Schema extends TSchema> { | |||
// (undocumented) |
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.
Docs? :)
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.
It has a @returns
doc comment. I guess that doesn't work well with our tooling so I'll make it a "Returns" instead.
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.
Done.
@@ -149,6 +152,27 @@ function getCodecVersions(formatVersion: number): ExplicitCodecVersions { | |||
return versions; | |||
} | |||
|
|||
export function buildConfiguredForest( |
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.
Docs? :)
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.
Done.
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
## Description See changeset for details. Based on changes from #22566
Description
See changeset for details.
Based on changes from #22566
Reviewer Guidance
The review process is outlined on this wiki page.