Skip to content

Commit 14c7818

Browse files
authored
fix(client-presence): establish base compat version (#25841)
Currently all versions are capable of running against 2.71.0 instantiations and offer complete API.
1 parent 1bd9aa1 commit 14c7818

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

packages/framework/presence/src/getPresence.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,13 @@ const presenceCompatibility = {
3333
capabilities: new Set([]),
3434
} as const satisfies ExtensionCompatibilityDetails;
3535

36-
// Compatibility infrastructure was added in 2.71.0. Once version is bumped,
37-
// this can be used to accept instances from 2.71.0 and newer (up to current).
38-
// const minimalCompatiblePackageVersion = "2.71.0-0";
36+
/**
37+
* Minimal compatible package version.
38+
* If an existing presence extension is registered with this version or higher,
39+
* it can be used instead of instantiating new instance from this version of
40+
* the package (assuming also capabilities are compatible).
41+
*/
42+
const minimalCompatiblePackageVersion = "2.71.0";
3943

4044
function assertCompatibilityInvariants(compatibility: ExtensionCompatibilityDetails): void {
4145
assert(
@@ -123,7 +127,7 @@ const ContainerPresenceFactory = {
123127
requiredFeatures: [],
124128
} as const satisfies ILayerCompatSupportRequirements,
125129

126-
instanceExpectations: presenceCompatibility,
130+
instanceExpectations: { ...presenceCompatibility, version: minimalCompatiblePackageVersion },
127131

128132
resolvePriorInstantiation(
129133
existingInstantiation: ExtensionInstantiationResult<
@@ -144,13 +148,7 @@ const ContainerPresenceFactory = {
144148
},
145149

146150
[Symbol.hasInstance]: (instance: unknown): instance is ContainerPresenceManager => {
147-
return (
148-
instance instanceof ContainerPresenceManager
149-
// typeof instance === "object" &&
150-
// instance !== null &&
151-
// "extension" in instance &&
152-
// instance.extension instanceof ContainerPresenceManager
153-
);
151+
return instance instanceof ContainerPresenceManager;
154152
},
155153
} as const satisfies ContainerExtensionFactory<
156154
PresenceWithNotifications,

0 commit comments

Comments
 (0)