@rpcbase/client 0.295.0 → 0.297.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apiClient/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apiClient/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAG1C,KAAK,GAAG,GAAG,GAAG,CAAA;AAGd,KAAK,UAAU,GAAG;IAChB,GAAG,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;KAC5C,CAAC,IAAI,MAAM,GAAG,CAAC,CAAC,EAAE,KAAK;CACzB,CAAC;AAEF,KAAK,eAAe,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACzD,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,aAAa,EACtB,GAAG,CAAC,EAAE,GAAG,KACN,OAAO,CAAC,SAAS,CAAC,CAAC;AAExB,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAC3D,KAAK,YAAY,CAAC,CAAC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;AAE7C,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC,eAAe,CAAC,CAAC;AAEtD,QAAA,IAAI,SAAS,EAAE,SAAS,CAAA;AAExB,eAAO,MAAM,aAAa,GAAU,OAAO,UAAU,kBAuDpD,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
package/dist/cleanupURL.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanupURL.d.ts","sourceRoot":"","sources":["../src/cleanupURL.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cleanupURL.d.ts","sourceRoot":"","sources":["../src/cleanupURL.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU,YA0CtB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RouteErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/components/RouteErrorBoundary.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RouteErrorBoundary.d.ts","sourceRoot":"","sources":["../../src/components/RouteErrorBoundary.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAA;AAGvD,KAAK,gBAAgB,GAAG,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAA;AAElE,KAAK,uBAAuB,GAAG;IAC7B,gBAAgB,CAAC,EAAE,gBAAgB,CAAA;CACpC,CAAA;AAkDD,eAAO,MAAM,kBAAkB,GAAI,sBAAsB,uBAAuB,4CAU/E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFeatureFlag.d.ts","sourceRoot":"","sources":["../src/getFeatureFlag.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"getFeatureFlag.d.ts","sourceRoot":"","sources":["../src/getFeatureFlag.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,cAAc,GACzB,MAAM,MAAM,KACX,OAAO,CAAC,OAAO,GAAG,MAAM,GAAG,SAAS,CAoDtC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import env from "@rpcbase/env";
|
|
1
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
3
|
import { StrictMode, useRef, useEffect, useCallback, useState, useSyncExternalStore } from "react";
|
|
3
4
|
import posthog from "posthog-js";
|
|
@@ -7,7 +8,7 @@ import { PostHogProvider } from "posthog-js/react";
|
|
|
7
8
|
import useMeasure from "react-use/esm/useMeasure.js";
|
|
8
9
|
let apiClient;
|
|
9
10
|
const initApiClient = async (args) => {
|
|
10
|
-
if (
|
|
11
|
+
if (env.SSR) {
|
|
11
12
|
if (!args) {
|
|
12
13
|
throw new Error("Server args must be provided in SSR mode");
|
|
13
14
|
}
|
|
@@ -54,7 +55,7 @@ const initApiClient = async (args) => {
|
|
|
54
55
|
};
|
|
55
56
|
const CLEANUP_WAIT_DELAY = 1e3;
|
|
56
57
|
const cleanupURL = () => {
|
|
57
|
-
if (
|
|
58
|
+
if (env.SSR) {
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
const runCleanup = () => {
|
|
@@ -124,7 +125,8 @@ const SsrErrorFallback = ({ state, renderErrorExtra }) => {
|
|
|
124
125
|
extra ? /* @__PURE__ */ jsx("div", { className: "mt-10 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-center", children: extra }) : null
|
|
125
126
|
] }) });
|
|
126
127
|
};
|
|
127
|
-
const isProduction =
|
|
128
|
+
const isProduction = env.MODE === "production";
|
|
129
|
+
console.log("IS PRODUCTION CHECK SEE HERE:", env.MODE, globalThis.__rb_env__.MODE === "production", isProduction, env.MODE, env.DEV);
|
|
128
130
|
const showErrorOverlay = (err) => {
|
|
129
131
|
const ErrorOverlay = customElements.get("vite-error-overlay");
|
|
130
132
|
if (!ErrorOverlay) {
|
|
@@ -742,10 +744,9 @@ function requireSnakeCase() {
|
|
|
742
744
|
}
|
|
743
745
|
var snakeCaseExports = requireSnakeCase();
|
|
744
746
|
const _snakeCase = /* @__PURE__ */ getDefaultExportFromCjs(snakeCaseExports);
|
|
745
|
-
const __vite_import_meta_env__ = { "BASE_URL": "/", "DEV": false, "MODE": "production", "PROD": true, "SSR": false };
|
|
746
747
|
const getFeatureFlag = async (flag) => {
|
|
747
748
|
const envKey = `RB_PUBLIC_FLAG_${_snakeCase(flag).toUpperCase()}`;
|
|
748
|
-
if (
|
|
749
|
+
if (env.SSR) {
|
|
749
750
|
if (process.env[envKey] !== void 0) {
|
|
750
751
|
return process.env[envKey];
|
|
751
752
|
}
|
|
@@ -774,8 +775,8 @@ const getFeatureFlag = async (flag) => {
|
|
|
774
775
|
}
|
|
775
776
|
});
|
|
776
777
|
};
|
|
777
|
-
if (
|
|
778
|
-
return
|
|
778
|
+
if (globalThis.__rb_env__[envKey] !== void 0) {
|
|
779
|
+
return globalThis.__rb_env__[envKey];
|
|
779
780
|
}
|
|
780
781
|
const startTime = performance.now();
|
|
781
782
|
const { posthog: posthog2 } = await import("posthog-js");
|
|
@@ -1594,7 +1595,7 @@ const toSsrErrorState = (error) => {
|
|
|
1594
1595
|
const data = error.data;
|
|
1595
1596
|
const message = typeof data === "string" ? data : data?.message || defaultState.message;
|
|
1596
1597
|
let details;
|
|
1597
|
-
if (
|
|
1598
|
+
if (env.DEV && data && typeof data !== "string") {
|
|
1598
1599
|
try {
|
|
1599
1600
|
details = JSON.stringify(data, null, 2);
|
|
1600
1601
|
} catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initWithRoutes.d.ts","sourceRoot":"","sources":["../src/initWithRoutes.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"initWithRoutes.d.ts","sourceRoot":"","sources":["../src/initWithRoutes.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAc,MAAM,OAAO,CAAA;AAE7C,OAAO,EAAsB,wBAAwB,EAAiB,MAAM,iBAAiB,CAAA;AAK7F,OAAO,EAGL,oBAAoB,EACrB,MAAM,iBAAiB,CAAA;AAmCxB,KAAK,qBAAqB,GAAG;IAC3B,0BAA0B,CAAC,EAAE,OAAO,CAAA;IACpC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,KAAK,SAAS,CAAA;CAC9D,CAAA;AAED,KAAK,aAAa,GAAG,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAC,CAAC,CAAC,CAAA;AA8BnE,eAAO,MAAM,cAAc,GACzB,eAAe,aAAa,EAC5B,OAAO,qBAAqB,kBA+E7B,CAAA"}
|