@uniflowed/router 0.7.0 → 0.8.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.
@@ -24,12 +24,19 @@ export function hydrationOptions(
24
24
  recovery: ?Recovery,
25
25
  formState: FormState | void,
26
26
  ): HydrationOptions | void {
27
- if (recovery == null && formState == null) {
27
+ // React's default reporter dispatches a global error for a boundary it
28
+ // recovers by rendering on the client. Deno's Node compatibility layer
29
+ // treats that dispatch as an uncaught exception and exits the process.
30
+ // Keep the error visible without turning successful recovery into a crash.
31
+ const deno = "Deno" in globalThis;
32
+ if (recovery == null && formState == null && !deno) {
28
33
  return undefined;
29
34
  }
30
35
  const options: HydrationOptions = {};
31
36
  if (recovery != null) {
32
37
  options.onRecoverableError = recovery;
38
+ } else if (deno) {
39
+ options.onRecoverableError = (error) => console.error(error);
33
40
  }
34
41
  if (formState != null) {
35
42
  options.formState = formState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniflowed/router",
3
- "version": "0.7.0",
3
+ "version": "0.8.0",
4
4
  "description": "The file-system router for Flow React applications: matching, layouts, loaders, navigation, server rendering and hydration.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -73,8 +73,8 @@
73
73
  }
74
74
  },
75
75
  "dependencies": {
76
- "@uniflowed/hooks": "0.7.0",
77
- "@uniflowed/server": "0.7.0",
78
- "@uniflowed/validator": "0.7.0"
76
+ "@uniflowed/hooks": "0.8.0",
77
+ "@uniflowed/server": "0.8.0",
78
+ "@uniflowed/validator": "0.8.0"
79
79
  }
80
80
  }