@configdirector/react-native-sdk 0.9.1 → 0.9.3
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.
|
@@ -809,12 +809,15 @@ var PollingTransport = class extends AbstractPollingTransport {
|
|
|
809
809
|
}
|
|
810
810
|
async connect(context, timeout) {
|
|
811
811
|
this.clearPollingInterval();
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
812
|
+
try {
|
|
813
|
+
await this.fetchConfigs(context, timeout);
|
|
814
|
+
} finally {
|
|
815
|
+
if (!this.fatalError) this.schedulePollingInterval(() => {
|
|
816
|
+
this.fetchConfigs(context, timeout).catch((error) => {
|
|
817
|
+
this.logger.error("[PollingTransport] Error during polling:", error);
|
|
818
|
+
});
|
|
816
819
|
});
|
|
817
|
-
}
|
|
820
|
+
}
|
|
818
821
|
return this;
|
|
819
822
|
}
|
|
820
823
|
async fetchConfigs(context, timeout) {
|
|
@@ -869,6 +872,15 @@ const defaultUrlFactory = (input, base) => new URL(input, base === null || base
|
|
|
869
872
|
//#region ../shared/src/constants.ts
|
|
870
873
|
const CLIENT_BASE_URL = "https://client-sdk-api.configdirector.com";
|
|
871
874
|
//#endregion
|
|
875
|
+
//#region ../shared/src/instance-id.ts
|
|
876
|
+
const generateInstanceId = () => {
|
|
877
|
+
if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") return crypto.randomUUID();
|
|
878
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (placeholder) => {
|
|
879
|
+
const random = Math.random() * 16 | 0;
|
|
880
|
+
return (placeholder === "x" ? random : random & 3 | 8).toString(16);
|
|
881
|
+
});
|
|
882
|
+
};
|
|
883
|
+
//#endregion
|
|
872
884
|
//#region ../js-client-core/src/DefaultConfigDirectorClient.ts
|
|
873
885
|
const MAX_EXPONENTIAL_DELAY = 9;
|
|
874
886
|
var DefaultConfigDirectorClient = class {
|
|
@@ -889,7 +901,7 @@ var DefaultConfigDirectorClient = class {
|
|
|
889
901
|
_defineProperty(this, "currentContext", void 0);
|
|
890
902
|
_defineProperty(this, "connectionMode", void 0);
|
|
891
903
|
_defineProperty(this, "instanceId", void 0);
|
|
892
|
-
this.instanceId =
|
|
904
|
+
this.instanceId = generateInstanceId();
|
|
893
905
|
this.logger = (_clientOptions$logger = clientOptions === null || clientOptions === void 0 ? void 0 : clientOptions.logger) !== null && _clientOptions$logger !== void 0 ? _clientOptions$logger : createDefaultLogger();
|
|
894
906
|
this.timeout = (_clientOptions$connec = clientOptions === null || clientOptions === void 0 || (_clientOptions$connec2 = clientOptions.connection) === null || _clientOptions$connec2 === void 0 ? void 0 : _clientOptions$connec2.timeout) !== null && _clientOptions$connec !== void 0 ? _clientOptions$connec : 3e3;
|
|
895
907
|
this.validateSdkKeyPresence(clientSdkKey);
|
|
@@ -1635,7 +1647,7 @@ const createClient = (clientSdkKey, clientOptions) => {
|
|
|
1635
1647
|
const logger = (_clientOptions$logger = clientOptions === null || clientOptions === void 0 ? void 0 : clientOptions.logger) !== null && _clientOptions$logger !== void 0 ? _clientOptions$logger : createConsoleLogger("warn");
|
|
1636
1648
|
return new DefaultConfigDirectorClient(new ReactNativeTelemetryClient(clientSdkKey, (clientOptions === null || clientOptions === void 0 || (_clientOptions$connec = clientOptions.connection) === null || _clientOptions$connec === void 0 ? void 0 : _clientOptions$connec.url) ? urlFactory(clientOptions.connection.url) : CLIENT_BASE_URL, logger, urlFactory), clientSdkKey, {
|
|
1637
1649
|
sdkName: "react-native-sdk",
|
|
1638
|
-
sdkVersion: "0.9.
|
|
1650
|
+
sdkVersion: "0.9.3"
|
|
1639
1651
|
}, {
|
|
1640
1652
|
...clientOptions,
|
|
1641
1653
|
logger
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@configdirector/react-native-sdk",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "React Native client SDK for ConfigDirector. ConfigDirector is a remote configuration and feature flag service.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ConfigDirector",
|
|
@@ -59,6 +59,7 @@
|
|
|
59
59
|
"@babel/core": "^7.29.0",
|
|
60
60
|
"@eslint/js": "^10.0.1",
|
|
61
61
|
"@react-native/babel-preset": "^0.85.0",
|
|
62
|
+
"@react-native/jest-preset": "^0.86.2",
|
|
62
63
|
"@rollup/plugin-replace": "^6.0.3",
|
|
63
64
|
"@testing-library/react-native": "^13.3.3",
|
|
64
65
|
"@types/babel__core": "^7",
|
|
@@ -71,9 +72,9 @@
|
|
|
71
72
|
"eslint": "^10.7.0",
|
|
72
73
|
"jest": "^30.3.0",
|
|
73
74
|
"prettier": "^3.8.2",
|
|
74
|
-
"react": "19.
|
|
75
|
-
"react-native": "0.
|
|
76
|
-
"react-test-renderer": "19.
|
|
75
|
+
"react": "^19.2.8",
|
|
76
|
+
"react-native": "^0.86.2",
|
|
77
|
+
"react-test-renderer": "^19.2.8",
|
|
77
78
|
"tsdown": "^0.21.7",
|
|
78
79
|
"turbo": "^2.9.16",
|
|
79
80
|
"typescript": "^5.9.3",
|