Skip to content

Commit 6acddd5

Browse files
toddbaertbeeme1mr
andauthored
fix: bundlers wrongly resolving server/client modules (#445)
Fixes an issue that can cause bundlers in repos with both the web-sdk and js-sdk to incorrectly resolve and bundle module components because both modules use the same global symbols for the API. Signed-off-by: Todd Baert <[email protected]> Co-authored-by: Michael Beemer <[email protected]>
1 parent 7e469c4 commit 6acddd5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/client/src/open-feature.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { NOOP_PROVIDER } from './no-op-provider';
44
import { Client, Hook, Provider } from './types';
55

66
// use a symbol as a key for the global singleton
7-
const GLOBAL_OPENFEATURE_API_KEY = Symbol.for('@openfeature/js.api');
7+
const GLOBAL_OPENFEATURE_API_KEY = Symbol.for('@openfeature/web-sdk/api');
88

99
type OpenFeatureGlobal = {
1010
[GLOBAL_OPENFEATURE_API_KEY]?: OpenFeatureAPI;

packages/server/src/open-feature.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { Client, Hook, Provider } from './types';
66
import { objectOrUndefined, stringOrUndefined } from '@openfeature/shared/src/type-guards';
77

88
// use a symbol as a key for the global singleton
9-
const GLOBAL_OPENFEATURE_API_KEY = Symbol.for('@openfeature/js.api');
9+
const GLOBAL_OPENFEATURE_API_KEY = Symbol.for('@openfeature/js-sdk/api');
1010

1111
type OpenFeatureGlobal = {
1212
[GLOBAL_OPENFEATURE_API_KEY]?: OpenFeatureAPI;

0 commit comments

Comments
 (0)