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(presence-tracker): Use presence package #23020

Merged
merged 87 commits into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
aaf918b
wip
tylerbutler Nov 6, 2024
a2a55e4
wip
tylerbutler Nov 6, 2024
39741a3
updates
tylerbutler Nov 6, 2024
c3a2b57
sort of works
tylerbutler Nov 6, 2024
5606c11
seems pretty good
tylerbutler Nov 7, 2024
7ce14c6
updates
tylerbutler Nov 7, 2024
5fc6ac7
cleanup
tylerbutler Nov 7, 2024
5f5aa4b
cleanup
tylerbutler Nov 7, 2024
2219cba
Merge branch 'main' into presence-tracker-revamp
tylerbutler Nov 7, 2024
c118fcd
wip
tylerbutler Nov 7, 2024
3bae7a4
revert removed files
tylerbutler Nov 7, 2024
dc9c829
mousetracker with presence workspace
tylerbutler Nov 7, 2024
ae317ab
focustracker with presence
tylerbutler Nov 7, 2024
3cbe492
cleanup
tylerbutler Nov 7, 2024
c635bf0
brng back the trackers
tylerbutler Nov 8, 2024
0d6476d
Merge branch 'main' into presence-tracker-revamp
tylerbutler Nov 8, 2024
a1649d3
breaking change
tylerbutler Nov 8, 2024
a5de697
Merge branch 'main' into presence-tracker-revamp
tylerbutler Nov 11, 2024
3a7f7cd
cleanup
tylerbutler Nov 11, 2024
069a052
use clientValues
tylerbutler Nov 11, 2024
a43de27
cleanup
tylerbutler Nov 11, 2024
d7bfbc0
sort of working
tylerbutler Nov 12, 2024
cd7ed6f
Merge branch 'main' into presence-tracker-revamp
tylerbutler Nov 12, 2024
9237db8
test
tylerbutler Nov 12, 2024
8257169
still sort of works once a second user joins
tylerbutler Nov 12, 2024
3320851
rm unused files
tylerbutler Nov 12, 2024
4b2e178
Merge branch 'main' into presence-tracker-revamp
tylerbutler Nov 27, 2024
116221f
package rename and lint config
tylerbutler Nov 27, 2024
f5fb796
add controllable latency
tylerbutler Nov 27, 2024
4b0dd7d
naming
tylerbutler Nov 27, 2024
0e5f297
Merge branch 'main' into presence-tracker-revamp
tylerbutler Dec 10, 2024
90cbc36
debugging
tylerbutler Dec 11, 2024
d68df9c
cleanup
tylerbutler Dec 11, 2024
0361460
Merge branch 'main' into presence-tracker-revamp
tylerbutler Dec 11, 2024
0f245d5
policy
tylerbutler Dec 11, 2024
b0bdf4a
lockfile
tylerbutler Dec 11, 2024
cb1b48d
feedback
tylerbutler Dec 11, 2024
b7615e5
update test config
tylerbutler Dec 11, 2024
38de027
test updates
tylerbutler Dec 12, 2024
b0650b4
multi-client tests
tylerbutler Dec 12, 2024
34345d0
Merge branch 'main' into presence-tracker-revamp
tylerbutler Dec 12, 2024
dfc37e4
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 6, 2025
7b594b9
run tinylicious for jest tests
tylerbutler Jan 6, 2025
7406ad5
azure function comments
tylerbutler Jan 7, 2025
e133d44
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 7, 2025
1277da7
use tinylicious exclsively
tylerbutler Jan 7, 2025
2683c70
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 13, 2025
3018bbf
fix policy
tylerbutler Jan 13, 2025
4b4647e
fixes
tylerbutler Jan 13, 2025
97a5dbe
feedback
tylerbutler Jan 13, 2025
33668d4
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 13, 2025
c7f5cdc
remove unused script
tylerbutler Jan 13, 2025
5adadea
clean up comments
tylerbutler Jan 13, 2025
f3b6667
Apply suggestions from code review
tylerbutler Jan 13, 2025
9427552
build failure
tylerbutler Jan 13, 2025
ed8bfca
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 14, 2025
5a155e8
feedback
tylerbutler Jan 14, 2025
62f14da
test feedback
tylerbutler Jan 14, 2025
54485e6
try removing the --ci flag
tylerbutler Jan 14, 2025
a52bba2
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 14, 2025
c5b9744
feedback
tylerbutler Jan 14, 2025
bcd24eb
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 15, 2025
7c46f35
feedback
tylerbutler Jan 15, 2025
6940986
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 15, 2025
9489b9b
fix
tylerbutler Jan 15, 2025
6051964
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 15, 2025
de56c92
updates
tylerbutler Jan 15, 2025
93e7767
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 15, 2025
a2d1cfd
Revert "updates"
tylerbutler Jan 15, 2025
e30c829
close browser after all tests to prevent hang
tylerbutler Jan 15, 2025
382b9b7
policy
tylerbutler Jan 15, 2025
61406a0
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 16, 2025
14b2c06
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 16, 2025
e83c8dc
feedback
tylerbutler Jan 16, 2025
0fde8ba
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 16, 2025
c490da8
feedback
tylerbutler Jan 17, 2025
5ce5210
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 22, 2025
aefd485
docs
tylerbutler Jan 23, 2025
e5a0415
tests
tylerbutler Jan 23, 2025
197cd08
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 23, 2025
31f0b19
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 23, 2025
1a3e55f
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 23, 2025
fb85e04
feedback
tylerbutler Jan 23, 2025
e35b898
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 23, 2025
f3d4ec8
rm any
tylerbutler Jan 23, 2025
3dde146
feedback
tylerbutler Jan 23, 2025
596371a
Merge branch 'main' into presence-tracker-revamp
tylerbutler Jan 23, 2025
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
5 changes: 5 additions & 0 deletions examples/apps/presence-tracker/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# .env.defaults should not contain private information. Create a .env file locally to override these values.
AZURE_TENANT_ID=<tenant-id>
AZURE_ORDERER=<orderer-url>
AZURE_FUNCTION_TOKEN_PROVIDER_URL=<token-provider-url>
FLUID_CLIENT=local
6 changes: 6 additions & 0 deletions examples/apps/presence-tracker/package.json
tylerbutler marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,21 @@
"dependencies": {
"@fluid-example/example-utils": "workspace:~",
"@fluid-experimental/data-objects": "workspace:~",
"@fluid-experimental/presence": "workspace:~",
"@fluid-internal/client-utils": "workspace:~",
"@fluidframework/azure-client": "workspace:~",
"@fluidframework/container-definitions": "workspace:~",
"@fluidframework/container-runtime-definitions": "workspace:~",
"@fluidframework/core-interfaces": "workspace:~",
"@fluidframework/devtools": "workspace:~",
"@fluidframework/driver-definitions": "workspace:~",
"@fluidframework/fluid-static": "workspace:~",
"@fluidframework/routerlicious-driver": "workspace:~",
"@fluidframework/runtime-utils": "workspace:~",
"@fluidframework/telemetry-utils": "workspace:~",
tylerbutler marked this conversation as resolved.
Show resolved Hide resolved
"@fluidframework/test-runtime-utils": "workspace:~",
"fluid-framework": "workspace:~",
"axios": "^1.7.7",
"process": "^0.11.10"
},
"devDependencies": {
Expand Down
22 changes: 0 additions & 22 deletions examples/apps/presence-tracker/src/Audience.ts

This file was deleted.

61 changes: 61 additions & 0 deletions examples/apps/presence-tracker/src/AzureFunctionTokenProvider.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*!
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
* Licensed under the MIT License.
*/

import { AzureMember } from "@fluidframework/azure-client";
import { ITokenProvider, ITokenResponse } from "@fluidframework/routerlicious-driver";
import axios from "axios";

/**
* Token Provider implementation for connecting to an Azure Function endpoint for
* Azure Fluid Relay token resolution. Note: this is a simplified implementation of
* TokenProvider. For production-ready applications, you should consider implementing
* the TokenProvider with retry logic, token caching, error handling, etc.
*/
export class AzureFunctionTokenProvider implements ITokenProvider {
/**
* Creates a new instance using configuration parameters.
* @param azFunctionUrl - URL to Azure Function endpoint
* @param user - User object
*/
public constructor(
private readonly azFunctionUrl: string,
private readonly user?: Pick<AzureMember, "id" | "name" | "additionalDetails">,
) {}

public async fetchOrdererToken(
tenantId: string,
documentId?: string,
refresh?: boolean,
): Promise<ITokenResponse> {
return {
jwt: await this.getToken(tenantId, documentId),
fromCache: false,
};
}

public async fetchStorageToken(
tenantId: string,
documentId: string,
refresh?: boolean,
): Promise<ITokenResponse> {
return {
jwt: await this.getToken(tenantId, documentId),
fromCache: false,
};
}

private async getToken(tenantId: string, documentId?: string): Promise<string> {
const response = await axios.get(this.azFunctionUrl, {
params: {
tenantId,
documentId,
id: this.user?.id,
name: this.user?.name,
additionalDetails: this.user?.additionalDetails as unknown,
},
});
return response.data as string;
}
}
122 changes: 0 additions & 122 deletions examples/apps/presence-tracker/src/FocusTracker.ts

This file was deleted.

115 changes: 0 additions & 115 deletions examples/apps/presence-tracker/src/MouseTracker.ts

This file was deleted.

Loading
Loading