-
Notifications
You must be signed in to change notification settings - Fork 534
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
fix: Empty ObjectNode type safety #23162
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.
⯅ @fluid-example/bundle-size-tests: +245 Bytes
Baseline commit: 9a8f69a |
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
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.
Left a couple of questions but overall, this looks like a great safety improvement!
Description
ObjectNodes with no fields will now emit a compiler error if constructed from an object literal with fields.
This matches the behavior of non-empty ObjectNodes which already gave errors when unexpected properties were provided.
Also adds an "unsound union properties" test demoing a type soundness issue which impacts tree but is a limitation of TypeScript which Tree can no workaround.
Breaking Changes
Any code which constructed object nodes with no fields from object literals with fields should have those fields removed as they have no impact at runtime.
Reviewer Guidance
The review process is outlined on this wiki page.