Updating SharedTree's public transaction docs#26564
Conversation
There was a problem hiding this comment.
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
| ); | ||
| ``` | ||
|
|
||
| If transactions are nested, only the outermost transaction's label is used. |
There was a problem hiding this comment.
Nit: this makes sense, but it took me a minute to reason out why. I wonder if it would be worth noting the why.
There was a problem hiding this comment.
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
|
|
||
| ### Nested Transactions | ||
|
|
||
| `runTransaction` and `runTransactionAsync` can be called from within the callback of another transaction, with some limitations. Nested transactions have the following behavior: |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
I think it's technically possible to put it all into one API, but I'm not 100% on that
…dFramework into jumyhre/docUpdate
Josmithr
left a comment
There was a problem hiding this comment.
Left a couple more nitpicks, but overall looks good to me! Thanks for adding this great documentation!
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
1 similar comment
|
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output |
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
This PR updates the docs for SharedTree's transaction API. It adds: