Skip to content

feat(client-fluid-framework): expose getPresence from fluid-framework#26399

Open
jason-ha wants to merge 6 commits intomicrosoft:mainfrom
jason-ha:presence/expose-via-fluidframework
Open

feat(client-fluid-framework): expose getPresence from fluid-framework#26399
jason-ha wants to merge 6 commits intomicrosoft:mainfrom
jason-ha:presence/expose-via-fluidframework

Conversation

@jason-ha
Copy link
Copy Markdown
Contributor

@jason-ha jason-ha commented Feb 10, 2026

  • Move support to @fluidframework/fluid-static, re-export from fluid-framework, and deprecate from @fluidframework/presence
  • Update fluid-static exports to support alpha and beta
  • fluid-framework only exports getPresence*. Callers can access remaining surface from @fluidframework/presence.
  • Update example and test uses

Copilot AI review requested due to automatic review settings February 10, 2026 21:35
@jason-ha jason-ha requested review from a team as code owners February 10, 2026 21:35
Copy link
Copy Markdown
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 PR exposes getPresence / getPresenceAlpha from the fluid-framework package and deprecates importing getPresence directly from @fluidframework/presence, updating docs/examples accordingly.

Changes:

  • Re-export getPresence and getPresenceAlpha from fluid-framework (beta/alpha surfaces).
  • Deprecate @fluidframework/presence’s getPresence and getPresenceAlpha exports and update API reports.
  • Update documentation/examples to use import { getPresence } from "fluid-framework/beta".

Reviewed changes

Copilot reviewed 16 out of 17 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
pnpm-lock.yaml Adds workspace dependency entry for @fluidframework/presence where needed.
packages/service-clients/end-to-end-tests/azure-client/src/test/multiprocess/childClient.tool.ts Adds deprecation lint suppressions around getPresence usage.
packages/framework/presence/src/getPresence.ts Marks getPresence / getPresenceAlpha as deprecated and adjusts imports/aliases.
packages/framework/presence/api-report/presence.legacy.alpha.api.md Marks getPresence / getPresenceAlpha as deprecated in legacy alpha report.
packages/framework/presence/api-report/presence.beta.api.md Marks getPresence as deprecated in beta report.
packages/framework/presence/api-report/presence.alpha.api.md Marks getPresence / getPresenceAlpha as deprecated in alpha report.
packages/framework/presence/README.md Updates usage snippet to import getPresence from fluid-framework/beta.
packages/framework/fluid-framework/src/index.ts Adds custom re-exports for presence getters from @fluidframework/presence/alpha.
packages/framework/fluid-framework/package.json Adds @fluidframework/presence dependency.
packages/framework/fluid-framework/eslint.config.mts Disables import-x/order for src/index.ts.
packages/framework/fluid-framework/api-report/fluid-framework.legacy.beta.api.md Adds getPresence to legacy beta API report.
packages/framework/fluid-framework/api-report/fluid-framework.beta.api.md Adds getPresence to beta API report.
packages/framework/fluid-framework/api-report/fluid-framework.alpha.api.md Adds getPresence / getPresenceAlpha to alpha API report.
examples/service-clients/azure-client/external-controller/src/app.ts Migrates example import to fluid-framework/beta.
examples/apps/presence-tracker/src/app.ts Migrates getPresence import to fluid-framework/beta while keeping presence types in @fluidframework/presence.
docs/docs/build/presence.mdx Updates docs snippet to import getPresence from fluid-framework/beta.
.changeset/beige-candles-sleep.md Adds deprecation-focused changeset describing the migration pattern.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

"@fluidframework/presence": minor
"__section": deprecation
---
getPresence is being relocated to fluid-framework package away from @fluidframework/presence
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor wording/grammar: consider rephrasing to "getPresence is being relocated to the fluid-framework package, away from @fluidframework/presence." (adds articles/backticks and reads more cleanly in the changeset).

Suggested change
getPresence is being relocated to fluid-framework package away from @fluidframework/presence
getPresence is being relocated to the `fluid-framework` package, away from `@fluidframework/presence`.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had those tick but removed them. I thought we didn't want ticks in the title (for reason I didn't question).?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait - this isn't a human comment. @Josmithr or @alexvy86, can you confirm if ticks should be used or not?
Also, should a period be added?
(The comma doesn't seem controversial.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, our current guidance is to not use inline code syntax in changeset titles to prevent noisy looking headers in the resulting changeset. I think this is a policy we could discuss as a team if folks feel strongly that we should allow them (I have mixed feelings personally). But for now, the guidance is no.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Josh said, and I'll add that there shouldn't be a trailing period.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The one reason I know to allow them is to avoid the @ mentions that happen without them. We've mentioned @alpha and @beta in the past. Or maybe we've fixed that since.?

Copy link
Copy Markdown
Contributor

@Josmithr Josmithr Feb 11, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. I wasn't aware of that issue. You can always escape the @ if needbe though. At least I would assume that works.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the issue is fixed. That's a minor reason why I personally don't mind the backticks, but not a battle I care about fighting 😄 . Somehow trying to escape the @ had never occurred to me... it does work when used directly in comment boxes here (the picker doesn't come up). Hopefully it would work in the rendered release notes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added ticks since the mention issue isn't addressed.

import type { ScopeType } from "@fluidframework/driver-definitions/legacy";
import type { ContainerSchema, IFluidContainer } from "@fluidframework/fluid-static";
import {
// eslint-disable-next-line import-x/no-deprecated -- TODO#59157: relocating to fluid-static
Copy link

Copilot AI Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The TODO in this eslint suppression says relocating to fluid-static, but this PR is relocating getPresence to fluid-framework (and the deprecation text in @fluidframework/presence points to fluid-framework/beta). Please update the TODO text to reflect the actual intended destination (or link the correct tracking issue if it really is moving to fluid-static).

Suggested change
// eslint-disable-next-line import-x/no-deprecated -- TODO#59157: relocating to fluid-static
// eslint-disable-next-line import-x/no-deprecated -- TODO#59157: relocating to fluid-framework/beta

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the export in fluid-static? Users of azure-client are expected to also depend on fluid-framework, no? So they could get the API from there.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to relocate it outside of the presence package. fluid-static is the best home I can think of. Otherwise, I will create a new package. fluid-framework can continue to have the export but it will import from fluid-static instead.
I can't move getPresence straight to fluid-static because presence currently depends on fluid-static. There will be presence package refactor to do the other shuffling. But in order to deprecate it, I need a replacement. Hence this staging.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presence has been refactored and now getPresence is implemented in fluid-static.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Josmithr, fluid-static is the package that pulls together the "encapsulated" layers and enables the "declarative" use pattern. In particular, it implements FluidContainer that is the host for Presence connection as it is for DDSes.

I am guessing that IFluidContainer may get extended to just have a presence member. But for now, we let customers demand Presence via getPresence but are placing that in the vicinity.

If presence is the general Presence package, it must not pull in "encapsulated" or "declarative" specific things. The getPresence* access functions violated that. I am not sure where the "encapsulated" accessor will land, but that is probably a new (small) package.

Copy link
Copy Markdown
Contributor

@alexvy86 alexvy86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some doc-related comments

import type { ScopeType } from "@fluidframework/driver-definitions/legacy";
import type { ContainerSchema, IFluidContainer } from "@fluidframework/fluid-static";
import {
// eslint-disable-next-line import-x/no-deprecated -- TODO#59157: relocating to fluid-static
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need the export in fluid-static? Users of azure-client are expected to also depend on fluid-framework, no? So they could get the API from there.

- Move support to `@fluidframework/fluid-static`, re-export from `fluid-framework`, and deprecate from `@fluidframework/presence`
- Update fluid-static exports to support alpha and beta
- `fluid-framework` only exports `getPresence*`. Callers can access remaining surface from `@fluidframework/presence`.
- Update example and test uses
@jason-ha jason-ha force-pushed the presence/expose-via-fluidframework branch from feb2589 to 80f71a9 Compare April 10, 2026 23:59
---
getPresence is being relocated from @fluidframework/presence to the fluid-framework package

To prepare, make changes following this pattern:
Copy link
Copy Markdown
Contributor

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/presence is now deprecated and will be removed in a future release. Please update any existing imports as follows:"

Copy link
Copy Markdown
Contributor

@Josmithr Josmithr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'm missing some context on the changes here. The user-facing aspects of this look good to me, and the docs look good (aside from 1 nitpick).

But the move to fluid-static is a bit surprising. The scope / intention of that package isn't well documented, but I always viewed it as the APIs needed to implement a service client. Since the service clients don't use presence (right?), that placement seems a bit weird to me.

I'm assuming there were some external conversations that led to this outcome?

@jason-ha
Copy link
Copy Markdown
Contributor Author

I think I'm missing some context on the changes here. The user-facing aspects of this look good to me, and the docs look good (aside from 1 nitpick).

But the move to fluid-static is a bit surprising. The scope / intention of that package isn't well documented, but I always viewed it as the APIs needed to implement a service client. Since the service clients don't use presence (right?), that placement seems a bit weird to me.

I'm assuming there were some external conversations that led to this outcome?

I would look at this thread: #26399 (comment).

I will post extra notes there.

@github-actions
Copy link
Copy Markdown
Contributor

🔗 No broken links found! ✅

Your attention to detail is admirable.

linkcheck output


> fluid-framework-docs-site@0.0.0 ci:check-links /home/runner/work/FluidFramework/FluidFramework/docs
> start-server-and-test "npm run serve -- --no-open" 3000 check-links

1: starting server using command "npm run serve -- --no-open"
and when url "[ 'http://127.0.0.1:3000' ]" is responding with HTTP status code 200
running tests using command "npm run check-links"


> fluid-framework-docs-site@0.0.0 serve
> docusaurus serve --no-open

[SUCCESS] Serving "build" directory at: http://localhost:3000/

> fluid-framework-docs-site@0.0.0 check-links
> linkcheck http://localhost:3000 --skip-file skipped-urls.txt

Crawling...

Stats:
  279037 links
    1880 destination URLs
    2126 URLs ignored
       0 warnings
       0 errors


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.

5 participants