-
Notifications
You must be signed in to change notification settings - Fork 562
refactor(client-presence): split files for encapsulated support #26322
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?
refactor(client-presence): split files for encapsulated support #26322
Conversation
1. Separate types from implementation files origin -> new types location ------------------------------- latestValueManager.ts -> latestTypes.ts latestMapValueManager.ts -> latestMapTypes.ts 2. Separate implementation `createValidatedGetter` helper from types file origin -> new location ----------------------- latestValueTypes.ts -> validatedGetter.ts 3. Cleanup `StateFactory` doc generation - Import the types required by api-extractor to generate docs without internal file listings. - Revise `link` references to not directly specify properties. Break up into `StateFactory` reference and reference to the respective factory type.
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 presence framework code to improve encapsulation by separating type definitions from implementation files. The refactoring extracts types into dedicated type files and creates a separate helper module for validation logic.
Changes:
- Extracted type definitions from
latestValueManager.tsandlatestMapValueManager.tsinto new dedicated type fileslatestTypes.tsandlatestMapTypes.ts - Moved the
createValidatedGetterhelper function fromlatestValueTypes.tsto a newvalidatedGetter.tsfile - Updated documentation links to reference
StateFactoryand factory types separately (instead of direct property references) - Added type imports to
stateFactory.tsas a workaround for api-extractor limitations
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/framework/presence/src/validatedGetter.ts | New file containing the extracted createValidatedGetter helper function and related types previously in latestValueTypes.ts |
| packages/framework/presence/src/latestValueTypes.ts | Removed the createValidatedGetter implementation and related internal types, keeping only public type definitions |
| packages/framework/presence/src/latestTypes.ts | New file containing Latest, LatestRaw, LatestFactory, and related types extracted from latestValueManager.ts |
| packages/framework/presence/src/latestValueManager.ts | Removed type definitions that were moved to latestTypes.ts, updated imports to reference the new files |
| packages/framework/presence/src/latestMapTypes.ts | New file containing LatestMap, LatestMapRaw, LatestMapFactory, and related types extracted from latestMapValueManager.ts |
| packages/framework/presence/src/latestMapValueManager.ts | Removed type definitions that were moved to latestMapTypes.ts, updated imports to reference the new files |
| packages/framework/presence/src/stateFactory.ts | Added unused type imports for Latest and LatestMap as a workaround for api-extractor documentation generation |
| packages/framework/presence/src/index.ts | Updated type exports to reference the new type files instead of manager implementation files |
Separate types from implementation files
origin -> new types location
latestValueManager.ts -> latestTypes.ts
latestMapValueManager.ts -> latestMapTypes.ts
Separate implementation
createValidatedGetterhelper from types fileorigin -> new location
latestValueTypes.ts -> validatedGetter.ts
Cleanup
StateFactorydoc generationlinkreferences to not directly specify properties. Break up intoStateFactoryreference and reference to the respective factory type.