Skip to content

Updating SharedTree's public transaction docs#26564

Merged
jumyhre merged 11 commits intomainfrom
jumyhre/docUpdate
Mar 25, 2026
Merged

Updating SharedTree's public transaction docs#26564
jumyhre merged 11 commits intomainfrom
jumyhre/docUpdate

Conversation

@jumyhre
Copy link
Copy Markdown
Contributor

@jumyhre jumyhre commented Feb 26, 2026

This PR updates the docs for SharedTree's transaction API. It adds:

  • A brief explanation of the new TreeAlpha runTransaction API, and what benefits it provides over the old API
  • Snippets for new API use, including async forms and transaction nesting
  • A section on Constraints and their usage

Copy link
Copy Markdown
Contributor

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 updates the documentation for SharedTree's transaction API, removing the old TODO and adding comprehensive documentation for the new alpha-level transaction APIs. The changes introduce examples and explanations for the TreeBranchAlpha.runTransaction and TreeViewAlpha.runTransaction methods, which provide more control over error handling compared to the legacy Tree.runTransaction API.

Changes:

  • Removed the TODO comment about updating the transaction API documentation
  • Added detailed documentation for the new alpha transaction APIs including synchronous and asynchronous forms
  • Documented transaction nesting behavior and constraints functionality

Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx
Comment thread docs/docs/data-structures/tree/transactions.mdx
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
);
```

If transactions are nested, only the outermost transaction's label is used.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: this makes sense, but it took me a minute to reason out why. I wonder if it would be worth noting the why.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i'm leaning weakly towards no, just because I'm in favor of keeping the doc succinct, but i'm open to it if we think this is important info for API consumers

Comment thread docs/docs/data-structures/tree/transactions.mdx
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx

### Nested Transactions

`runTransaction` and `runTransactionAsync` can be called from within the callback of another transaction, with some limitations. Nested transactions have the following behavior:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

These are obviously existing APIs, so this isn't feedback for this PR or anything, but I'm curious: would it be possible to make the async variation of this be an overload of runTransaction? Do we actually need 2 different function names?

Copy link
Copy Markdown
Contributor Author

@jumyhre jumyhre Mar 23, 2026

Choose a reason for hiding this comment

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

I think it's technically possible to put it all into one API, but I'm not 100% on that

Comment thread docs/docs/data-structures/tree/transactions.mdx
Comment thread docs/docs/data-structures/tree/transactions.mdx
Comment thread docs/docs/data-structures/tree/transactions.mdx
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Comment thread docs/docs/data-structures/tree/transactions.mdx Outdated
Copy link
Copy Markdown
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.

Left a couple more nitpicks, but overall looks good to me! Thanks for adding this great documentation!

@jumyhre jumyhre enabled auto-merge (squash) March 25, 2026 18:15
@jumyhre jumyhre merged commit cc2bd27 into main Mar 25, 2026
28 checks passed
@jumyhre jumyhre deleted the jumyhre/docUpdate branch March 25, 2026 18:35
@github-actions
Copy link
Copy Markdown
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:
  272202 links
    1863 destination URLs
    2108 URLs ignored
       0 warnings
       0 errors


1 similar comment
@github-actions
Copy link
Copy Markdown
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:
  272202 links
    1863 destination URLs
    2108 URLs ignored
       0 warnings
       0 errors


agarwal-navin pushed a commit to agarwal-navin/FluidFramework that referenced this pull request Apr 13, 2026
This PR updates the docs for SharedTree's transaction API. It adds:

- A brief explanation of the new TreeAlpha runTransaction API, and what
benefits it provides over the old API
- Snippets for new API use, including async forms and transaction
nesting
- A section on Constraints and their usage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants