Skip to content

Commit 3a5cf08

Browse files
committed
fix: Consolidate common exports between base package and compat package.
1 parent d42ffc0 commit 3a5cf08

File tree

3 files changed

+32
-95
lines changed

3 files changed

+32
-95
lines changed

packages/sdk/browser/src/common.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export type {
2+
AutoEnvAttributes,
3+
BasicLogger,
4+
BasicLoggerOptions,
5+
EvaluationSeriesContext,
6+
EvaluationSeriesData,
7+
Hook,
8+
HookMetadata,
9+
IdentifySeriesContext,
10+
IdentifySeriesData,
11+
IdentifySeriesResult,
12+
IdentifySeriesStatus,
13+
LDContext,
14+
LDContextCommon,
15+
LDContextMeta,
16+
LDEvaluationDetail,
17+
LDEvaluationDetailTyped,
18+
LDEvaluationReason,
19+
LDFlagSet,
20+
LDInspection,
21+
LDLogger,
22+
LDLogLevel,
23+
LDMultiKindContext,
24+
LDSingleKindContext,
25+
} from '@launchdarkly/js-client-sdk-common';

packages/sdk/browser/src/compat/index.ts

Lines changed: 3 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -5,58 +5,12 @@
55
* Some code changes may still be required, for example {@link LDOptions} removes
66
* support for some previously available options.
77
*/
8-
import {
9-
basicLogger,
10-
EvaluationSeriesContext,
11-
EvaluationSeriesData,
12-
Hook,
13-
HookMetadata,
14-
IdentifySeriesContext,
15-
IdentifySeriesData,
16-
IdentifySeriesResult,
17-
IdentifySeriesStatus,
18-
LDContext,
19-
LDContextCommon,
20-
LDContextMeta,
21-
LDEvaluationDetail,
22-
LDEvaluationDetailTyped,
23-
LDEvaluationReason,
24-
LDFlagSet,
25-
LDIdentifyOptions,
26-
LDLogger,
27-
LDLogLevel,
28-
LDMultiKindContext,
29-
LDOptions,
30-
LDSingleKindContext,
31-
} from '..';
8+
import { LDContext, LDOptions } from '@launchdarkly/js-client-sdk-common';
9+
3210
import { LDClient } from './LDClientCompat';
3311
import LDClientCompatImpl from './LDClientCompatImpl';
3412

35-
export type {
36-
LDClient,
37-
LDFlagSet,
38-
LDContext,
39-
LDContextCommon,
40-
LDContextMeta,
41-
LDMultiKindContext,
42-
LDSingleKindContext,
43-
LDLogLevel,
44-
LDLogger,
45-
LDOptions,
46-
LDEvaluationDetail,
47-
LDEvaluationDetailTyped,
48-
LDEvaluationReason,
49-
LDIdentifyOptions,
50-
Hook,
51-
HookMetadata,
52-
EvaluationSeriesContext,
53-
EvaluationSeriesData,
54-
IdentifySeriesContext,
55-
IdentifySeriesData,
56-
IdentifySeriesResult,
57-
IdentifySeriesStatus,
58-
basicLogger,
59-
};
13+
export * from '../common';
6014

6115
/**
6216
* Creates an instance of the LaunchDarkly client. This version of initialization is for

packages/sdk/browser/src/index.ts

Lines changed: 4 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,63 +10,21 @@
1010
*
1111
* @packageDocumentation
1212
*/
13+
// The exported LDClient and LDOptions are the browser specific implementations.
14+
// These shadow the common implementations.
1315
import {
1416
AutoEnvAttributes,
1517
BasicLogger,
1618
BasicLoggerOptions,
17-
EvaluationSeriesContext,
18-
EvaluationSeriesData,
19-
Hook,
20-
HookMetadata,
21-
IdentifySeriesContext,
22-
IdentifySeriesData,
23-
IdentifySeriesResult,
24-
IdentifySeriesStatus,
25-
LDContext,
26-
LDContextCommon,
27-
LDContextMeta,
28-
LDEvaluationDetail,
29-
LDEvaluationDetailTyped,
30-
LDEvaluationReason,
31-
LDFlagSet,
32-
LDInspection,
3319
LDLogger,
34-
LDLogLevel,
35-
LDMultiKindContext,
36-
LDSingleKindContext,
3720
} from '@launchdarkly/js-client-sdk-common';
3821

39-
// The exported LDClient and LDOptions are the browser specific implementations.
40-
// These shadow the common implementations.
4122
import { BrowserClient, LDClient } from './BrowserClient';
4223
import { BrowserIdentifyOptions as LDIdentifyOptions } from './BrowserIdentifyOptions';
4324
import { BrowserOptions as LDOptions } from './options';
4425

45-
export type {
46-
LDClient,
47-
LDFlagSet,
48-
LDContext,
49-
LDContextCommon,
50-
LDContextMeta,
51-
LDMultiKindContext,
52-
LDSingleKindContext,
53-
LDLogLevel,
54-
LDLogger,
55-
LDOptions,
56-
LDEvaluationDetail,
57-
LDEvaluationDetailTyped,
58-
LDEvaluationReason,
59-
LDIdentifyOptions,
60-
Hook,
61-
HookMetadata,
62-
EvaluationSeriesContext,
63-
EvaluationSeriesData,
64-
IdentifySeriesContext,
65-
IdentifySeriesData,
66-
IdentifySeriesResult,
67-
IdentifySeriesStatus,
68-
LDInspection,
69-
};
26+
export * from './common';
27+
export type { LDIdentifyOptions, LDOptions, LDClient };
7028

7129
/**
7230
* Creates an instance of the LaunchDarkly client.

0 commit comments

Comments
 (0)