Skip to content

Shared Tree: In-memory format and API changes for persisted schema metadata #24759

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 67 commits into from
Jun 13, 2025

Conversation

TommyBrosman
Copy link
Contributor

@TommyBrosman TommyBrosman commented Jun 3, 2025

Adds in-memory format and API changes for the persisted schema metadata feature.

Changes

  • Add metadata fields to Tree*StoredSchema types
    • Node
    • Field
  • Add fields to in-memory format for persisted node/field schema metadata
    • Expose JsonCompatibleReadonlyObject as an alpha API so it can be used for the view schema format
  • SchemaFactory changes
    • Introduce or update alpha types in places where persisted metadata will be passed: NodeSchemaOptionsAlpha, FieldPropsAlpha, FieldSchemaAlpha, FieldSchemaMetadataAlpha
    • Update internal code to use the alpha types
    • Updated node APIs in SchemaFactoryAlpha to pass persistedMetadata associated with nodes
    • Updated field APIs in SchemaFactoryAlpha to take new types for specifying persistedMetadata associated with fields
    • Test coverage in schemaFactory.spec.ts for the new node schema and field schema APIs
  • simple-tree changes

Notes for reviewers

Todo

TommyBrosman and others added 30 commits May 12, 2025 14:59
- Added in-memory schema format v2.
- Implemented the schema format v2 codec.
- Updated test utils that previously assumed there was only one format.
- Added snapshots for many of the v2 tests.
…ion as a parameter.

- Fixed naming of schema index formats.
- Changed schemaChangeFormat to be schema format-agnostic.
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
… we want something more intuitive (e.g., minimum client version).

- Split the encode method for TreeNodeStoredSchema.
…cVersion.

- Changed schema-stored/FormatV2 to only define the new elements.
- Updated all instantiations of TreeFieldStoredSchema so that persistedMetadata is specified.
- HACK: importCompressed needs to handle both schema formats. A few of the roundtrip JSON tests are failing.
Co-authored-by: Alex Villarreal <716334+alexvy86@users.noreply.github.com>
- Made importCompressed always use a v1 schema when encoding.
- Added better test data to one of the codec tests for the v2 schema format.
@CraigMacomber
Copy link
Contributor

Including "Docs and PR description" in the list of changes in the PR description seems odd.

Generally, though, the changes are looking pretty good.

Copy link
Contributor

@Josmithr Josmithr left a comment

Choose a reason for hiding this comment

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

Approving for API changes. Would probably be good to get another tree signoff as well for the changes in the codec layers.

@TommyBrosman
Copy link
Contributor Author

Including "Docs and PR description" in the list of changes in the PR description seems odd.

Generally, though, the changes are looking pretty good.

Yeah, I accidentally kept it when I transplanted my checklist. Removed.

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

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

Crawling...

Stats:
  225443 links
    1710 destination URLs
    1941 URLs ignored
       0 warnings
       0 errors


@TommyBrosman TommyBrosman merged commit dc14950 into microsoft:main Jun 13, 2025
35 checks passed
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 public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants