-
Notifications
You must be signed in to change notification settings - Fork 531
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: More scope docs #23026
docs: More scope docs #23026
Conversation
packages/framework/fluid-framework/api-report/fluid-framework.legacy.public.api.md
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Coverage Summary
↑ packages.dds.tree.src.simple-tree.api:
Line Coverage Change: 0.09% Branch Coverage Change: 0.03%
Metric Name | Baseline coverage | PR coverage | Coverage Diff |
---|---|---|---|
Branch Coverage | 88.73% | 88.76% | ↑ 0.03% |
Line Coverage | 82.19% | 82.28% | ↑ 0.09% |
Baseline commit: d1ba184
Baseline build: 305646
Happy Coding!!
Code coverage comparison check passed!!
@@ -223,12 +223,36 @@ export class SchemaFactory< | |||
* If each library exporting schema picks its own globally unique scope for its SchemaFactory, | |||
* then all schema an application might depend on, directly or transitively, | |||
* will end up with a unique fully qualified name which is required to refer to it in persisted data and errors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't parse that block. What does this refer to? "require to refer" - what is the API / workflow that it refers to?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have rewritten this to be simpler so it's less of a toss up if you happen to parse the sentence in a way that works.
⯅ @fluid-example/bundle-size-tests: +245 Bytes
Baseline commit: d1ba184 |
* @remarks | ||
* Generally each library which is developed independently (possible a package, but could also be part of a package or multiple packages developed together) should get its own globally unique `scope`. | ||
* This ensures that the given library can name its schema (via the name parameter passed to the schema building methods, or implicitly for structurally named schema) | ||
* in a way that must only be unique within the library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't parse "library can name in a way that must be unique" part. The mix of "can" and "must" is weird to me (but maybe I do not get details of beautiful English language :))
I think you want to say that if two distinct types happen to have same runtime ID (which is schema factory ID + type ID) then really bad things would happen (maybe describe what happens and point to "help with debugging" article). In order for types to have unique runtime IDs, they need to ensure combination of factory schema ID + type ID is unique in a container.
Only after that intro, I'd give advice on usage of revers domain names - it's somewhat misplaced IMHO in the sequence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have simplified the grammar and reordered the docs accordingly. Should be better now.
Co-authored-by: Joshua Smithrud <[email protected]>
* Prefix appended to the identifiers of all {@link TreeNodeSchema} produced by this builder. | ||
* | ||
* @remarks | ||
* Generally each developed independently library (possibly a package, but could also be part of a package or multiple packages developed together) should get its own globally unique `scope`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably change order slightly.
I'd start with "These are joined ..." sentence.
Then say - resulting schema identifier uniquely defines type in Tree instance ("globally" is not right, as not clear what is the scope of "globe"). And if two different types (having different layout) get same schema identifier, then really bad things happen (might be worth pointing to what exactly happens - might be useful for OCEs).
Only then I'd move to guidance on how to choose SchemaFactory.scope.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Micrisoft (and some other users of GUIDs) likes to use "Global" to describe the scope in which identifiers which should never collide with anything else, for example https://learn.microsoft.com/en-us/previous-versions/windows/desktop/automat/globally-unique-identifier-guid-
I have rephrased the docs to avoid referring to global as it might not be obvious to people no subjected to using GUIDs all the time. I'm glad to know everyone is familiar with the term.
Also the identifier isn't for identifying types in a tree instance: we use the schema object identity for that. Instead its for associating schema with persisted data. The linked documentation on TreeNodeSchemaCore,identifier covers this, so I don't think adding details about it inline here is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Microsoft is just being honest - we promise to empower everyone on the planet to achieve more, but not everyone in the universe.
🔗 Found some broken links! 💔 Run a link check locally to find them. See linkcheck output
|
Description
More docs for SchemaFactory.scope.
Convert docs to other format for parameter properties so it can have its own subsections.
Reviewer Guidance
The review process is outlined on this wiki page.