Skip to content
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

refactor(client-presence): Rename ExperimentalPresenceManager to PresenceManager + remove all experimental naming from package #23103

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/common-cars-swim.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
"@fluidframework/presence": minor
---
---
"section": other
---

Rename ExperimentalPresenceManager to PresenceManger

Now that Presence package has been promoted from experimental to alpha, we have renamed `ExperimentalPresenceManager` to `PresenceManager` and `ExperimentalPresenceDO` to `PresenceDO`.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import {
import { createDevtoolsLogger, initializeDevtools } from "@fluidframework/devtools/internal";
// eslint-disable-next-line import/no-internal-modules
import { ISharedMap, IValueChanged, SharedMap } from "@fluidframework/map/internal";
import {
acquirePresenceViaDataObject,
ExperimentalPresenceManager,
} from "@fluidframework/presence/alpha";
import { acquirePresenceViaDataObject, PresenceManager } from "@fluidframework/presence/alpha";
// eslint-disable-next-line import/no-internal-modules
import { createChildLogger } from "@fluidframework/telemetry-utils/internal";
// eslint-disable-next-line import/no-internal-modules
Expand Down Expand Up @@ -81,7 +78,7 @@ const containerSchema = {
map2: SharedMap,
// A Presence Manager object temporarily needs to be placed within container schema
// https://github.com/microsoft/FluidFramework/blob/main/packages/framework/presence/README.md#onboarding
presence: ExperimentalPresenceManager,
presence: PresenceManager,
},
} satisfies ContainerSchema;
type DiceRollerContainerSchema = typeof containerSchema;
Expand Down
8 changes: 4 additions & 4 deletions packages/framework/presence/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @fluid-experimental/presence
# @fluidframework/presence

## 2.5.0

Expand All @@ -18,11 +18,11 @@ Dependency updates only.

### Major Changes

- Experimental Presence package added ([#22499](https://github.com/microsoft/FluidFramework/pull/22499)) [42b323cdbf1](https://github.com/microsoft/FluidFramework/commit/42b323cdbf129c897cf9bb51c1f1b9de5642ef8a)
- Presence package added ([#22499](https://github.com/microsoft/FluidFramework/pull/22499)) [42b323cdbf1](https://github.com/microsoft/FluidFramework/commit/42b323cdbf129c897cf9bb51c1f1b9de5642ef8a)

**[@fluid-experimental/presence](https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme)** is now available for investigation. The new package is meant to support presence of collaborators connected to the same container. Use this library to quickly share simple, non-persisted data among all clients or send/receive fire and forget notifications.
**[@fluidframework/presence](https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme)** is now available for investigation. The new package is meant to support presence of collaborators connected to the same container. Use this library to quickly share simple, non-persisted data among all clients or send/receive fire and forget notifications.

API documentation for **@fluid-experimental/presence** is available at <https://fluidframework.com/docs/apis/presence>.
API documentation for **@fluidframework/presence** is available at <https://fluidframework.com/docs/apis/presence>.

There are some limitations; see the README.md of installed package for most relevant notes.

Expand Down
6 changes: 3 additions & 3 deletions packages/framework/presence/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ Notifications value managers are special case where no data is retained during a

## Onboarding

While this package is developing as experimental and other Fluid Framework internals are being updated to accommodate it, a temporary Shared Object must be added within container to gain access.
While this package is developing and other Fluid Framework internals are being updated to accommodate it, a temporary Shared Object must be added within container to gain access.

```typescript
import { acquirePresenceViaDataObject, ExperimentalPresenceManager } from "@fluidframework/presence/alpha";
import { acquirePresenceViaDataObject, PresenceManager } from "@fluidframework/presence/alpha";

const containerSchema = {
initialObjects: {
presence: ExperimentalPresenceManager
presence: PresenceManager
}
} satisfies ContainerSchema;

Expand Down
16 changes: 8 additions & 8 deletions packages/framework/presence/api-report/presence.alpha.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
export function acquirePresence(fluidContainer: IFluidContainer): IPresence;

// @alpha
export function acquirePresenceViaDataObject(fluidLoadable: ExperimentalPresenceDO): IPresence;
export function acquirePresenceViaDataObject(fluidLoadable: PresenceDO): IPresence;

// @alpha
export type ClientConnectionId = string;
Expand All @@ -18,13 +18,6 @@ export type ClientSessionId = SessionId & {
readonly ClientSessionId: "ClientSessionId";
};

// @alpha @sealed
export class ExperimentalPresenceDO {
}

// @alpha
export const ExperimentalPresenceManager: SharedObjectKind<IFluidLoadable & ExperimentalPresenceDO>;

// @alpha @sealed
export interface IPresence {
readonly events: ISubscribable<PresenceEvents>;
Expand Down Expand Up @@ -168,6 +161,10 @@ export type NotificationSubscriptions<E extends InternalUtilityTypes.Notificatio
[K in string & keyof InternalUtilityTypes.NotificationEvents<E>]: (sender: ISessionClient, ...args: InternalUtilityTypes.JsonDeserializedParameters<E[K]>) => void;
};

// @alpha @sealed
export class PresenceDO {
}

// @alpha @sealed (undocumented)
export interface PresenceEvents {
// @eventProperty
Expand All @@ -177,6 +174,9 @@ export interface PresenceEvents {
workspaceActivated: (workspaceAddress: PresenceWorkspaceAddress, type: "States" | "Notifications" | "Unknown") => void;
}

// @alpha
export const PresenceManager: SharedObjectKind<IFluidLoadable & PresenceDO>;

// @alpha @sealed
export type PresenceNotifications<TSchema extends PresenceNotificationsSchema> = PresenceStates<TSchema, NotificationsManager<any>>;

Expand Down
25 changes: 11 additions & 14 deletions packages/framework/presence/src/datastorePresenceManagerFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class PresenceManagerDataObject extends LoadableFluidObject {
* Factory class to create {@link IPresence} in own data store.
*/
class PresenceManagerFactory {
public is(value: IFluidLoadable | ExperimentalPresenceDO): value is ExperimentalPresenceDO {
public is(value: IFluidLoadable | PresenceDO): value is PresenceDO {
return value instanceof PresenceManagerDataObject;
}

Expand All @@ -64,16 +64,16 @@ class PresenceManagerFactory {
}

/**
* Brand for Experimental Presence Data Object.
* Brand for Presence Data Object.
*
* @remarks
* See {@link acquirePresenceViaDataObject} for example usage.
*
* @sealed
* @alpha
*/
export declare class ExperimentalPresenceDO {
private readonly _self: ExperimentalPresenceDO;
export declare class PresenceDO {
private readonly _self: PresenceDO;
}

/**
Expand All @@ -82,10 +82,9 @@ export declare class ExperimentalPresenceDO {
*
* @alpha
*/
export const ExperimentalPresenceManager =
new PresenceManagerFactory() as unknown as SharedObjectKind<
IFluidLoadable & ExperimentalPresenceDO
>;
export const PresenceManager = new PresenceManagerFactory() as unknown as SharedObjectKind<
IFluidLoadable & PresenceDO
>;

/**
* Acquire IPresence from a DataStore based Presence Manager
Expand All @@ -94,25 +93,23 @@ export const ExperimentalPresenceManager =
* ```typescript
* const containerSchema = {
* initialObjects: {
* experimentalPresence: ExperimentalPresenceDO,
* presence: PresenceDO,
* },
* } satisfies ContainerSchema;
* ```
* then
* ```typescript
* const presence = acquirePresenceViaDataObject(
* container.initialObjects.experimentalPresence,
* container.initialObjects.presence,
* );
* ```
*
* @alpha
*/
export function acquirePresenceViaDataObject(
fluidLoadable: ExperimentalPresenceDO,
): IPresence {
export function acquirePresenceViaDataObject(fluidLoadable: PresenceDO): IPresence {
if (fluidLoadable instanceof PresenceManagerDataObject) {
return fluidLoadable.presenceManager();
}

throw new Error("Incompatible loadable; make sure to use ExperimentalPresenceManager");
throw new Error("Incompatible loadable; make sure to use PresenceManager");
}
6 changes: 3 additions & 3 deletions packages/framework/presence/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

/**
* Experimental package for client presence within a connected session.
* Package for client presence within a connected session.
*
* See {@link https://github.com/microsoft/FluidFramework/tree/main/packages/framework/presence#readme | README.md } for an overview of the package.
*
Expand Down Expand Up @@ -49,8 +49,8 @@ export { acquirePresence } from "./experimentalAccess.js";

export {
acquirePresenceViaDataObject,
type ExperimentalPresenceDO,
ExperimentalPresenceManager,
type PresenceDO,
PresenceManager,
} from "./datastorePresenceManagerFactory.js";

export type { LatestValueControls } from "./latestValueControls.js";
Expand Down
Loading