@statsig/react-bindings 2.1.1-beta.3 → 2.1.1-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@statsig/react-bindings",
|
|
3
|
-
"version": "2.1.1-beta.
|
|
3
|
+
"version": "2.1.1-beta.5",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@statsig/client-core": "2.1.1-beta.
|
|
5
|
+
"@statsig/client-core": "2.1.1-beta.5"
|
|
6
6
|
},
|
|
7
7
|
"peerDependencies": {
|
|
8
8
|
"react": "^16.6.3 || ^17.0.0 || ^18.0.0"
|
|
9
9
|
},
|
|
10
10
|
"optionalDependencies": {
|
|
11
|
-
"@statsig/js-client": "2.1.1-beta.
|
|
12
|
-
"@statsig/js-on-device-eval-client": "2.1.1-beta.
|
|
11
|
+
"@statsig/js-client": "2.1.1-beta.5",
|
|
12
|
+
"@statsig/js-on-device-eval-client": "2.1.1-beta.5"
|
|
13
13
|
},
|
|
14
14
|
"type": "commonjs",
|
|
15
15
|
"main": "./src/index.js",
|
|
@@ -3,21 +3,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.requireOptionalOnDeviceClientDependency = exports.requireOptionalClientDependency = void 0;
|
|
4
4
|
const client_core_1 = require("@statsig/client-core");
|
|
5
5
|
const NoopEvaluationsClient_1 = require("./NoopEvaluationsClient");
|
|
6
|
+
function _optionalRequire(modName) {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
8
|
+
return require(modName);
|
|
9
|
+
}
|
|
6
10
|
let jsClientMod = null;
|
|
7
11
|
try {
|
|
8
|
-
|
|
9
|
-
// jsClientMod = {StatsigClient};
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
11
|
-
jsClientMod = require('@statsig/js-client');
|
|
12
|
+
jsClientMod = _optionalRequire('@statsig' + '/js-client');
|
|
12
13
|
}
|
|
13
14
|
catch (error) {
|
|
14
15
|
// noop
|
|
15
16
|
}
|
|
16
17
|
let jsOnDeviceEvalClientMod = null;
|
|
17
18
|
try {
|
|
18
|
-
jsOnDeviceEvalClientMod =
|
|
19
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
20
|
-
require('@statsig/js-on-device-eval-client');
|
|
19
|
+
jsOnDeviceEvalClientMod = _optionalRequire('@statsig' + '/js-on-device-eval-client');
|
|
21
20
|
}
|
|
22
21
|
catch (error) {
|
|
23
22
|
// noop
|
|
@@ -25,8 +24,7 @@ catch (error) {
|
|
|
25
24
|
function requireOptionalClientDependency(sdkKey, initialUser, statsigOptions) {
|
|
26
25
|
let client;
|
|
27
26
|
if (jsClientMod) {
|
|
28
|
-
|
|
29
|
-
client = new StatsigClient(sdkKey, initialUser, statsigOptions);
|
|
27
|
+
client = new jsClientMod.StatsigClient(sdkKey, initialUser, statsigOptions);
|
|
30
28
|
}
|
|
31
29
|
else {
|
|
32
30
|
client = NoopEvaluationsClient_1.NoopEvaluationsClient;
|