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: More scope docs #23026

Merged
merged 5 commits into from
Nov 9, 2024
Merged

docs: More scope docs #23026

merged 5 commits into from
Nov 9, 2024

Conversation

CraigMacomber
Copy link
Contributor

@CraigMacomber CraigMacomber commented Nov 7, 2024

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.

@CraigMacomber CraigMacomber requested review from a team as code owners November 7, 2024 22:09
@github-actions github-actions bot added area: dds Issues related to distributed data structures area: dds: tree area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct public api change Changes to a public API base: main PRs targeted against main branch labels Nov 7, 2024
Copy link
Collaborator

@msfluid-bot msfluid-bot left a 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 NameBaseline coveragePR coverageCoverage 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.
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@msfluid-bot
Copy link
Collaborator

msfluid-bot commented Nov 7, 2024

@fluid-example/bundle-size-tests: +245 Bytes
Metric NameBaseline SizeCompare SizeSize Diff
aqueduct.js 463.74 KB 463.77 KB +35 Bytes
azureClient.js 562.69 KB 562.74 KB +49 Bytes
connectionState.js 724 Bytes 724 Bytes No change
containerRuntime.js 261.99 KB 262 KB +14 Bytes
fluidFramework.js 426.65 KB 426.66 KB +14 Bytes
loader.js 134.18 KB 134.19 KB +14 Bytes
map.js 42.71 KB 42.71 KB +7 Bytes
matrix.js 148.32 KB 148.33 KB +7 Bytes
odspClient.js 528.43 KB 528.48 KB +49 Bytes
odspDriver.js 97.84 KB 97.86 KB +21 Bytes
odspPrefetchSnapshot.js 42.81 KB 42.83 KB +14 Bytes
sharedString.js 164.17 KB 164.17 KB +7 Bytes
sharedTree.js 417.11 KB 417.11 KB +7 Bytes
Total Size 3.36 MB 3.36 MB +245 Bytes

Baseline commit: d1ba184

Generated by 🚫 dangerJS against 03031e9

* @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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

* 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`.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

@CraigMacomber CraigMacomber enabled auto-merge (squash) November 9, 2024 02:16
Copy link
Contributor

github-actions bot commented Nov 9, 2024

🔗 Found some broken links! 💔

Run a link check locally to find them. See
https://github.com/microsoft/FluidFramework/wiki/Checking-for-broken-links-in-the-documentation for more information.

linkcheck output


> [email protected] ci:linkcheck /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test ci:start 1313 linkcheck:full

1: starting server using command "npm run ci:start"
and when url "[ 'http://127.0.0.1:1313' ]" is responding with HTTP status code 200
running tests using command "npm run linkcheck:full"


> [email protected] ci:start
> http-server ./public --port 1313 --silent


> [email protected] linkcheck:full
> npm run linkcheck:fast -- --external


> [email protected] linkcheck:fast
> linkcheck http://localhost:1313 --skip-file skipped-urls.txt --external

Crawling...

http://localhost:1313/docs/start/tree-start/
- (3430:89) 'here' => https://github.com/microsoft/FluidFramework/blob/main/packages/dds/tree/docs/main/merge-semantics.md (HTTP 404)


Stats:
  443666 links
    3413 destination URLs
       2 URLs ignored
       0 warnings
       1 errors

 ELIFECYCLE  Command failed with exit code 1.

@CraigMacomber CraigMacomber merged commit 5405422 into microsoft:main Nov 9, 2024
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: dds: tree area: dds Issues related to distributed data structures area: framework Framework is a tag for issues involving the developer framework. Eg Aqueduct base: main PRs targeted against main branch public api change Changes to a public API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants