8000 refactor(tree): Update table schema APIs to use `SchemaFactoryBeta` by Josmithr · Pull Request #25613 · microsoft/FluidFramework · GitHub
[go: up one dir, main page]

Skip to content

Conversation

Josmithr
Copy link
Contributor
@Josmithr Josmithr commented Oct 3, 2025

One in a sequence of steps promoting dependencies of TableSchema to beta so that TableSchema itself can be promoted to beta in the near future.

Update TableSchema to take a SchemaFactoryBeta instead of SchemaFactoryAlpha.

Promotes SchemaFactoryObjectOptions.allowUnknownOptionalFields to beta (SchemaFactoryObjectOptions is promoted to beta, but its other aspects remain alpha via the new SchemaFactoryObjectOptionsAlpha type).

@Josmithr Josmithr requested review from a team as code owners October 3, 2025 21:53
@Copilot Copilot AI review requested due to automatic review settings October 3, 2025 21:53
@github-actions github-actions bot added base: main PRs targeted against main branch area: dds Issues related to distributed data structures area: dds: tree area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct changeset-present public api change Changes to a public API labels Oct 3, 2025
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors TableSchema APIs to use SchemaFactoryBeta instead of SchemaFactoryAlpha, promoting dependencies to beta to prepare for TableSchema's own beta promotion.

  • Updates TableSchema internal functions to use SchemaFactoryBeta
  • Promotes SchemaFactoryObjectOptions from alpha to beta
  • Adds objectBeta method to SchemaFactoryBeta for better object schema creation

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/dds/tree/src/tableSchema.ts Updates all internal table schema creation functions to use SchemaFactoryBeta instead of SchemaFactoryAlpha
packages/dds/tree/src/simple-tree/api/schemaFactoryBeta.ts Adds new objectBeta method to SchemaFactoryBeta class
packages/dds/tree/src/simple-tree/api/schemaFactory.ts Promotes SchemaFactoryObjectOptions to beta and creates alpha-specific version
API report files Updates type signatures and exports to reflect the schema factory changes
Export files Adds exports for new SchemaFactoryObjectOptionsAlpha interface
Changeset file Documents the API changes and their impact

/* TConstructorExtra */ never,
/* TCustomMetadata */ TCustomMetadata
> {
// The compiler can't infer that UnannotateSchemaRecord<T> is equal to T so we have to do a bunch of typing to make the error go away.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment doesn't apply as you are not supporting annotated allowed types. You shouldn't be using UnannotateSchemaRecord below.

You might be better off waiting for #25595 and/or basing this implementation of the public version and adding the beta stuff rather than trying to remove all the other alpha stuff from it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thought that might be the case. I'll rework this. But it can also wait. Either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this same pattern and documentation exists in SchemaFactory.object as well.

* @input
* @alpha
*/
export interface SchemaFactoryObjectOptionsAlpha<TCustomMetadata = unknown>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for reviewers: everything that was in SchemaFactoryObjectOptions is kept alpha via this new type except allowUnknownOptionalFields, which is made beta.


// @beta @input
export interface SchemaFactoryObjectOptions<TCustomMetadata = unknown> extends NodeSchemaOptions<TCustomMetadata> {
readonly allowUnknownOptionalFields?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stabilizing of allowUnknownOptionalFields to beta is a big deal, and deserves to be mentioned in the PR title and a changeset of its own.

I think there might be some lack of clarity still around how exactly that the semantics are for SchemaCompatibilityStatus.isEquivalent, SchemaCompatibilityStatus.canUpgrade and TreeView.upgradeSchema.

I'd like more clarity around how these interact with allowUnknownOptionalFields: currently neither those APIs nor SchemaFactoryObjectOptions.allowUnknownOptionalFields document the intended interactions, and I'm not sure if they are well tested either.

This area of our API (schema upgrade and compat) is particularly confusing at the moment with allowUnknownOptionalFields, staged and persisted metadata all breaking the old semantics.

I think we should have some real dedicated review and more specific targeted stabilization PR for this topic (and land some better docs first)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CraigMacomber @taylorsw04 do we have anything filed for clarifying / stabilizing this? I think it's important the table schema be able to leverage this feature so we have some flexibility for future additions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Work now tracked by https://dev.azure.com/fluidframework/internal/_workitems/edit/49975

I've converted this PR to a draft until that work is completed.

@Josmithr Josmithr marked this pull request as draft October 6, 2025 22:14
Copy link
Contributor
github-actions bot commented Oct 8, 2025

🔗 Found some broken links! 💔

Run a link check locally to find them. See
https://github.com/microsoft/FluidFramework/wiki/Checking-for-broken-links-in-the-documentation for more information.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

 ELIFECYCLE  Command failed with exit code 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: dds: tree area: dds Issues related to distributed data structures area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: main PRs targeted against main branch changeset-present public api change Changes to a public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

2A64
0