@rpcbase/client 0.313.0 → 0.314.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.
- package/dist/index.js +1 -60
- package/dist/initWithRoutes.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -124,7 +124,6 @@ const SsrErrorFallback = ({ state, renderErrorExtra }) => {
|
|
|
124
124
|
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
125
|
] }) });
|
|
126
126
|
};
|
|
127
|
-
const ROUTER_DEBUG = env.RB_PUBLIC_ROUTER_DEBUG;
|
|
128
127
|
const isProduction = env.MODE === "production";
|
|
129
128
|
const LOADER_TIMEOUT_MS = 8e3;
|
|
130
129
|
const showErrorOverlay = (err) => {
|
|
@@ -201,8 +200,6 @@ const hydrateSsrFallbackIfPresent = (rootElement, renderErrorExtra) => {
|
|
|
201
200
|
return true;
|
|
202
201
|
};
|
|
203
202
|
const initWithRoutes = async (routesElement, opts) => {
|
|
204
|
-
const enableRouterInstrumentation = ROUTER_DEBUG === "1" || ROUTER_DEBUG === "true" || ROUTER_DEBUG === true;
|
|
205
|
-
console.log("Router instrumentation enabled:", enableRouterInstrumentation);
|
|
206
203
|
const rootElement = getRootElement();
|
|
207
204
|
if (hydrateSsrFallbackIfPresent(rootElement, opts?.renderErrorExtra)) {
|
|
208
205
|
return;
|
|
@@ -212,63 +209,7 @@ const initWithRoutes = async (routesElement, opts) => {
|
|
|
212
209
|
handleServerErrors();
|
|
213
210
|
const routes = createRoutesFromElements(routesElement);
|
|
214
211
|
applyLoaderTimeouts(routes);
|
|
215
|
-
const router = createBrowserRouter(routes, {
|
|
216
|
-
basename: "/",
|
|
217
|
-
...enableRouterInstrumentation ? {
|
|
218
|
-
unstable_instrumentations: [{
|
|
219
|
-
router(router2) {
|
|
220
|
-
router2.instrument({
|
|
221
|
-
navigate: async (handler, info) => {
|
|
222
|
-
console.info("[rr7 navigate]", info);
|
|
223
|
-
const result = await handler();
|
|
224
|
-
if (result?.status === "error") {
|
|
225
|
-
console.error("[rr7 navigate error]", result.error);
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
fetch: async (handler, info) => {
|
|
229
|
-
console.info("[rr7 fetch]", info);
|
|
230
|
-
const result = await handler();
|
|
231
|
-
if (result?.status === "error") {
|
|
232
|
-
console.error("[rr7 fetch error]", result.error);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
},
|
|
237
|
-
route(route) {
|
|
238
|
-
route.instrument({
|
|
239
|
-
loader: async (handler, info) => {
|
|
240
|
-
console.info("[rr7 loader]", route.id, info);
|
|
241
|
-
const result = await handler();
|
|
242
|
-
if (result?.status === "error") {
|
|
243
|
-
console.error("[rr7 loader error]", route.id, result.error);
|
|
244
|
-
}
|
|
245
|
-
},
|
|
246
|
-
action: async (handler, info) => {
|
|
247
|
-
console.info("[rr7 action]", route.id, info);
|
|
248
|
-
const result = await handler();
|
|
249
|
-
if (result?.status === "error") {
|
|
250
|
-
console.error("[rr7 action error]", route.id, result.error);
|
|
251
|
-
}
|
|
252
|
-
},
|
|
253
|
-
middleware: async (handler, info) => {
|
|
254
|
-
console.info("[rr7 middleware]", route.id, info);
|
|
255
|
-
const result = await handler();
|
|
256
|
-
if (result?.status === "error") {
|
|
257
|
-
console.error("[rr7 middleware error]", route.id, result.error);
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
lazy: async (handler, info) => {
|
|
261
|
-
console.info("[rr7 lazy]", route.id, info);
|
|
262
|
-
const result = await handler();
|
|
263
|
-
if (result?.status === "error") {
|
|
264
|
-
console.error("[rr7 lazy error]", route.id, result.error);
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
}]
|
|
270
|
-
} : {}
|
|
271
|
-
});
|
|
212
|
+
const router = createBrowserRouter(routes, {});
|
|
272
213
|
const toError = (error) => error instanceof Error ? error : new Error(String(error));
|
|
273
214
|
const mentionsHydration = (value, depth = 0) => {
|
|
274
215
|
if (depth > 5) {
|
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAgFxB,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,kBAgF7B,CAAA"}
|