@weftui/core 0.26.2 → 0.27.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/README.md +9 -9
- package/dist/{index-B8idtfB3.d.ts → index-DMNuAQXj.d.ts} +70 -9
- package/dist/index.d.ts +250 -230
- package/dist/index.js +1 -1
- package/dist/rolldown-runtime-DK3Fl9T5.js +1 -0
- package/dist/types/index.d.ts +1 -1
- package/docs/explanation/boundaries-and-suspense.md +8 -8
- package/docs/explanation/reactive-primitives.md +13 -11
- package/docs/explanation/rendering-model.md +1 -1
- package/docs/explanation/services-and-context.md +3 -3
- package/docs/how-to/add-routing.md +17 -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 +1 -1
- package/docs/how-to/use-element-refs.md +5 -5
- package/docs/reference/core.md +31 -20
- package/docs/reference/router.md +9 -5
- 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 +3 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { E as Source, T as NoPropValue, a as SVGElements, r as Renderable, s as HTMLElements, t as ElementDescriptor } from "./index-
|
|
2
|
-
import { Cause, Context, Effect, Option, Stream
|
|
3
|
-
import { Rpc } from "
|
|
4
|
-
import { YieldWrap } from "effect/Utils";
|
|
1
|
+
import { D as Subscribable, E as Source, O as index_d_exports, T as NoPropValue, a as SVGElements, r as Renderable, s as HTMLElements, t as ElementDescriptor } from "./index-DMNuAQXj.js";
|
|
2
|
+
import { Cause, Context, Effect, Filter, Option, Stream } from "effect";
|
|
3
|
+
import { Rpc } from "effect/unstable/rpc";
|
|
5
4
|
|
|
6
5
|
//#region src/combinator/types.d.ts
|
|
7
6
|
/**
|
|
@@ -9,7 +8,7 @@ import { YieldWrap } from "effect/Utils";
|
|
|
9
8
|
* accept any E and R — not just `never`. Static values (string, number, etc.)
|
|
10
9
|
* are left unchanged. TypeScript distributes this over union types.
|
|
11
10
|
*/
|
|
12
|
-
type OpenPropSource<T> = T extends Stream.Stream<infer A, any, any> ? Stream.Stream<A, any, any> : T extends Effect.Effect<infer A, any, any> ? Effect.Effect<A, any, any> : T extends Subscribable
|
|
11
|
+
type OpenPropSource<T> = T extends Stream.Stream<infer A, any, any> ? Stream.Stream<A, any, any> : T extends Effect.Effect<infer A, any, any> ? Effect.Effect<A, any, any> : T extends Subscribable<infer A, any, any> ? Subscribable<A, any, any> : T;
|
|
13
12
|
/**
|
|
14
13
|
* A node in the combinator tree.
|
|
15
14
|
* IS an Effect — `yield*`, `Effect.gen`, and `pipe` all work natively. Resolves
|
|
@@ -35,9 +34,9 @@ declare namespace Node {
|
|
|
35
34
|
type Context<N> = [N] extends [Effect.Effect<any, any, infer R>] ? R : never;
|
|
36
35
|
}
|
|
37
36
|
/** Extract E from a props object — Stream/Effect/Subscribable prop values and Effect-returning event handlers contribute their E channel. */
|
|
38
|
-
type PropsE<P> = { [K in keyof P]: P[K] extends Stream.Stream<any, infer E, any> ? E : P[K] extends Effect.Effect<any, infer E, any> ? E : P[K] extends Subscribable
|
|
37
|
+
type PropsE<P> = { [K in keyof P]: P[K] extends Stream.Stream<any, infer E, any> ? E : P[K] extends Effect.Effect<any, infer E, any> ? E : P[K] extends Subscribable<any, infer E, any> ? E : P[K] extends ((...args: any[]) => infer Ret) ? Ret extends Effect.Effect<any, infer E, any> ? E : never : never }[keyof P];
|
|
39
38
|
/** Extract R from a props object — Stream/Effect/Subscribable prop values and Effect-returning event handlers contribute their R channel. */
|
|
40
|
-
type PropsR<P> = { [K in keyof P]: P[K] extends Stream.Stream<any, any, infer R> ? R : P[K] extends Effect.Effect<any, any, infer R> ? R : P[K] extends Subscribable
|
|
39
|
+
type PropsR<P> = { [K in keyof P]: P[K] extends Stream.Stream<any, any, infer R> ? R : P[K] extends Effect.Effect<any, any, infer R> ? R : P[K] extends Subscribable<any, any, infer R> ? R : P[K] extends ((...args: any[]) => infer Ret) ? Ret extends Effect.Effect<any, any, infer R> ? R : never : never }[keyof P];
|
|
41
40
|
/** Extract E from a children array — Node (Effect) and Stream children contribute their E. */
|
|
42
41
|
type ChildrenE<T extends readonly Renderable[]> = [T[number]] extends [never] ? never : { [K in keyof T]: T[K] extends Effect.Effect<any, infer E, any> ? E : T[K] extends Stream.Stream<any, infer E, any> ? E : never }[number];
|
|
43
42
|
/** Extract R from a children array — Node (Effect) and Stream children contribute their R. */
|
|
@@ -47,46 +46,9 @@ type ChildrenR<T extends readonly Renderable[]> = [T[number]] extends [never] ?
|
|
|
47
46
|
* allow any E/R — so callers can pass `Stream<T, E, R>` with real requirements.
|
|
48
47
|
*/
|
|
49
48
|
type CombinatorialProps<P> = { [K in keyof Omit<P, "children">]: OpenPropSource<Omit<P, "children">[K]> };
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Ambient, package-neutral seam for resolving a {@link Boundary.rpc} boundary's
|
|
54
|
-
* data through the application's merged `RpcGroup`. The DOM renderer
|
|
55
|
-
* (`@weftui/dom`) must resolve a boundary — on the server (SSR), during a
|
|
56
|
-
* client refetch, and on a client-first SPA mount — **without** importing
|
|
57
|
-
* `@effect/rpc` or `@weftui/router`. So the rpc caller is injected as a
|
|
58
|
-
* service: `@weftui/router` provides it (a network `RpcClient` on the browser,
|
|
59
|
-
* an in-process client over the handler layer on the server), and the renderer
|
|
60
|
-
* reads it from ambient context, treating `Option.none` (no router/rpc present)
|
|
61
|
-
* as a typed, descriptive error.
|
|
62
|
-
*
|
|
63
|
-
* The seam is **flat and untyped at the boundary**: a single `call(tag, payload)`
|
|
64
|
-
* that mirrors `RpcClient`'s flat-client shape (`(tag, payload) => Effect<success>`).
|
|
65
|
-
* The renderer carries the rpc's `successSchema`/`errorSchema` on the descriptor
|
|
66
|
-
* and owns decoding, so this seam stays free of `@effect/rpc` types.
|
|
67
|
-
*/
|
|
68
|
-
interface AppRpcClient {
|
|
69
|
-
/**
|
|
70
|
-
* Invoke the rpc identified by `tag` with `payload`, resolving to its decoded
|
|
71
|
-
* `success` value. The error channel is opaque (`unknown`): the renderer maps a
|
|
72
|
-
* resolved rpc **error** onto the boundary's typed-failure replay (SSR) or its
|
|
73
|
-
* resource's stale-on-error channel (refetch), while transport defects surface
|
|
74
|
-
* the same way. `payload` is the rpc's decoded payload value (already the shape
|
|
75
|
-
* the rpc's `payloadSchema` describes), not a serialized envelope.
|
|
76
|
-
*/
|
|
77
|
-
readonly call: (tag: string, payload: unknown) => Effect.Effect<unknown, unknown>;
|
|
49
|
+
declare namespace boundary_impl_d_exports {
|
|
50
|
+
export { CatchTagE, CatchTagsE, FAILURE_BOUNDARY, FailureProps, Resource, RpcOptions, SERVER_BOUNDARY, SUSPENSE_BOUNDARY, SuspenseProps, catch_ as catch, catchCause, catchFilter, catchIf, catchTag, catchTags, rpc, suspend };
|
|
78
51
|
}
|
|
79
|
-
declare const AppRpcClientTag_base: Context.TagClass<AppRpcClientTag, "@weftui/core/AppRpcClient", AppRpcClient>;
|
|
80
|
-
/**
|
|
81
|
-
* Context tag for the {@link AppRpcClient} seam. Provided by `@weftui/router`
|
|
82
|
-
* — a network client (`RouterLive`, POST `/_eui/rpc`) on the client, an
|
|
83
|
-
* in-process client over the handler layer (`RouterServer`) on the server. Absent
|
|
84
|
-
* in a router-less mount, where a {@link Boundary.rpc} resolves to a descriptive
|
|
85
|
-
* "needs router/rpc" error.
|
|
86
|
-
*/
|
|
87
|
-
declare class AppRpcClientTag extends AppRpcClientTag_base {}
|
|
88
|
-
//#endregion
|
|
89
|
-
//#region src/boundary/index.d.ts
|
|
90
52
|
/**
|
|
91
53
|
* Unique type tag used by renderers to identify a failure `Boundary` descriptor.
|
|
92
54
|
* All variants embed this symbol as `type` in the returned descriptor.
|
|
@@ -114,8 +76,8 @@ type CatchTagsE<C extends readonly Renderable[], Tags extends string> = Exclude<
|
|
|
114
76
|
* Boundary namespace encapsulating failure and suspense boundaries. Each
|
|
115
77
|
* variant wraps a subtree and shows a fallback in response to an event.
|
|
116
78
|
*
|
|
117
|
-
* - **Failure boundaries** (`
|
|
118
|
-
* `catchTags`, `
|
|
79
|
+
* - **Failure boundaries** (`catch`, `catchCause`, `catchTag`,
|
|
80
|
+
* `catchTags`, `catchFilter`, `catchIf`) intercept rendering-path errors —
|
|
119
81
|
* construction-time errors and post-mount stream failures — mirroring
|
|
120
82
|
* Effect's `catch*` combinators.
|
|
121
83
|
* - **Suspense boundary** (`suspend`) shows a fallback while async children are
|
|
@@ -130,199 +92,256 @@ type CatchTagsE<C extends readonly Renderable[], Tags extends string> = Exclude<
|
|
|
130
92
|
* import { Boundary, h } from "@weftui/core";
|
|
131
93
|
*
|
|
132
94
|
* // Failure boundary wrapping a suspense boundary — the common pairing:
|
|
133
|
-
* Boundary.
|
|
95
|
+
* Boundary.catch({ fallback: (e) => h.div({}, e.message) }, [
|
|
134
96
|
* Boundary.suspend({ fallback: h.div({}, "Loading…") }, [AsyncCard()]),
|
|
135
97
|
* ])
|
|
136
98
|
* ```
|
|
137
99
|
*/
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
interface FailureProps {
|
|
145
|
-
/**
|
|
146
|
-
* Called with the caught `Cause`. Returns a fallback `Node` if this boundary
|
|
147
|
-
* handles the error, or `null` to re-raise to a parent boundary.
|
|
148
|
-
*/
|
|
149
|
-
readonly match: (cause: Cause.Cause<unknown>) => Node<unknown, unknown> | null;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Props for the {@link suspend} boundary — used by renderers to access
|
|
153
|
-
* `fallback` and `children` from the node descriptor.
|
|
154
|
-
*/
|
|
155
|
-
interface SuspenseProps {
|
|
156
|
-
/**
|
|
157
|
-
* Shown in the DOM while async children are pending. Pass `null` or omit to
|
|
158
|
-
* render nothing (only the comment markers) while pending.
|
|
159
|
-
*/
|
|
160
|
-
readonly fallback?: Renderable;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Catch all typed failures (not defects). The children's `E` is fully
|
|
164
|
-
* consumed; the output `E` is only the fallback's error channel.
|
|
165
|
-
*/
|
|
166
|
-
function catchAll<C extends readonly Renderable[], FE = never, FR = never>(props: {
|
|
167
|
-
readonly fallback: (e: ChildrenE<C>) => Node<FE, FR>;
|
|
168
|
-
}, children: C): Node<FE, ChildrenR<C> | FR>;
|
|
169
|
-
/**
|
|
170
|
-
* Catch all causes including defects and interruptions. The children's `E`
|
|
171
|
-
* is fully consumed; the output `E` is only the fallback's error channel.
|
|
172
|
-
*/
|
|
173
|
-
function catchAllCause<C extends readonly Renderable[], FE = never, FR = never>(props: {
|
|
174
|
-
readonly fallback: (cause: Cause.Cause<ChildrenE<C>>) => Node<FE, FR>;
|
|
175
|
-
}, children: C): Node<FE, ChildrenR<C> | FR>;
|
|
100
|
+
/**
|
|
101
|
+
* Internal descriptor props shared by the failure `Boundary.*` variants
|
|
102
|
+
* (everything except {@link suspend}). The renderer reads `match` to decide
|
|
103
|
+
* how to handle a caught error.
|
|
104
|
+
*/
|
|
105
|
+
interface FailureProps {
|
|
176
106
|
/**
|
|
177
|
-
*
|
|
178
|
-
*
|
|
107
|
+
* Called with the caught `Cause`. Returns a fallback `Node` if this boundary
|
|
108
|
+
* handles the error, or `null` to re-raise to a parent boundary.
|
|
179
109
|
*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}, children: C): Node<CatchTagE<C, Tag> | FE, ChildrenR<C> | FR>;
|
|
110
|
+
readonly match: (cause: Cause.Cause<unknown>) => Node<unknown, unknown> | null;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Props for the {@link suspend} boundary — used by renderers to access
|
|
114
|
+
* `fallback` and `children` from the node descriptor.
|
|
115
|
+
*/
|
|
116
|
+
interface SuspenseProps {
|
|
188
117
|
/**
|
|
189
|
-
*
|
|
190
|
-
*
|
|
191
|
-
* The handlers record IS the first argument (no wrapping object).
|
|
118
|
+
* Shown in the DOM while async children are pending. Pass `null` or omit to
|
|
119
|
+
* render nothing (only the comment markers) while pending.
|
|
192
120
|
*/
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
121
|
+
readonly fallback?: Renderable;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Catch all typed failures (not defects). The children's `E` is fully
|
|
125
|
+
* consumed; the output `E` is only the fallback's error channel.
|
|
126
|
+
*
|
|
127
|
+
* Mirrors Effect 4's `Effect.catch` (renamed from `catchAll` in v3).
|
|
128
|
+
*/
|
|
129
|
+
declare function catch_<C extends readonly Renderable[], FE = never, FR = never>(props: {
|
|
130
|
+
readonly fallback: (e: ChildrenE<C>) => Node<FE, FR>;
|
|
131
|
+
}, children: C): Node<FE, ChildrenR<C> | FR>;
|
|
132
|
+
/**
|
|
133
|
+
* Catch all causes including defects and interruptions. The children's `E`
|
|
134
|
+
* is fully consumed; the output `E` is only the fallback's error channel.
|
|
135
|
+
*
|
|
136
|
+
* Mirrors Effect 4's `Effect.catchCause` (renamed from `catchAllCause` in v3).
|
|
137
|
+
*/
|
|
138
|
+
declare function catchCause<C extends readonly Renderable[], FE = never, FR = never>(props: {
|
|
139
|
+
readonly fallback: (cause: Cause.Cause<ChildrenE<C>>) => Node<FE, FR>;
|
|
140
|
+
}, children: C): Node<FE, ChildrenR<C> | FR>;
|
|
141
|
+
/**
|
|
142
|
+
* Catch errors whose `_tag` matches `props.tag`. The matched tag is removed
|
|
143
|
+
* from the output `E`; unmatched errors are re-raised.
|
|
144
|
+
*/
|
|
145
|
+
declare function catchTag<C extends readonly Renderable[], Tag extends (ChildrenE<C> extends {
|
|
146
|
+
_tag: string;
|
|
147
|
+
} ? ChildrenE<C>["_tag"] : string), FE = never, FR = never>(props: {
|
|
148
|
+
readonly tag: Tag;
|
|
149
|
+
readonly fallback: (e: Extract<ChildrenE<C>, {
|
|
196
150
|
_tag: Tag;
|
|
197
|
-
}>) => Node<
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
151
|
+
}>) => Node<FE, FR>;
|
|
152
|
+
}, children: C): Node<CatchTagE<C, Tag> | FE, ChildrenR<C> | FR>;
|
|
153
|
+
/**
|
|
154
|
+
* Catch errors whose `_tag` matches a key in the handlers record. Each
|
|
155
|
+
* matched tag is removed from the output `E`; unmatched errors are re-raised.
|
|
156
|
+
* The handlers record IS the first argument (no wrapping object).
|
|
157
|
+
*/
|
|
158
|
+
declare function catchTags<C extends readonly Renderable[], Handlers extends { readonly [Tag in ChildrenE<C> extends {
|
|
159
|
+
_tag: string;
|
|
160
|
+
} ? ChildrenE<C>["_tag"] : never]?: (e: Extract<ChildrenE<C>, {
|
|
161
|
+
_tag: Tag;
|
|
162
|
+
}>) => Node<any, any> }>(handlers: Handlers, children: C): Node<CatchTagsE<C, keyof Handlers & string> | { [K in keyof Handlers]: Handlers[K] extends ((e: any) => Node<infer E, any>) ? E : never }[keyof Handlers], ChildrenR<C> | { [K in keyof Handlers]: Handlers[K] extends ((e: any) => Node<any, infer R>) ? R : never }[keyof Handlers]>;
|
|
163
|
+
/**
|
|
164
|
+
* Conditionally catch using a `Filter`. The `filter` runs on each typed
|
|
165
|
+
* failure: a `Result.succeed` (pass) recovers via `fallback`, receiving the
|
|
166
|
+
* possibly-narrowed pass value; a `Result.fail` re-raises the error (its
|
|
167
|
+
* `Fail` channel `X` is preserved in the output `E`, since the boundary may
|
|
168
|
+
* not handle any given error).
|
|
169
|
+
*
|
|
170
|
+
* Mirrors Effect 4's `Effect.catchFilter` (renamed from `catchSome`, which
|
|
171
|
+
* took an `Option`-returning function in v3).
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```ts
|
|
175
|
+
* import { Boundary } from "@weftui/core";
|
|
176
|
+
* import { Filter, Result } from "effect";
|
|
177
|
+
*
|
|
178
|
+
* Boundary.catchFilter(
|
|
179
|
+
* Filter.make((e: AppError) =>
|
|
180
|
+
* e._tag === "Net" ? Result.succeed(e) : Result.fail(e),
|
|
181
|
+
* ),
|
|
182
|
+
* (matched) => h.div({}, matched.message),
|
|
183
|
+
* [Widget()],
|
|
184
|
+
* );
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
declare function catchFilter<C extends readonly Renderable[], EB, X, FE = never, FR = never>(filter: Filter.Filter<ChildrenE<C>, EB, X>, fallback: (matched: EB) => Node<FE, FR>, children: C): Node<X | FE, ChildrenR<C> | FR>;
|
|
188
|
+
/**
|
|
189
|
+
* Conditionally catch — a predicate gates the fallback. If the predicate
|
|
190
|
+
* returns `false`, the error is re-raised. The children's `E` is preserved
|
|
191
|
+
* in the output since the boundary may not handle any given error.
|
|
192
|
+
*/
|
|
193
|
+
declare function catchIf<C extends readonly Renderable[], FE = never, FR = never>(props: {
|
|
194
|
+
readonly predicate: (e: ChildrenE<C>) => boolean;
|
|
195
|
+
readonly fallback: (e: ChildrenE<C>) => Node<FE, FR>;
|
|
196
|
+
}, children: C): Node<ChildrenE<C> | FE, ChildrenR<C> | FR>;
|
|
197
|
+
/**
|
|
198
|
+
* Creates a suspense boundary node.
|
|
199
|
+
*
|
|
200
|
+
* Shows `fallback` while async children are pending (have not yet emitted
|
|
201
|
+
* their first value), then atomically swaps to the resolved children once
|
|
202
|
+
* **all** pending children have settled.
|
|
203
|
+
*
|
|
204
|
+
* The renderer (`@weftui/dom`) identifies the boundary via its
|
|
205
|
+
* {@link SUSPENSE_BOUNDARY} type tag.
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```ts
|
|
209
|
+
* import { Boundary, h } from "@weftui/core";
|
|
210
|
+
*
|
|
211
|
+
* Boundary.suspend({ fallback: h.div({}, "Loading…") }, [AsyncCard(), AsyncSidebar()])
|
|
212
|
+
* ```
|
|
213
|
+
*/
|
|
214
|
+
declare function suspend<C extends readonly Renderable[]>(props: SuspenseProps, children: C): Node<ChildrenE<C>, ChildrenR<C>>;
|
|
215
|
+
/**
|
|
216
|
+
* Reactive handle handed to a {@link rpc} boundary's `render`. After
|
|
217
|
+
* hydrate the region is no longer inert: `value` is seeded with the SSR
|
|
218
|
+
* payload and the client can {@link Resource.refetch} the same data on demand,
|
|
219
|
+
* patching the rendered subtree in place via the renderer's existing
|
|
220
|
+
* reactive-child machinery.
|
|
221
|
+
*
|
|
222
|
+
* On the **server** and on the **first client paint after hydrate** `value`
|
|
223
|
+
* emits the SSR `data` first (await-first), so SSR HTML and the adopted DOM are
|
|
224
|
+
* byte-identical — no fallback flash.
|
|
225
|
+
*
|
|
226
|
+
* @typeParam A - The loaded data shape.
|
|
227
|
+
*/
|
|
228
|
+
interface Resource<A> {
|
|
206
229
|
/**
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
* in the output since the boundary may not handle any given error.
|
|
230
|
+
* The current data. Seeded with the SSR `data`; a successful refetch pushes
|
|
231
|
+
* the new value here so the subtree patches in place.
|
|
210
232
|
*/
|
|
211
|
-
|
|
212
|
-
readonly predicate: (e: ChildrenE<C>) => boolean;
|
|
213
|
-
readonly fallback: (e: ChildrenE<C>) => Node<FE, FR>;
|
|
214
|
-
}, children: C): Node<ChildrenE<C> | FE, ChildrenR<C> | FR>;
|
|
233
|
+
readonly value: Subscribable<A>;
|
|
215
234
|
/**
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
*
|
|
219
|
-
* their first value), then atomically swaps to the resolved children once
|
|
220
|
-
* **all** pending children have settled.
|
|
221
|
-
*
|
|
222
|
-
* The renderer (`@weftui/dom`) identifies the boundary via its
|
|
223
|
-
* {@link SUSPENSE_BOUNDARY} type tag.
|
|
224
|
-
*
|
|
225
|
-
* @example
|
|
226
|
-
* ```ts
|
|
227
|
-
* import { Boundary, h } from "@weftui/core";
|
|
228
|
-
*
|
|
229
|
-
* Boundary.suspend({ fallback: h.div({}, "Loading…") }, [AsyncCard(), AsyncSidebar()])
|
|
230
|
-
* ```
|
|
235
|
+
* Triggers an rpc-backed reload (client only; a no-op on the server). Calls
|
|
236
|
+
* {@link AppRpcClient.call} with the boundary's rpc `tag` and a fresh
|
|
237
|
+
* `payload()`, then sets {@link Resource.value} with the decoded success.
|
|
231
238
|
*/
|
|
232
|
-
|
|
239
|
+
readonly refetch: Effect.Effect<void>;
|
|
240
|
+
/** `true` while a refetch is in flight (`false` on the server / before any refetch). */
|
|
241
|
+
readonly pending: Subscribable<boolean>;
|
|
233
242
|
/**
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
* patching the rendered subtree in place via the renderer's existing
|
|
238
|
-
* reactive-child machinery.
|
|
239
|
-
*
|
|
240
|
-
* On the **server** and on the **first client paint after hydrate** `value`
|
|
241
|
-
* emits the SSR `data` first (await-first), so SSR HTML and the adopted DOM are
|
|
242
|
-
* byte-identical — no fallback flash.
|
|
243
|
-
*
|
|
244
|
-
* @typeParam A - The loaded data shape.
|
|
243
|
+
* `Some` with the last refetch error, else `None`. A failed refetch leaves
|
|
244
|
+
* the previous `value` intact (stale-on-error) — it does **not** unmount the
|
|
245
|
+
* subtree or raise into an enclosing failure `Boundary`.
|
|
245
246
|
*/
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Triggers an rpc-backed reload (client only; a no-op on the server). Calls
|
|
254
|
-
* {@link AppRpcClient.call} with the boundary's rpc `tag` and a fresh
|
|
255
|
-
* `payload()`, then sets {@link Resource.value} with the decoded success.
|
|
256
|
-
*/
|
|
257
|
-
readonly refetch: Effect.Effect<void>;
|
|
258
|
-
/** `true` while a refetch is in flight (`false` on the server / before any refetch). */
|
|
259
|
-
readonly pending: Subscribable.Subscribable<boolean>;
|
|
260
|
-
/**
|
|
261
|
-
* `Some` with the last refetch error, else `None`. A failed refetch leaves
|
|
262
|
-
* the previous `value` intact (stale-on-error) — it does **not** unmount the
|
|
263
|
-
* subtree or raise into an enclosing failure `Boundary`.
|
|
264
|
-
*/
|
|
265
|
-
readonly error: Subscribable.Subscribable<Option.Option<unknown>>;
|
|
266
|
-
}
|
|
247
|
+
readonly error: Subscribable<Option.Option<unknown>>;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Options for the {@link rpc} boundary.
|
|
251
|
+
*/
|
|
252
|
+
interface RpcOptions {
|
|
267
253
|
/**
|
|
268
|
-
*
|
|
254
|
+
* Shown between the boundary's comment markers while a **client-first** mount
|
|
255
|
+
* (no SSR payload present) resolves the rpc. Unused on the SSR/hydrate path,
|
|
256
|
+
* where the seeded payload renders directly with no fallback flash. Pass
|
|
257
|
+
* `null` or omit to render nothing while pending.
|
|
269
258
|
*/
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
259
|
+
readonly fallback?: Renderable;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Creates an rpc-backed server render boundary.
|
|
263
|
+
*
|
|
264
|
+
* The boundary is a thin consumer of one `Rpc` from the application's merged
|
|
265
|
+
* `RpcGroup`. Its data source is the ambient {@link AppRpcClient}: there is no
|
|
266
|
+
* co-located `load`, no `provide`, no per-boundary `id`/registry — the rpc
|
|
267
|
+
* **tag** is the stable identity and the rpc **payload schema** is the typed
|
|
268
|
+
* input. The handler lives in the server-only rpc Layer, so nothing here needs a
|
|
269
|
+
* bundler prune.
|
|
270
|
+
*
|
|
271
|
+
* - **SSR**: the server renderer calls `AppRpcClient.call(tag, payload())`
|
|
272
|
+
* (an in-process client over the handler Layer), encodes the success through
|
|
273
|
+
* the rpc's `successSchema` inline as a `<script type="application/json">`
|
|
274
|
+
* payload, and renders `render(seededResource)` to HTML in place.
|
|
275
|
+
* - **Hydrate**: reads the inline payload at the cursor, decodes via
|
|
276
|
+
* `successSchema`, seeds the {@link Resource}, and adopts the DOM — replaying
|
|
277
|
+
* the server result, never re-calling the rpc.
|
|
278
|
+
* - **Refetch**: `Resource.refetch` calls `AppRpcClient.call(tag, payload())`
|
|
279
|
+
* over the network and patches the subtree in place (stale-on-error).
|
|
280
|
+
* - **Client-first mount** (SPA navigation, no SSR payload): renders `fallback`,
|
|
281
|
+
* forks an `AppRpcClient.call(tag, payload())`, then swaps in
|
|
282
|
+
* `render(resource)` once it resolves.
|
|
283
|
+
*
|
|
284
|
+
* `payload` is a thunk so a fresh payload is produced per call (SSR, refetch,
|
|
285
|
+
* mount) — its return type is the rpc's decoded payload. The renderer identifies
|
|
286
|
+
* the boundary via its {@link SERVER_BOUNDARY} type tag.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```ts
|
|
290
|
+
* import { Boundary, h } from "@weftui/core";
|
|
291
|
+
* import { Rpc, RpcGroup } from "effect/unstable/rpc";
|
|
292
|
+
* import { Schema } from "effect";
|
|
293
|
+
*
|
|
294
|
+
* const StockRpcs = RpcGroup.make(
|
|
295
|
+
* Rpc.make("GetStock", { payload: { id: Schema.String }, success: Stock }),
|
|
296
|
+
* );
|
|
297
|
+
*
|
|
298
|
+
* Boundary.rpc(
|
|
299
|
+
* StockRpcs.requests.GetStock,
|
|
300
|
+
* () => ({ id: product.id }),
|
|
301
|
+
* (resource) => h.div({}, resource.value),
|
|
302
|
+
* { fallback: h.div({}, "Loading stock…") },
|
|
303
|
+
* )
|
|
304
|
+
* ```
|
|
305
|
+
*/
|
|
306
|
+
declare function rpc<R extends Rpc.Any, C extends Node<any, any>>(rpc: R, payload: () => Rpc.Payload<R>, render: (resource: Resource<Rpc.Success<R>>) => C, options?: RpcOptions): Node<Node.Error<C> | Rpc.Error<R>, Node.Context<C>>;
|
|
307
|
+
//#endregion
|
|
308
|
+
//#region src/boundary/rpc-client.d.ts
|
|
309
|
+
/**
|
|
310
|
+
* Ambient, package-neutral seam for resolving a {@link Boundary.rpc} boundary's
|
|
311
|
+
* data through the application's merged `RpcGroup`. The DOM renderer
|
|
312
|
+
* (`@weftui/dom`) must resolve a boundary — on the server (SSR), during a
|
|
313
|
+
* client refetch, and on a client-first SPA mount — **without** importing
|
|
314
|
+
* `effect/unstable/rpc` or `@weftui/router`. So the rpc caller is injected as a
|
|
315
|
+
* service: `@weftui/router` provides it (a network `RpcClient` on the browser,
|
|
316
|
+
* an in-process client over the handler layer on the server), and the renderer
|
|
317
|
+
* reads it from ambient context, treating `Option.none` (no router/rpc present)
|
|
318
|
+
* as a typed, descriptive error.
|
|
319
|
+
*
|
|
320
|
+
* The seam is **flat and untyped at the boundary**: a single `call(tag, payload)`
|
|
321
|
+
* that mirrors `RpcClient`'s flat-client shape (`(tag, payload) => Effect<success>`).
|
|
322
|
+
* The renderer carries the rpc's `successSchema`/`errorSchema` on the descriptor
|
|
323
|
+
* and owns decoding, so this seam stays free of `effect/unstable/rpc` types.
|
|
324
|
+
*/
|
|
325
|
+
interface AppRpcClient {
|
|
279
326
|
/**
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
*
|
|
283
|
-
*
|
|
284
|
-
*
|
|
285
|
-
*
|
|
286
|
-
* input. The handler lives in the server-only rpc Layer, so nothing here needs a
|
|
287
|
-
* bundler prune.
|
|
288
|
-
*
|
|
289
|
-
* - **SSR**: the server renderer calls `AppRpcClient.call(tag, payload())`
|
|
290
|
-
* (an in-process client over the handler Layer), encodes the success through
|
|
291
|
-
* the rpc's `successSchema` inline as a `<script type="application/json">`
|
|
292
|
-
* payload, and renders `render(seededResource)` to HTML in place.
|
|
293
|
-
* - **Hydrate**: reads the inline payload at the cursor, decodes via
|
|
294
|
-
* `successSchema`, seeds the {@link Resource}, and adopts the DOM — replaying
|
|
295
|
-
* the server result, never re-calling the rpc.
|
|
296
|
-
* - **Refetch**: `Resource.refetch` calls `AppRpcClient.call(tag, payload())`
|
|
297
|
-
* over the network and patches the subtree in place (stale-on-error).
|
|
298
|
-
* - **Client-first mount** (SPA navigation, no SSR payload): renders `fallback`,
|
|
299
|
-
* forks an `AppRpcClient.call(tag, payload())`, then swaps in
|
|
300
|
-
* `render(resource)` once it resolves.
|
|
301
|
-
*
|
|
302
|
-
* `payload` is a thunk so a fresh payload is produced per call (SSR, refetch,
|
|
303
|
-
* mount) — its return type is the rpc's decoded payload. The renderer identifies
|
|
304
|
-
* the boundary via its {@link SERVER_BOUNDARY} type tag.
|
|
305
|
-
*
|
|
306
|
-
* @example
|
|
307
|
-
* ```ts
|
|
308
|
-
* import { Boundary, h } from "@weftui/core";
|
|
309
|
-
* import { Rpc, RpcGroup } from "@effect/rpc";
|
|
310
|
-
* import { Schema } from "effect";
|
|
311
|
-
*
|
|
312
|
-
* const StockRpcs = RpcGroup.make(
|
|
313
|
-
* Rpc.make("GetStock", { payload: { id: Schema.String }, success: Stock }),
|
|
314
|
-
* );
|
|
315
|
-
*
|
|
316
|
-
* Boundary.rpc(
|
|
317
|
-
* StockRpcs.requests.GetStock,
|
|
318
|
-
* () => ({ id: product.id }),
|
|
319
|
-
* (resource) => h.div({}, resource.value),
|
|
320
|
-
* { fallback: h.div({}, "Loading stock…") },
|
|
321
|
-
* )
|
|
322
|
-
* ```
|
|
327
|
+
* Invoke the rpc identified by `tag` with `payload`, resolving to its decoded
|
|
328
|
+
* `success` value. The error channel is opaque (`unknown`): the renderer maps a
|
|
329
|
+
* resolved rpc **error** onto the boundary's typed-failure replay (SSR) or its
|
|
330
|
+
* resource's stale-on-error channel (refetch), while transport defects surface
|
|
331
|
+
* the same way. `payload` is the rpc's decoded payload value (already the shape
|
|
332
|
+
* the rpc's `payloadSchema` describes), not a serialized envelope.
|
|
323
333
|
*/
|
|
324
|
-
|
|
334
|
+
readonly call: (tag: string, payload: unknown) => Effect.Effect<unknown, unknown>;
|
|
325
335
|
}
|
|
336
|
+
declare const AppRpcClientTag_base: Context.ServiceClass<AppRpcClientTag, "@weftui/core/AppRpcClient", AppRpcClient>;
|
|
337
|
+
/**
|
|
338
|
+
* Context tag for the {@link AppRpcClient} seam. Provided by `@weftui/router`
|
|
339
|
+
* — a network client (`RouterLive`, POST `/_eui/rpc`) on the client, an
|
|
340
|
+
* in-process client over the handler layer (`RouterServer`) on the server. Absent
|
|
341
|
+
* in a router-less mount, where a {@link Boundary.rpc} resolves to a descriptive
|
|
342
|
+
* "needs router/rpc" error.
|
|
343
|
+
*/
|
|
344
|
+
declare class AppRpcClientTag extends AppRpcClientTag_base {}
|
|
326
345
|
//#endregion
|
|
327
346
|
//#region src/server/brand.d.ts
|
|
328
347
|
/**
|
|
@@ -347,10 +366,11 @@ interface ServerOnly {
|
|
|
347
366
|
*/
|
|
348
367
|
type ServerOnlyLeak = "A server-only Tag (ServerTag) leaked into the client requirement channel R. Discharge it on the server via Boundary.server's `provide`.";
|
|
349
368
|
/**
|
|
350
|
-
* A `Context.
|
|
369
|
+
* A `Context.Service` key whose identifier carries the {@link ServerOnly} brand.
|
|
351
370
|
*
|
|
352
|
-
* Use it exactly like `Context.
|
|
353
|
-
* on the server (e.g. a database handle behind a `Boundary.server`
|
|
371
|
+
* Use it exactly like `Context.Service` for services that must only ever be
|
|
372
|
+
* provided on the server (e.g. a database handle behind a `Boundary.server`
|
|
373
|
+
* `load`):
|
|
354
374
|
*
|
|
355
375
|
* ```ts
|
|
356
376
|
* class Database extends ServerTag("Database")<Database, DatabaseShape>() {}
|
|
@@ -361,7 +381,7 @@ type ServerOnlyLeak = "A server-only Tag (ServerTag) leaked into the client requ
|
|
|
361
381
|
* server, and {@link AssertNoServerOnly} rejects it should it ever reach
|
|
362
382
|
* `hydrate` on the client.
|
|
363
383
|
*/
|
|
364
|
-
declare const ServerTag: <const Id extends string>(id: Id) => <Self, Shape>() => Context.
|
|
384
|
+
declare const ServerTag: <const Id extends string>(id: Id) => <Self, Shape>() => Context.ServiceClass<Self & ServerOnly, Id, Shape>;
|
|
365
385
|
/**
|
|
366
386
|
* Passes `R` through unchanged when it contains no {@link ServerOnly} dependency,
|
|
367
387
|
* or resolves to the {@link ServerOnlyLeak} compile-error sentinel when it does.
|
|
@@ -402,10 +422,10 @@ interface CustomElements {}
|
|
|
402
422
|
* - `el()` — no arguments; yields a `Node<never, never>`.
|
|
403
423
|
*/
|
|
404
424
|
interface ElementFn<Props> {
|
|
405
|
-
<P extends Props, C extends readonly Renderable[]>(props: P, children: C): Node<PropsE<P> | ChildrenE<C>, PropsR<P> | ChildrenR<C>>;
|
|
425
|
+
<P extends Props, const C extends readonly Renderable[]>(props: P, children: C): Node<PropsE<P> | ChildrenE<C>, PropsR<P> | ChildrenR<C>>;
|
|
406
426
|
<P extends Props>(props: P, child: string | number): Node<PropsE<P>, PropsR<P>>;
|
|
407
427
|
<P extends Props>(props: P): Node<PropsE<P>, PropsR<P>>;
|
|
408
|
-
<C extends readonly Renderable[]>(children: C): Node<ChildrenE<C>, ChildrenR<C>>;
|
|
428
|
+
<const C extends readonly Renderable[]>(children: C): Node<ChildrenE<C>, ChildrenR<C>>;
|
|
409
429
|
(child: string | number): Node<never, never>;
|
|
410
430
|
(): Node<never, never>;
|
|
411
431
|
}
|
|
@@ -423,7 +443,7 @@ type H = {
|
|
|
423
443
|
* h.fragment([h.span({}, "left"), h.span({}, "right")]);
|
|
424
444
|
* ```
|
|
425
445
|
*/
|
|
426
|
-
fragment<C extends readonly Renderable[]>(children: C): Node<ChildrenE<C>, ChildrenR<C>>;
|
|
446
|
+
fragment<const C extends readonly Renderable[]>(children: C): Node<ChildrenE<C>, ChildrenR<C>>;
|
|
427
447
|
} & { [K in keyof HTMLElements]: ElementFn<CombinatorialProps<HTMLElements[K] & DataAttributes>> } & { [K in keyof SVGElements]: ElementFn<CombinatorialProps<SVGElements[K] & DataAttributes>> } & { [K in keyof CustomElements]: ElementFn<CustomElements[K] & DataAttributes> };
|
|
428
448
|
/**
|
|
429
449
|
* Builds an `h` proxy backed by the given cache. Each tag access lazily creates
|
|
@@ -596,7 +616,7 @@ declare namespace Component {
|
|
|
596
616
|
* Tooltip({ label: "Help" }, (id) => [h.span({ id }, "?")]);
|
|
597
617
|
* ```
|
|
598
618
|
*/
|
|
599
|
-
function gen<Eff extends
|
|
619
|
+
function gen<Eff extends Effect.Effect<any, any, any>, BaseProps = Record<string, never>, C extends Children = readonly Renderable[]>(f: (props: BaseProps, children: C) => Generator<Eff, ElementDescriptor, never>): Component.Component<BaseProps, C, Eff extends Effect.Effect<any, infer E, any> ? E : never, Eff extends Effect.Effect<any, any, infer R> ? R : never>;
|
|
600
620
|
/**
|
|
601
621
|
* Defines a component whose body is a plain function returning any `Effect`
|
|
602
622
|
* (typically a {@link Node}). Use when the implementation is a one-liner or
|
|
@@ -627,4 +647,4 @@ declare namespace Component {
|
|
|
627
647
|
function make<Eff extends Effect.Effect<any, any, any>, BaseProps = Record<string, never>, C extends Children = readonly Renderable[]>(f: (props: BaseProps, children: C) => Eff): Component<BaseProps, C, Eff extends Effect.Effect<any, infer E, any> ? E : never, Eff extends Effect.Effect<any, any, infer R> ? R : never>;
|
|
628
648
|
}
|
|
629
649
|
//#endregion
|
|
630
|
-
export { type AppRpcClient, AppRpcClientTag, type AssertNoServerOnly, Boundary, CatchTagE, CatchTagsE, type ChildrenE, type ChildrenR, Component, type CustomElements, type ElementDescriptor, type ElementFn, FAILURE_BOUNDARY, FRAGMENT, LIST, List, NoPropValue, type Node, type PropsE, type PropsR, type Renderable, SERVER_BOUNDARY, SUSPENSE_BOUNDARY, type ServerOnly, type ServerOnlyLeak, ServerTag, Source, elementNode, getElementDescriptor, h, isStream, toStream };
|
|
650
|
+
export { type AppRpcClient, AppRpcClientTag, type AssertNoServerOnly, boundary_impl_d_exports as Boundary, type CatchTagE, type CatchTagsE, type ChildrenE, type ChildrenR, Component, type CustomElements, type ElementDescriptor, type ElementFn, FAILURE_BOUNDARY, FRAGMENT, LIST, List, NoPropValue, type Node, type PropsE, type PropsR, type Renderable, SERVER_BOUNDARY, SUSPENSE_BOUNDARY, type ServerOnly, type ServerOnlyLeak, ServerTag, Source, index_d_exports as Subscribable, elementNode, getElementDescriptor, h, isStream, toStream };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{Cause as t,Context as n,Data as r,Deferred as i,Effect as a,Filter as o,Option as s,Predicate as c,Result as l,Stream as u,SubscriptionRef as d,identity as f,pipe as p}from"effect";const m=Symbol.for(`@weftui/core/ElementDescriptor`);function h(e){let t=a.succeed(e);return Object.defineProperty(t,m,{value:e,enumerable:!1}),t}function g(e){return a.isEffect(e)&&m in e?e[m]:void 0}var _=e({FAILURE_BOUNDARY:()=>v,SERVER_BOUNDARY:()=>b,SUSPENSE_BOUNDARY:()=>y,catch:()=>S,catchCause:()=>C,catchFilter:()=>E,catchIf:()=>D,catchTag:()=>w,catchTags:()=>T,rpc:()=>k,suspend:()=>O});const v=Symbol.for(`weft/FAILURE_BOUNDARY`),y=Symbol.for(`weft/SUSPENSE_BOUNDARY`),b=Symbol.for(`weft/SERVER_BOUNDARY`);function x(e,t){return h({type:v,props:{match:e,children:t}})}function S(e,n){return x(n=>{let r=t.findErrorOption(n);return s.isSome(r)?e.fallback(r.value):null},n)}function C(e,t){return x(t=>e.fallback(t),t)}function w(e,n){return x(n=>{let r=t.findErrorOption(n);if(s.isNone(r))return null;let i=r.value;return i._tag===e.tag?e.fallback(i):null},n)}function T(e,n){return x(n=>{let r=t.findErrorOption(n);if(s.isNone(r))return null;let i=r.value,a=i._tag;if(a===void 0)return null;let o=e[a];return o?o(i):null},n)}function E(e,n,r){return x(r=>{let i=t.findErrorOption(r);if(s.isNone(i))return null;let a=e(i.value);return l.isSuccess(a)?n(a.success):null},r)}function D(e,n){return x(n=>{let r=t.findErrorOption(n);if(s.isNone(r))return null;let i=r.value;return e.predicate(i)?e.fallback(i):null},n)}function O(e,t){return h({type:y,props:{...e,children:t}})}function k(e,t,n,r){let i=e;return h({type:b,props:{tag:i._tag,payloadSchema:i.payloadSchema,successSchema:i.successSchema,errorSchema:i.errorSchema,payload:t,render:n,fallback:r?.fallback}})}var A=class extends n.Service()(`@weftui/core/AppRpcClient`){};const j=e=>()=>n.Service()(e);function M(e){return typeof e==`object`&&!!e&&u.TypeId in e}function N(e){return M(e)?e:a.isEffect(e)?u.fromEffect(e):u.make(e)}var P=e({TypeId:()=>F,changes:()=>R,get:()=>L,isSubscribable:()=>z,make:()=>I});const F=`~@weftui/core/Subscribable`,I=e=>({[F]:F,get:e.get,changes:e.changes}),L=e=>e.get,R=e=>e.changes,z=e=>c.hasProperty(e,F);var B=class extends r.TaggedError(`NoPropValue`){};let V;(function(e){function n(e,n){return z(e)?a.succeed(e):M(e)?a.gen(function*(){let r=yield*d.make(s.none()),c=yield*i.make(),l=yield*i.make(),m=p(u.runForEach(e,e=>p(d.set(r,s.some(e)),a.andThen(i.succeed(c,e)),a.asVoid)),a.ensuring(p(d.get(r),a.flatMap(e=>s.isNone(e)?a.asVoid(i.fail(c,new B({key:n}))):a.void))),a.onError(e=>t.hasInterruptsOnly(e)?a.void:a.asVoid(i.failCause(l,e))));yield*a.forkScoped(m);let h=p(d.get(r),a.flatMap(e=>s.isSome(e)?a.succeed(e.value):i.await(c))),g=p(d.changes(r),u.filterMap(o.fromPredicateOption(f)),u.interruptWhen(i.await(l)));return I({get:h,changes:g})}):a.isEffect(e)?a.gen(function*(){let t=yield*a.cached(e),n=u.fromEffect(t);return I({get:t,changes:n})}):a.succeed(I({get:a.succeed(e),changes:u.make(e)}))}e.toSubscribable=n})(V||={});const H=Symbol(`@weftui/core/fragment`);function U(e){return((t,n)=>{let r={},i;return Array.isArray(t)||typeof t==`string`||typeof t==`number`?i=t:t!==void 0&&(r=t,n!==void 0&&(i=n)),h({type:e,props:i===void 0?r:{...r,children:i}})})}function W(e=new Map){return new Proxy({fragment(e){return h({type:H,props:{children:e}})}},{get(t,n){return n in t?t[n]:e.get(n)??e.set(n,U(n)).get(n)}})}const G=W(new Map),K=Symbol(`@weftui/core/list`);let q;(function(e){function t(e,t){return h({type:K,props:{of:e.of,by:e.by,render:t}})}e.each=t})(q||={});let J;(function(e){function t(e){return(t,n=[])=>a.gen(function*(){return yield*e(t,n)})}e.gen=t;function n(e){return e}e.make=n})(J||={});export{A as AppRpcClientTag,_ as Boundary,J as Component,v as FAILURE_BOUNDARY,H as FRAGMENT,K as LIST,q as List,B as NoPropValue,b as SERVER_BOUNDARY,y as SUSPENSE_BOUNDARY,j as ServerTag,V as Source,P as Subscribable,h as elementNode,g as getElementDescriptor,G as h,M as isStream,N as toStream};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};export{t};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { C as StyleAttributeValue, S as HTMLAttributeSource, _ as HTMLFormMethod, a as SVGElements, b as HTMLReferrerPolicy, c as HTMLRole, d as EventHandlerFn, f as HTMLAutocapitalize, g as HTMLFormEncType, h as HTMLDir, i as SVGAttributes, l as DOMAttributes, m as HTMLCrossorigin, n as ElementType, o as HTMLAttributes, p as HTMLAutocomplete, r as Renderable, s as HTMLElements, t as ElementDescriptor, u as EventHandler, v as HTMLIframeSandbox, w as StyleProperties, x as AriaAttributes, y as HTMLLinkAs } from "../index-
|
|
1
|
+
import { C as StyleAttributeValue, S as HTMLAttributeSource, _ as HTMLFormMethod, a as SVGElements, b as HTMLReferrerPolicy, c as HTMLRole, d as EventHandlerFn, f as HTMLAutocapitalize, g as HTMLFormEncType, h as HTMLDir, i as SVGAttributes, l as DOMAttributes, m as HTMLCrossorigin, n as ElementType, o as HTMLAttributes, p as HTMLAutocomplete, r as Renderable, s as HTMLElements, t as ElementDescriptor, u as EventHandler, v as HTMLIframeSandbox, w as StyleProperties, x as AriaAttributes, y as HTMLLinkAs } from "../index-DMNuAQXj.js";
|
|
2
2
|
export { AriaAttributes, DOMAttributes, ElementDescriptor, ElementType, EventHandler, EventHandlerFn, HTMLAttributeSource, HTMLAttributes, HTMLAutocapitalize, HTMLAutocomplete, HTMLCrossorigin, HTMLDir, HTMLElements, HTMLFormEncType, HTMLFormMethod, HTMLIframeSandbox, HTMLLinkAs, HTMLReferrerPolicy, HTMLRole, Renderable, SVGAttributes, SVGElements, StyleAttributeValue, StyleProperties };
|