@real-router/svelte 0.15.16 → 0.15.18

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.
@@ -20,7 +20,21 @@
20
20
  state = { status: "loading" };
21
21
  let active = true;
22
22
 
23
- loader()
23
+ // Isolate a synchronously-throwing loader (#1476): a loader that throws
24
+ // *before* returning its promise (init work before the dynamic import) would
25
+ // otherwise escape the `.catch` below — the async channel only covers the
26
+ // returned promise — and bypass the error UI. The try/catch routes a sync
27
+ // throw into the same rejection path as an async failure, while still
28
+ // invoking the loader synchronously on mount (throw-isolation class, #806).
29
+ let pending: Promise<{ default: Component }>;
30
+
31
+ try {
32
+ pending = loader();
33
+ } catch (err) {
34
+ pending = Promise.reject(err);
35
+ }
36
+
37
+ pending
24
38
  .then((module) => {
25
39
  if (!active) return;
26
40
  if (!module || typeof module.default === "undefined") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@real-router/svelte",
3
- "version": "0.15.16",
3
+ "version": "0.15.18",
4
4
  "type": "module",
5
5
  "description": "Svelte 5 integration for Real-Router",
6
6
  "svelte": "./dist/index.js",
@@ -48,9 +48,9 @@
48
48
  "license": "MIT",
49
49
  "sideEffects": false,
50
50
  "dependencies": {
51
- "@real-router/core": "^0.75.0",
52
51
  "@real-router/route-utils": "^0.2.8",
53
- "@real-router/sources": "^0.11.1"
52
+ "@real-router/sources": "^0.11.2",
53
+ "@real-router/core": "^0.76.0"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@sveltejs/package": "2.5.8",
@@ -63,7 +63,7 @@
63
63
  "svelte": "~5.56.4",
64
64
  "svelte-check": "4.6.0",
65
65
  "svelte-eslint-parser": "1.8.0",
66
- "@real-router/browser-plugin": "^0.18.18"
66
+ "@real-router/browser-plugin": "^0.18.20"
67
67
  },
68
68
  "peerDependencies": {
69
69
  "svelte": ">=5.7.0"
@@ -73,7 +73,8 @@
73
73
  "test:properties": "vitest run --config vitest.config.properties.mts",
74
74
  "test:stress": "vitest run --config vitest.config.stress.mts",
75
75
  "type-check": "svelte-check --tsconfig ./tsconfig.json",
76
- "lint": "eslint --cache src/ tests/ --fix --max-warnings 0",
76
+ "lint": "eslint --cache src/ tests/ --max-warnings 0",
77
+ "lint:fix": "eslint --cache src/ tests/ --fix --max-warnings 0",
77
78
  "bundle": "svelte-package -i src -o dist && rimraf dist/dom-utils/CLAUDE.md"
78
79
  }
79
80
  }