Skip to content
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

docs(tree): split shared tree doc into more specialized pages #23380

Merged
merged 6 commits into from
Dec 27, 2024

Conversation

jenn-le
Copy link
Contributor

@jenn-le jenn-le commented Dec 19, 2024

This change splits up content on the tree page on the fluid framework website into subpages and changes the current page into an introductory page that links to the more detailed subpages. This change is not meant to make any significant changes to the current content and is instead, mainly an organizational change.

  • moves node type, schema definition, and reading/editing info out of main shared tree doc
  • updates some headers and links

@Copilot Copilot bot review requested due to automatic review settings December 19, 2024 21:09

Choose a reason for hiding this comment

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

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

Files not reviewed (4)
  • docs/docs/data-structures/tree/node-types.mdx: Language not supported
  • docs/docs/data-structures/tree/reading-and-editing.mdx: Language not supported
  • docs/docs/data-structures/tree/schema-definition.mdx: Language not supported
  • docs/docs/start/tree-start.mdx: Language not supported
@github-actions github-actions bot added area: website base: main PRs targeted against main branch labels Dec 19, 2024
@agarwal-navin
Copy link
Contributor

  • moves node type, schema definition, and reading/editing info out of main shared tree doc
  • updates some headers and links

note: the "other" section is meant to be reorganized in future PRs but is created to make it a smooth transition

Can you provide some context on why you are doing this and what are the docs supposed to look like?
As of now, I see that on the tree section on ff.com, there is just one page. Are you planning to make it a folder with the main page pointing to sub-folders? Or something else?

@@ -0,0 +1,44 @@
---
title: Events
sidebar_position: 4
Copy link
Contributor

Choose a reason for hiding this comment

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

There is another page with the same sidebar_position.

sidebar_position: 1
---

Information is stored on a [SharedTree](./index.mdx) in the form of tree nodes.
Copy link
Contributor

Choose a reason for hiding this comment

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

Does information mean the same as the data in the shared tree? I guess I am not sure what's the difference is between this line and the first line in node_types.mdx. Do they mean the same thing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

They do, I changed this so that it's not duplicated.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's okay for it to be duplicated if it makes it less confusing.


import { PackageLink } from "@site/src/components/shortLinks";

A `SchemaFactory` object is created by passing a unique string such as a UUID to the constructor.
Copy link
Contributor

Choose a reason for hiding this comment

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

You should add some context here on what this doc is about. It starts talking about schemaFactory which seems kind of abrupt.

Additionally, all changes in a transaction will be reverted together as a single unit by [undo/redo code](./undo-redo.mdx), because changes within a transaction are exposed through a single `Revertible` object.
It is also more efficient for SharedTree to process a large number of changes in a row as a transaction rather than as changes submitted separately.

To create a transaction use the `Tree.runTransaction()` method. You can cancel a transaction from within the callback function by returning the special "rollback object", available via `Tree.runTransaction.rollback`. Also, if an error occurs within the callback, the transaction will be canceled automatically before propagating the error.
Copy link
Contributor

@agarwal-navin agarwal-navin Dec 24, 2024

Choose a reason for hiding this comment

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

Note that there is a new API for transaction - TreeViewAlpha:runTransaction.

So, this section needs to be updated. Maybe in a follow-up PR.


If you want the `SharedTree` to treat a set of changes atomically, wrap these changes in a transaction.
Using a transaction guarantees that (if applied) all of the changes will be applied together synchronously (though, note that the Fluid Framework guarantees this already for any sequence of changes that are submitted synchronously). However, the changes may not be applied at all if the transaction is given one or more constraints.
If any constraint on a transaction is not met, then the transaction and all its changes will ignored by all clients.
Copy link
Contributor

Choose a reason for hiding this comment

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

It also needs to include a section about nested transactions similar to how it is described here.

jenn-le and others added 3 commits December 27, 2024 20:59
Co-authored-by: Navin Agarwal <45832642+agarwal-navin@users.noreply.github.com>
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:
  170486 links
    1603 destination URLs
    1838 URLs ignored
       0 warnings
       0 errors


@jenn-le jenn-le merged commit cd34c30 into microsoft:main Dec 27, 2024
33 checks passed
@jenn-le jenn-le deleted the schema-def-page branch December 27, 2024 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: website base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants