Skip to content

feat(aqueduct): Tree-based PureDataObject implementation #23943

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 97 commits into from
Mar 21, 2025

Conversation

Josmithr
Copy link
Contributor

@Josmithr Josmithr commented Feb 27, 2025

Adds a new (internal) PureDataObject implementation backed by a SharedTree, rather than a SharedDirectory.

This implementation was partially derived from an existing prototype in tree-react-api. That package and the example built on it (inventory-app) have been updated to utilize these APIs.

AB#29396

@Josmithr Josmithr requested a review from CraigMacomber March 20, 2025 21:07
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
@Josmithr Josmithr requested a review from a team as a code owner March 20, 2025 22:13
@Josmithr Josmithr requested a review from CraigMacomber March 20, 2025 22:18
Comment on lines 8 to 15
Update data object APIs to leverage new SharedTree-based data object class

Rather than leveraging a classic `DataObject` with a `SharedDirectory` at the root, and a `SharedTree` beneath, the library now leverages a new data object class that uses the `SharedTree` directly at the root.
Results in some simplifications to this package's APIs which are breaking.
Namely,
- Removes the `key` property from the data object configuration.
This key was used to inform where the SharedTree was parented beneath the root SharedDirectory, so it no longer serves a purpose.
- Inlined the `ITreeDataObject` interface into `IReactTreeDataObject`.
Copy link
Contributor

Choose a reason for hiding this comment

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

This will show up in two places based on our release process: the changelog of the package (its fine for that) and the release notes for the client release this lands in.

I think the phrasing here needs to be made a bit more specific, so it makes sense in that context.

Also this description covers a bit too much internal implementation details for a customer facing release.

Suggested change
Update data object APIs to leverage new SharedTree-based data object class
Rather than leveraging a classic `DataObject` with a `SharedDirectory` at the root, and a `SharedTree` beneath, the library now leverages a new data object class that uses the `SharedTree` directly at the root.
Results in some simplifications to this package's APIs which are breaking.
Namely,
- Removes the `key` property from the data object configuration.
This key was used to inform where the SharedTree was parented beneath the root SharedDirectory, so it no longer serves a purpose.
- Inlined the `ITreeDataObject` interface into `IReactTreeDataObject`.
Simplify experimental tree data object implementation
The experimental tree data object from `tree-react-api` are incompatible with their previous version which used a `DataObject` with a `SharedDirectory` at the root.
The library now leverages a new data object that uses the `SharedTree` directly at the root.
In addition to breaking compatibility with existing documents, This resulted in some simplifications to the APIs which are also breaking:
- Removes the `key` property from the data object configuration.
This key was used to specify where the SharedTree was parented beneath the root SharedDirectory.
- Inlined the `ITreeDataObject` interface into `IReactTreeDataObject`.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good feedback. I made some adjustments to your suggestion, so let me know what you think of the final wording.

Copy link
Contributor

🔗 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

Crawling...

http://localhost:3000/docs/data-structures/tree
- (36:97) 'the Shar..' => http://localhost:3000/docs/api/tree (HTTP 404)

http://localhost:3000/docs/data-structures/tree/
- (36:97) 'the Shar..' => http://localhost:3000/docs/api/tree (HTTP 404)

http://localhost:3000/docs/data-structures/tree/schema-definition
- (30:128) 'SharedTr..' => http://localhost:3000/docs/api/tree (HTTP 404)

http://localhost:3000/docs/start/tree-start
- (44:4) 'the API ..' => http://localhost:3000/docs/api/tree/schemafactory-class (HTTP 404)
- (61:7) 'the API' => http://localhost:3000/docs/api/tree/treechangeevents-interface (HTTP 404)


Stats:
  162291 links
    1317 destination URLs
    1549 URLs ignored
       0 warnings
       3 errors

 ELIFECYCLE  Command failed with exit code 1.

@Josmithr Josmithr enabled auto-merge (squash) March 20, 2025 23:26
@Josmithr Josmithr merged commit 00a56b7 into microsoft:main Mar 21, 2025
39 checks passed
@Josmithr Josmithr deleted the aqueduct/tree-data-object branch March 21, 2025 17:09
jikim-msft added a commit that referenced this pull request May 14, 2025
…hema and tree inspection (#24593)

#### Relevant PR

[23943](#23943)
[24523](#24523)

#### Description
This change introduces a `sharedTree: ITree` accessor to the
`TreeDataObject` class, enabling direct access to the underlying
`SharedTree` instance used internally.

**Motivation**:
While building support for visualizing `TreeDataObject` components in
Fluid Devtools, it became evident that accessing the raw `SharedTree`
instance and its schema is essential for rendering accurate and
meaningful visualizations. Previously, this access was only internal to
the object, limiting flexibility in advanced inspection or debugging
workflows.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dev experience Improving the experience of devs building on top of fluid area: examples Changes that focus on our examples area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct area: tests Tests to add, test infrastructure improvements, etc base: main PRs targeted against main branch changeset-present dependencies Pull requests that update a dependency file public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants