-
Notifications
You must be signed in to change notification settings - Fork 535
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
refactor(shared-object-base): Improve typing in legacy+alpha API surface #23238
base: main
Are you sure you want to change the base?
refactor(shared-object-base): Improve typing in legacy+alpha API surface #23238
Conversation
Curious why there are no type validation test changes needed here? |
Great question, I hadn't thought of that. It seems to be the fact that TS just gives up on any kind of type validation whenever it sees an I confirmed by adding a small snippet with functions that change their inputs and outputs from unknown to any, and type tests for those don't complain either: |
packages/dds/ordered-collection/src/consensusOrderedCollection.ts
Outdated
Show resolved
Hide resolved
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
I'm remembering now - last I checked, the type tests' |
Yeah, good catch. Example 1 below shows that with a |
Description
Warning
This is intended to go into the 2.20 release because it includes breaking changes to the legacy+alpha API surface (tracking issue: #23236). Do not merge it before that.
Updates some types in the legacy+alpha API surface of the
@fluidframework/shared-object-base
package. Mostly improving type safety by replacingany
withunknown
, and a fewany
withvoid
where that was the correct type.Also updates some code in response to the changes above, like call sites of the affected APIs now having to do casts themselves instead of relying on the
any
they were getting before.Breaking Changes
The breaking changes affect only the legacy+alpha API surface.
Reviewer Guidance
The review process is outlined on this wiki page.
AB#26129