-
Notifications
You must be signed in to change notification settings - Fork 541
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
Move Json domain from test to internal #23043
Conversation
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:
Line Coverage Change: -6.14% Branch Coverage Change: No change
Metric Name | Baseline coverage | PR coverage | Coverage Diff |
---|---|---|---|
Branch Coverage | 100.00% | 100.00% | → No change |
Line Coverage | 100.00% | 93.86% | ↓ -6.14% |
Baseline commit: aa84db1
Baseline build: 305550
Happy Coding!!
Code coverage comparison check failed!!
More Details: Readme
- Skip This Check!!
What to do if the code coverage check fails:
-
Ideally, add more tests to increase the code coverage for the package(s) whose code-coverage regressed.
-
If a regression is causing the build to fail and is due to removal of tests, removal of code with lots of tests or any other valid reason, there is a checkbox further up in this comment that determines if the code coverage check should fail the build or not. You can check the box and trigger the build again. The test coverage analysis will still be done, but it will not fail the build if a regression is detected.
-
Unchecking the checkbox and triggering another build should go back to failing the build if a test-coverage regression is detected.
-
You can check which lines are covered or not covered by your tests with these steps:
- Go to the PR ADO build.
- Click on the link to see its published artifacts. You will see an artifact named
codeCoverageAnalysis
, which you can expand to reach to a particular source file's coverage html which will show which lines are covered/not covered by your tests. - You can also run different kind of tests locally with
:coverage
tests commands to find out the coverage.
* ``` | ||
* @alpha | ||
*/ | ||
export const JsonUnion = [() => JsonObject, () => JsonArray, ...JsonPrimitive] as const; |
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.
My vote would be to call this Json
or JsonTree
. The term "Union", while correct, is more mechanical than it is semantic.
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 don't think having a top level package export called Json is a great idea. JS already has JSON, and our package has lots of Json related stuff other than this. JsonTree also seems questionable as VerboseTree and ConciseTree are both Json tree formats, and this is nothing like them. If changing this, I'd lean in the direction of making it more explicitly not named like that.
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.
If we want to be more careful / explicit with the naming, we could possibly do something like JsonDomainTree
. I agree that JsonUnion
doesn't really convey the semantics we want here.
But of the existing suggestions, I like JsonTree
the best personally.
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 don't think JsonDomain really does it either. Its perfectly reasonable to think of VerboseTree and ConciseTree as projections of trees into the JSON domain. This format on the other hand isn't even a JSON style object since it uses maps for objects.
Maybe JsonAsTree
for JsonUnion, and JsonObjectAsTree for JsonObject?
Another approach would be to go with a namespace. Since everything in it needs the same release tag, I think we can make that work. In that case maybe JsonDomain, with a big doc comment on the namespace, would work, then the members could have short names like Object, Union/Tree, Array, etc.?
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 think namespaces will break re-exports in fluid-framework
😕
microsoft/rushstack#4807
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.
Or, well, maybe not, since we're generating our own rollups now. I'm not sure.
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.
But I do like namespaces for things like this. JsonAsTree
also seems reasonable to me.
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 think this is a good addition to our available toolset.
We may want to consider writing a short guide on how to use this domain (kind of like the examples you provided, but a little more comprehensive) and which also clarifies how this "JSON" domain is a different thing than merely the fact that a SharedTree's data is, to some degree, natively compatible with "JSON" in its API and exposed data model - to avoid any confusion. That's something we can think about later, when this API is promoted to beta.
Co-authored-by: Noah Encke <[email protected]>
🔗 Found some broken links! 💔 Run a link check locally to find them. See linkcheck output
|
## Description Export Json domain as internal. This is a step toward making it alpha, but that will involve more tweaking of naming/scoping. This makes it easy for users to embed JSON content in their trees. This could be followed up with a similar domain for fluid serializable content which is the same but allows handles: this will be needed for map -> tree adapters.
Description
Export Json domain as internal. This is a step toward making it alpha, but that will involve more tweaking of naming/scoping.
This makes it easy for users to embed JSON content in their trees.
This could be followed up with a similar domain for fluid serializable content which is the same but allows handles: this will be needed for map -> tree adapters.
Reviewer Guidance
The review process is outlined on this wiki page.