feat(client): encapsulated support for Presence#25790
Merged
Conversation
Expose getPresenceFromDataStoreContext API to allow Presence use in the encapsulated API model. In this minimal implementation, Presence can be injected on demand, but all injection requests are expected to be from the same module. Future changes: - Add loader era initialization - new API - Expand compat boundaries and checks where it is possible that runtime package might be mismatched.
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the Container Extension system to support runtime compatibility checking and versioning. It introduces a factory-based instantiation pattern, moves extension-related types to runtime-definitions, and adds support for accessing extensions via data store contexts.
Key changes:
- Introduced
ContainerExtensionProviderinterface and compatibility checking infrastructure - Refactored
ContainerExtensionFactoryfrom a constructor type to an interface with explicit instantiation methods - Added
getPresenceFromDataStoreContextAPI for legacy/alpha access pattern - Updated examples to demonstrate cursor presence using the new API
Reviewed Changes
Copilot reviewed 28 out of 29 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updated TypeScript version dependencies and added tinylicious dev dependency |
| packages/runtime/runtime-definitions/src/containerExtensionProvider.ts | New file defining extension provider interfaces and compatibility details |
| packages/runtime/runtime-definitions/src/dataStoreContext.ts | Added FluidDataStoreContextInternal interface extending ContainerExtensionProvider |
| packages/runtime/runtime-definitions/src/index.ts | Exported new extension-related types |
| packages/runtime/container-runtime/src/containerRuntime.ts | Implemented compatibility checking and factory-based extension instantiation |
| packages/runtime/container-runtime/src/dataStoreContext.ts | Added getExtension method to FluidDataStoreContext |
| packages/runtime/container-runtime-definitions/src/containerExtension.ts | Refactored ContainerExtensionFactory and added ExtensionInstantiationResult |
| packages/framework/presence/src/getPresence.ts | Implemented new factory pattern and added getPresenceFromDataStoreContext |
| examples/view-integration/external-views/ | Updated to use presence via data store context with cursor tracking example |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
packages/runtime/runtime-definitions/src/containerExtensionProvider.ts
Outdated
Show resolved
Hide resolved
packages/runtime/container-runtime-definitions/src/containerExtension.ts
Show resolved
Hide resolved
Copilot's suggestion didn't account for api-extractor.
Contributor
|
🔗 Found some broken links! 💔 Run a link check locally to find them. See linkcheck output |
anthony-murphy-agent
pushed a commit
to anthony-murphy-agent/FluidFramework
that referenced
this pull request
Jan 14, 2026
Expose getPresenceFromDataStoreContext API to allow Presence use in the encapsulated API model. In this minimal implementation, Presence can be injected on demand, but all injection requests are expected to be from the same module. Future changes: - Add loader era initialization - new API - Expand compat boundaries and checks where it is possible that runtime package might be mismatched. Add example use to @fluid-example/app-integration-external-views that shows cursors. [AB#51457](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/51457)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Expose getPresenceFromDataStoreContext API to allow
Presence use in the encapsulated API model.
In this minimal implementation, Presence can be
injected on demand, but all injection requests
are expected to be from the same module.
Future changes:
possible that runtime package might be mismatched.
Add example use to @fluid-example/app-integration-external-views that shows cursors.
AB#51457