-
Notifications
You must be signed in to change notification settings - Fork 549
fix(client-presence): move validated State objects to internal #24888
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
base: main
Are you sure you want to change the base?
fix(client-presence): move validated State objects to internal #24888
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.
Pull Request Overview
This pull request refactors the creation of presence State objects by moving validated (raw) state implementations to an internal API.
- Refactors factory functions to use StateFactoryInternal instead of StateFactory.
- Updates test imports and usage accordingly.
- Adjusts API definitions and documentation in the public API reports.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/framework/presence/src/test/schemaValidation.spec.ts | Test updates to import and use StateFactoryInternal instead of the public API. |
packages/framework/presence/src/test/latestValueManager.spec.ts | Updated test cases using StateFactoryInternal for latest state creation. |
packages/framework/presence/src/test/latestMapValueManager.spec.ts | Updated test cases using StateFactoryInternal for latestMap state creation. |
packages/framework/presence/src/stateFactory.ts | Refactored exports to expose internal state factory methods and updated documentation comments. |
packages/framework/presence/src/latestValueManager.ts | Adjusted factory function overloads and error handling for validator usage. |
packages/framework/presence/src/latestMapValueManager.ts | Updated overload signatures and helper function for argument casting. |
packages/framework/presence/src/index.ts | Modified type re-exports to remove deprecated types from the public API. |
packages/framework/presence/api-report/* | Synchronized API report documentation with internal state changes. |
.changeset/green-poets-run.md | Removed changeset details reflecting breaking changes to the validator parameter. |
Comments suppressed due to low confidence (6)
packages/framework/presence/src/latestValueManager.ts:329
- [nitpick] Consider adding a TODO or inline comment noting the planned timeline for validator support to aid future maintenance.
}
packages/framework/presence/src/test/schemaValidation.spec.ts:14
- [nitpick] Ensure test cases fully cover the new StateFactoryInternal usage, particularly in scenarios where validator behavior might be extended in the future.
import { StateFactoryInternal } from "../stateFactory.js";
packages/framework/presence/src/stateFactory.ts:28
- Update the documentation comment to clearly indicate that StateFactory re-exports internal APIs to prevent accidental exposure of raw validated state behaviors.
export const StateFactory: {
packages/framework/presence/src/latestMapValueManager.ts:680
- [nitpick] Add an inline comment in or above the usableArgsType function to clarify its purpose for casting validator arguments, improving maintainability.
const validator = usableArgsType(args)?.validator;
packages/framework/presence/src/index.ts:51
- Verify that deprecating the export of LatestMapArguments and LatestArguments does not adversely affect existing consumers, and update migration guides as necessary.
// LatestMapArguments,
Some validation related type remain exposed as the *Raw types reference them.
fc23770
to
b5e7b85
Compare
/** | ||
* Factory for creating a {@link Latest} or {@link LatestRaw} State object. | ||
*/ | ||
export const StateFactoryInternal = { | ||
latest, | ||
|
||
/** | ||
* Factory for creating a {@link LatestMap} or {@link LatestMapRaw} State object. | ||
*/ |
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.
These comments didn't actually go anywhere. Moved to remarks in overall variable.
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
Some validation related type remain exposed as the *Raw types reference them.