Skip to content

Conversation

@jason-ha
Copy link
Contributor

@jason-ha jason-ha commented Jan 29, 2026

  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.

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.
Copy link
Contributor

Copilot AI left a 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.ts and latestMapValueManager.ts into new dedicated type files latestTypes.ts and latestMapTypes.ts
  • Moved the createValidatedGetter helper function from latestValueTypes.ts to a new validatedGetter.ts file
  • Updated documentation links to reference StateFactory and factory types separately (instead of direct property references)
  • Added type imports to stateFactory.ts as 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant