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

feat(tree): Add the ability to associate metadata with Node Schema #23321

Merged
merged 60 commits into from
Dec 23, 2024

Conversation

Josmithr
Copy link
Contributor

@Josmithr Josmithr commented Dec 12, 2024

Users of TreeView can now specify metadata when creating Node Schema, via SchemaFactoryAlpha.
This metadata may include system-understood properties like description.

Example:

const schemaFactory = new SchemaFactoryAlpha(...);
class Point extends schemaFactory.object("Point", {
	x: schemaFactory.required(schemaFactory.number),
	y: schemaFactory.required(schemaFactory.number),
},
{
	metadata: {
		description: "A point in 2D space",
	},
}) {}

Josmithr and others added 30 commits December 12, 2024 21:25
@github-actions github-actions bot added the area: examples Changes that focus on our examples label Dec 19, 2024

// NOTE that there is currently a bug with the ai-collab library that requires us to rearrange the keys of each type to not have the same first key.

export class SharedTreeTask extends sf.object("Task", {
title: sf.required(sf.string, {
export class SharedTreeTask extends sf.object(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note: I've added node-level metadata to these schemas, and fixed some typos. But otherwise, most of these changes are whitespace. If you toggle the "Hide whitespace" option in the GitHub UI, these will be easier to review.

@Josmithr Josmithr marked this pull request as ready for review December 20, 2024 22:49
@Josmithr Josmithr requested review from a team as code owners December 20, 2024 22:49
@Josmithr Josmithr requested a review from noencke December 20, 2024 22:51
Copy link
Contributor

@jzaffiro jzaffiro left a comment

Choose a reason for hiding this comment

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

Docs look good (pending your TODO)!

Copy link
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> [email protected] 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"


> [email protected] serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> [email protected] check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  170142 links
    1596 destination URLs
    1825 URLs ignored
       0 warnings
       0 errors


@Josmithr Josmithr merged commit 58619c3 into microsoft:main Dec 23, 2024
32 checks passed
@Josmithr Josmithr deleted the tree/node-schema-metadata-3 branch December 23, 2024 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: contributor experience area: dds: tree area: dds Issues related to distributed data structures area: examples Changes that focus on our examples area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: main PRs targeted against main branch changeset-present public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants