Skip to content

Commit a7413c0

Browse files
committed
rebase data system config
1 parent e2821cd commit a7413c0

3 files changed

Lines changed: 16 additions & 34 deletions

File tree

packages/sdk/browser/example/src/app.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ statusBox.appendChild(document.createTextNode('Initializing...'));
2525

2626
const main = async () => {
2727
const ldclient = createClient(clientSideID, context, {
28-
useFDv2: true,
28+
// @ts-ignore dataSystem is @internal — experimental FDv2 opt-in
29+
dataSystem: {},
2930
});
3031
const render = () => {
3132
const flagValue = ldclient.variation(flagKey, false);
@@ -41,10 +42,10 @@ const main = async () => {
4142
);
4243
});
4344

44-
// Listen for flag changes
45-
ldclient.on('change', () => {
46-
render();
47-
});
45+
// // Listen for flag changes
46+
// ldclient.on('change', () => {
47+
// render();
48+
// });
4849

4950
ldclient.start();
5051

packages/sdk/browser/src/BrowserClient.ts

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -79,30 +79,23 @@ class BrowserClientImpl extends LDClientImpl {
7979
const { eventUrlTransformer } = validatedBrowserOptions;
8080
const endpoints = browserFdv1Endpoints(clientSideId);
8181

82-
const dataManagerFactory = validatedBrowserOptions.useFDv2
83-
? (
84-
flagManager: FlagManager,
85-
configuration: Configuration,
86-
baseHeaders: LDHeaders,
87-
emitter: LDEmitter,
88-
_diagnosticsManager?: internal.DiagnosticsManager,
89-
) =>
90-
new BrowserFDv2DataManager(
82+
const dataManagerFactory = (
83+
flagManager: FlagManager,
84+
configuration: Configuration,
85+
baseHeaders: LDHeaders,
86+
emitter: LDEmitter,
87+
diagnosticsManager?: internal.DiagnosticsManager,
88+
) =>
89+
configuration.dataSystem
90+
? new BrowserFDv2DataManager(
9191
platform,
9292
flagManager,
9393
clientSideId,
9494
configuration,
9595
baseHeaders,
9696
emitter,
9797
)
98-
: (
99-
flagManager: FlagManager,
100-
configuration: Configuration,
101-
baseHeaders: LDHeaders,
102-
emitter: LDEmitter,
103-
diagnosticsManager?: internal.DiagnosticsManager,
104-
) =>
105-
new BrowserDataManager(
98+
: new BrowserDataManager(
10699
platform,
107100
flagManager,
108101
clientSideId,

packages/sdk/browser/src/options.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,6 @@ export interface BrowserOptions extends Omit<LDOptionsBase, 'initialConnectionMo
5959
* A list of plugins to be used with the SDK.
6060
*/
6161
plugins?: LDPlugin[];
62-
63-
/**
64-
* Opt-in to the FDv2 data delivery protocol. When enabled, the SDK uses
65-
* the new `/sdk/poll/eval` and `/sdk/stream/eval` endpoints with the
66-
* FDv2 protocol handler and orchestrator.
67-
*
68-
* Default: false
69-
*/
70-
useFDv2?: boolean;
7162
}
7263

7364
export interface ValidatedOptions {
@@ -76,23 +67,20 @@ export interface ValidatedOptions {
7667
streaming?: boolean;
7768
automaticBackgroundHandling?: boolean;
7869
plugins: LDPlugin[];
79-
useFDv2: boolean;
8070
}
8171

8272
const optDefaults = {
8373
fetchGoals: true,
8474
eventUrlTransformer: (url: string) => url,
8575
streaming: undefined,
8676
plugins: [],
87-
useFDv2: false,
8877
};
8978

9079
const validators: { [Property in keyof BrowserOptions]: TypeValidator | undefined } = {
9180
fetchGoals: TypeValidators.Boolean,
9281
eventUrlTransformer: TypeValidators.Function,
9382
streaming: TypeValidators.Boolean,
9483
plugins: TypeValidators.createTypeArray('LDPlugin', {}),
95-
useFDv2: TypeValidators.Boolean,
9684
};
9785

9886
function withBrowserDefaults(opts: BrowserOptions): BrowserOptions {

0 commit comments

Comments
 (0)