-
Notifications
You must be signed in to change notification settings - Fork 571
feat(client-fluid-framework): expose getPresence from fluid-framework #26399
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
Open
jason-ha
wants to merge
6
commits into
microsoft:main
Choose a base branch
from
jason-ha:presence/expose-via-fluidframework
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
80f71a9
feat(client-fluid-framework): expose getPresence from fluid-framework
jason-ha 5be0a19
docs(client-fluid-static): README update for alpha/beta APIs
jason-ha 3a97388
docs(client): deprecation reword #3
jason-ha b0322de
Merge branch 'main' into presence/expose-via-fluidframework
jason-ha 592857b
docs(client): deprecation change set format
jason-ha 8236d28
docs(client-presence): actually set issue number in URL
jason-ha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| "fluid-framework": minor | ||
| "@fluidframework/presence": minor | ||
| "__section": deprecation | ||
| --- | ||
| getPresence is being relocated from @fluidframework/presence to the fluid-framework package | ||
|
Check failure on line 6 in .changeset/beige-candles-sleep.md
|
||
|
|
||
| To prepare, make changes following this pattern: | ||
| ```diff | ||
| -import { getPresence } from "@fluidframework/presence/beta"; | ||
| +import { getPresence } from "fluid-framework/beta"; | ||
| ``` | ||
|
|
||
| See [issue #26397](https://github.com/microsoft/FluidFramework/issues/26397) for more details. | ||
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
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
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
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
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
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
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
5 changes: 5 additions & 0 deletions
5
packages/framework/fluid-static/api-extractor/api-extractor-lint-alpha.cjs.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json", | ||
| "mainEntryPointFilePath": "<projectFolder>/dist/alpha.d.ts" | ||
| } |
5 changes: 5 additions & 0 deletions
5
packages/framework/fluid-static/api-extractor/api-extractor-lint-alpha.esm.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json", | ||
| "mainEntryPointFilePath": "<projectFolder>/lib/alpha.d.ts" | ||
| } |
5 changes: 5 additions & 0 deletions
5
packages/framework/fluid-static/api-extractor/api-extractor-lint-beta.cjs.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json", | ||
| "mainEntryPointFilePath": "<projectFolder>/dist/beta.d.ts" | ||
| } |
5 changes: 5 additions & 0 deletions
5
packages/framework/fluid-static/api-extractor/api-extractor-lint-beta.esm.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-lint.entrypoint.json", | ||
| "mainEntryPointFilePath": "<projectFolder>/lib/beta.d.ts" | ||
| } |
5 changes: 4 additions & 1 deletion
5
packages/framework/fluid-static/api-extractor/api-extractor.current.json
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,8 @@ | ||
| { | ||
| "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", | ||
| "extends": "<projectFolder>/../../../common/build/build-common/api-extractor-report.esm.current.json", | ||
| "mainEntryPointFilePath": "<projectFolder>/lib/public.d.ts" | ||
| "mainEntryPointFilePath": "<projectFolder>/lib/alpha.d.ts", | ||
| "apiReport": { | ||
| "reportVariants": ["public", "beta", "alpha"] | ||
| } | ||
| } |
89 changes: 89 additions & 0 deletions
89
packages/framework/fluid-static/api-report/fluid-static.alpha.api.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,89 @@ | ||
| ## Alpha API Report File for "@fluidframework/fluid-static" | ||
|
|
||
| > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
|
|
||
| ```ts | ||
|
|
||
| // @public | ||
| export type CompatibilityMode = "1" | "2"; | ||
|
|
||
| // @public | ||
| export type ContainerAttachProps<T = unknown> = T; | ||
|
|
||
| // @public | ||
| export interface ContainerSchema { | ||
| readonly dynamicObjectTypes?: readonly SharedObjectKind[]; | ||
| readonly initialObjects: Record<string, SharedObjectKind>; | ||
| } | ||
|
|
||
| // @beta | ||
| export const getPresence: (fluidContainer: IFluidContainer) => Presence; | ||
|
|
||
| // @alpha | ||
| export function getPresenceAlpha(fluidContainer: IFluidContainer): PresenceWithNotifications; | ||
|
|
||
| // @public | ||
| export interface IConnection { | ||
| readonly id: string; | ||
| readonly mode: "write" | "read"; | ||
| } | ||
|
|
||
| // @public @sealed | ||
| export interface IFluidContainer<TContainerSchema extends ContainerSchema = ContainerSchema> extends IEventProvider<IFluidContainerEvents> { | ||
| attach(props?: ContainerAttachProps): Promise<string>; | ||
| readonly attachState: AttachState; | ||
| connect(): void; | ||
| readonly connectionState: ConnectionState; | ||
| create<T extends IFluidLoadable>(objectClass: SharedObjectKind<T>): Promise<T>; | ||
| disconnect(): void; | ||
| dispose(): void; | ||
| readonly disposed: boolean; | ||
| readonly initialObjects: InitialObjects<TContainerSchema>; | ||
| readonly isDirty: boolean; | ||
| } | ||
|
|
||
| // @public @sealed | ||
| export interface IFluidContainerEvents extends IEvent { | ||
| (event: "connected", listener: () => void): void; | ||
| (event: "disconnected", listener: () => void): void; | ||
| (event: "saved", listener: () => void): void; | ||
| (event: "dirty", listener: () => void): void; | ||
| (event: "disposed", listener: (error?: ICriticalContainerError) => void): any; | ||
| } | ||
|
|
||
| // @public | ||
| export interface IMember { | ||
| readonly connections: IConnection[]; | ||
| readonly id: string; | ||
| } | ||
|
|
||
| // @public | ||
| export type InitialObjects<T extends ContainerSchema> = { | ||
| [K in keyof T["initialObjects"]]: T["initialObjects"][K] extends SharedObjectKind<infer TChannel> ? TChannel : never; | ||
| }; | ||
|
|
||
| // @public | ||
| export interface IServiceAudience<M extends IMember> extends IEventProvider<IServiceAudienceEvents<M>> { | ||
| getMembers(): ReadonlyMap<string, M>; | ||
| getMyself(): Myself<M> | undefined; | ||
| } | ||
|
|
||
| // @public | ||
| export interface IServiceAudienceEvents<M extends IMember> extends IEvent { | ||
| // @eventProperty | ||
| (event: "membersChanged", listener: () => void): void; | ||
| // @eventProperty | ||
| (event: "memberAdded", listener: MemberChangedListener<M>): void; | ||
| // @eventProperty | ||
| (event: "memberRemoved", listener: MemberChangedListener<M>): void; | ||
| } | ||
|
|
||
| // @public | ||
| export type MemberChangedListener<M extends IMember> = (clientId: string, member: M) => void; | ||
|
|
||
| // @public | ||
| export type Myself<M extends IMember = IMember> = M & { | ||
| readonly currentConnection: string; | ||
| }; | ||
|
|
||
| ``` |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| /*! | ||
| * Copyright (c) Microsoft Corporation and contributors. All rights reserved. | ||
| * Licensed under the MIT License. | ||
| */ | ||
|
|
||
| import type { | ||
| Presence, | ||
| PresenceWithNotifications, | ||
| } from "@fluid-internal/presence-definitions"; | ||
| import { | ||
| ContainerPresenceFactory, | ||
| extensionId, | ||
| // eslint-disable-next-line import-x/no-internal-modules -- any import spec is allowed for @fluid-internal/ imports - eslint-config-fluid needs updated | ||
| } from "@fluid-internal/presence-runtime/extension"; | ||
| import { assert } from "@fluidframework/core-utils/internal"; | ||
|
|
||
| import type { IFluidContainer } from "./fluidContainer.js"; | ||
| import { isInternalFluidContainer } from "./fluidContainer.js"; | ||
|
|
||
| /** | ||
| * Acquire a {@link @fluidframework/presence#Presence} from a Fluid Container | ||
| * @param fluidContainer - Fluid Container to acquire the map from | ||
| * @returns the {@link @fluidframework/presence#Presence} | ||
| * | ||
| * @beta | ||
| */ | ||
| export const getPresence: (fluidContainer: IFluidContainer) => Presence = getPresenceAlpha; | ||
|
|
||
| /** | ||
| * Acquire a {@link @fluidframework/presence#PresenceWithNotifications} from a Fluid Container | ||
| * @param fluidContainer - Fluid Container to acquire the map from | ||
| * @returns the {@link @fluidframework/presence#PresenceWithNotifications} | ||
| * | ||
| * @alpha | ||
| */ | ||
| export function getPresenceAlpha(fluidContainer: IFluidContainer): PresenceWithNotifications { | ||
| assert( | ||
| isInternalFluidContainer(fluidContainer), | ||
| 0xa2f /* IFluidContainer was not recognized. Only Containers generated by the Fluid Framework are supported. */, | ||
| ); | ||
| const presence = fluidContainer.acquireExtension(extensionId, ContainerPresenceFactory); | ||
| return presence; | ||
| } |
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Nit: I think we should expand this a bit. Something like "The export from
@fluidframework/presenceis now deprecated and will be removed in a future release. Please update any existing imports as follows:"