@weftui/router 0.26.3 → 0.27.1
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/README.md +3 -1
- package/dist/client/index.d.ts +4 -4
- package/dist/client/index.js +22 -19
- package/dist/{compile-CQhAXB5f.d.ts → compile-BJFIgBbE.d.ts} +26 -30
- package/dist/{href-Deoi59OI.js → href-uvJ6b7zz.js} +11 -11
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{outlet-PoLEThsy.js → outlet-C9N4a4_F.js} +18 -13
- package/dist/{outlet-CGfLQgZS.d.ts → outlet-eoUQ-W0k.d.ts} +1 -1
- package/dist/server/index.d.ts +2 -2
- package/dist/server/index.js +19 -18
- package/docs/explanation/boundaries-and-suspense.md +10 -10
- package/docs/explanation/reactive-primitives.md +13 -11
- package/docs/explanation/rendering-model.md +1 -1
- package/docs/explanation/services-and-context.md +4 -4
- package/docs/how-to/add-routing.md +7 -5
- package/docs/how-to/author-components.md +5 -5
- package/docs/how-to/handle-forms.md +10 -10
- package/docs/how-to/load-async-data.md +4 -4
- package/docs/how-to/load-data-with-rpc.md +5 -5
- package/docs/how-to/provide-services.md +2 -2
- package/docs/how-to/use-element-refs.md +5 -5
- package/docs/reference/core.md +31 -20
- package/docs/reference/router.md +6 -6
- package/docs/tutorial/01-your-first-app.md +3 -1
- package/docs/tutorial/02-reactivity.md +6 -6
- package/docs/tutorial/03-services-and-async.md +3 -4
- package/docs/tutorial/04-errors-and-server.md +2 -2
- package/package.json +5 -7
|
@@ -18,10 +18,9 @@ import { h } from "@weftui/core";
|
|
|
18
18
|
import { mount } from "@weftui/dom/client";
|
|
19
19
|
import { Context, Effect, Layer, pipe } from "effect";
|
|
20
20
|
|
|
21
|
-
class Logger extends Context.
|
|
22
|
-
Logger,
|
|
23
|
-
|
|
24
|
-
>() {}
|
|
21
|
+
class Logger extends Context.Service<Logger, { log: (message: string) => Effect.Effect<void> }>()(
|
|
22
|
+
"Logger",
|
|
23
|
+
) {}
|
|
25
24
|
|
|
26
25
|
const LoggerLive = Layer.succeed(Logger, {
|
|
27
26
|
log: (message) => Effect.sync(() => console.log(message)),
|
|
@@ -20,12 +20,12 @@ import { Data, Effect } from "effect";
|
|
|
20
20
|
class ApiError extends Data.TaggedError("ApiError")<{ status: number }> {}
|
|
21
21
|
|
|
22
22
|
const SafeWidget = () =>
|
|
23
|
-
Boundary.
|
|
23
|
+
Boundary.catch({ fallback: (e) => h.div({ class: "error" }, `Request failed: ${e.status}`) }, [
|
|
24
24
|
Effect.fail(new ApiError({ status: 503 })),
|
|
25
25
|
]);
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
-
There are six failure-catch variants — `
|
|
28
|
+
There are six failure-catch variants — `catch`, `catchCause`, `catchTag`, `catchTags`, `catchFilter`, `catchIf` — mirroring Effect's own error operators. A failure that a boundary does not match re-raises to the **nearest enclosing** boundary; if none catches it, the mount fails. The conceptual model (and why the boundary's type reflects exactly which failures are handled) is [Boundaries and Suspense](https://weftui.dev/docs/explanation/boundaries-and-suspense).
|
|
29
29
|
|
|
30
30
|
## Render on the server
|
|
31
31
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@weftui/router",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.1",
|
|
4
4
|
"description": "Universal nested router for Weft — one route tree, server and client, with type-safe params and href",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"effect",
|
|
@@ -44,15 +44,13 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@weftui/core": "0.26.3",
|
|
50
|
-
"@weftui/dom": "0.26.3"
|
|
47
|
+
"@weftui/core": "0.27.1",
|
|
48
|
+
"@weftui/dom": "0.27.1"
|
|
51
49
|
},
|
|
52
50
|
"devDependencies": {
|
|
53
51
|
"@types/jsdom": "^28.0.3",
|
|
54
52
|
"@types/node": "^25.9.2",
|
|
55
|
-
"effect": "
|
|
53
|
+
"effect": "4.0.0-beta.98",
|
|
56
54
|
"jsdom": "^29.1.1",
|
|
57
55
|
"tsx": "^4.22.4",
|
|
58
56
|
"typescript": "^6.0.3",
|
|
@@ -60,6 +58,6 @@
|
|
|
60
58
|
"vite-plus": "0.2.2"
|
|
61
59
|
},
|
|
62
60
|
"peerDependencies": {
|
|
63
|
-
"effect": "
|
|
61
|
+
"effect": ">=4.0.0-beta.98 <4.0.0"
|
|
64
62
|
}
|
|
65
63
|
}
|