brumate 0.5.2 → 0.6.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/{boot-Difa0qdg.d.ts → boot-CMvhoWRu.d.ts} +2 -2
- package/dist/cli.js +2 -2
- package/dist/{client-DvsU9qxG.d.ts → client-C4kNKGwH.d.ts} +18 -5
- package/dist/{client-De-7aGlO.js → client-eVI8Wc95.js} +171 -29
- package/dist/client-eVI8Wc95.js.map +1 -0
- package/dist/{defer-DlFYiAuK.js → defer-pKO0S6UT.js} +2 -2
- package/dist/{defer-DlFYiAuK.js.map → defer-pKO0S6UT.js.map} +1 -1
- package/dist/{devtools-Di_dI9tS.js → devtools-DqqqdI4b.js} +4 -4
- package/dist/{devtools-Di_dI9tS.js.map → devtools-DqqqdI4b.js.map} +1 -1
- package/dist/{devtools-panel-BvIKX1LY.js → devtools-panel--GYjFZ35.js} +2 -2
- package/dist/{devtools-panel-BvIKX1LY.js.map → devtools-panel--GYjFZ35.js.map} +1 -1
- package/dist/{features-D5kLyihb.js → features-CbgII-o7.js} +4 -2
- package/dist/features-CbgII-o7.js.map +1 -0
- package/dist/{files-s4wmjcZV.js → files-CR-V05xd.js} +2 -2
- package/dist/{files-s4wmjcZV.js.map → files-CR-V05xd.js.map} +1 -1
- package/dist/index.d.ts +8 -4
- package/dist/index.js +2 -7
- package/dist/index.js.map +1 -1
- package/dist/{inspect-BLPt-dZZ.js → inspect-ddfGeww0.js} +236 -57
- package/dist/inspect-ddfGeww0.js.map +1 -0
- package/dist/{loader-krRrJuIv.js → loader-CQkAXO0g.js} +11 -3
- package/dist/loader-CQkAXO0g.js.map +1 -0
- package/dist/routes-D21FQyGF.js +51 -0
- package/dist/routes-D21FQyGF.js.map +1 -0
- package/dist/{rpc-BYYAj1vV.js → rpc-BgYnfg_a.js} +3 -3
- package/dist/{rpc-BYYAj1vV.js.map → rpc-BgYnfg_a.js.map} +1 -1
- package/dist/runtime/bundles.d.ts +1 -1
- package/dist/runtime/client.d.ts +2 -2
- package/dist/runtime/client.js +3 -3
- package/dist/runtime/devtools.d.ts +1 -1
- package/dist/runtime/devtools.js +1 -1
- package/dist/runtime/hot.d.ts +1 -1
- package/dist/runtime/loader.d.ts +2 -2
- package/dist/runtime/loader.js +2 -2
- package/dist/runtime/routes.js +1 -51
- package/dist/runtime/server.d.ts +2 -2
- package/dist/runtime/server.js +3 -3
- package/dist/runtime/signals.d.ts +2 -140
- package/dist/runtime/signals.js +4 -1
- package/dist/runtime/signals.js.map +1 -1
- package/dist/runtime/static-loader.d.ts +2 -2
- package/dist/runtime/static-loader.js +1 -1
- package/dist/runtime/testing.d.ts +24 -4
- package/dist/runtime/testing.js +66 -2
- package/dist/runtime/testing.js.map +1 -1
- package/dist/{produce-Cq6KKi7b.js → search-params-CM1RWR2P.js} +25 -3
- package/dist/search-params-CM1RWR2P.js.map +1 -0
- package/dist/{server-Doy5HR7r.js → server-BcT9icQ4.js} +107 -40
- package/dist/server-BcT9icQ4.js.map +1 -0
- package/dist/{server-CAwIqrXl.d.ts → server-dP_ucRiJ.d.ts} +42 -3
- package/dist/signals-BwD4u22K.d.ts +165 -0
- package/dist/{static-loader-9Nc1GvF0.d.ts → static-loader-CGthkX0s.d.ts} +2 -2
- package/dist/{static-loader-DoHWsf9t.js → static-loader-DCxASuzA.js} +3 -3
- package/dist/{static-loader-DoHWsf9t.js.map → static-loader-DCxASuzA.js.map} +1 -1
- package/dist/{stream-BdhzvPQO.js → stream-DRjx0keF.js} +2 -2
- package/dist/{stream-BdhzvPQO.js.map → stream-DRjx0keF.js.map} +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vite.js +17 -12
- package/dist/vite.js.map +1 -1
- package/elements.d.ts +231 -35
- package/package.json +6 -1
- package/skills/brumate/references/errors.md +32 -12
- package/skills/brumate/references/signals.md +27 -25
- package/skills/brumate/references/syntax.md +1 -1
- package/dist/client-De-7aGlO.js.map +0 -1
- package/dist/features-D5kLyihb.js.map +0 -1
- package/dist/inspect-BLPt-dZZ.js.map +0 -1
- package/dist/loader-krRrJuIv.js.map +0 -1
- package/dist/produce-Cq6KKi7b.js.map +0 -1
- package/dist/runtime/routes.js.map +0 -1
- package/dist/server-Doy5HR7r.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { t as Context$1 } from "./context-btHuB01Z.js";
|
|
2
2
|
import { a as PageState, c as ScopeId, i as PackedState, l as ScopeState, n as ElementReference, o as PropSink, p as Raw, t as Binding } from "./shared-CzbnWkVA.js";
|
|
3
|
+
import { k as SearchParamOptions } from "./signals-BwD4u22K.js";
|
|
3
4
|
import { t as StandardSchemaV1 } from "./standard-schema-BNY82yX3.js";
|
|
4
5
|
import { f as Intent, v as SubmissionResult } from "./forms-j1xPAR14.js";
|
|
5
6
|
//#region src/runtime/cookies.d.ts
|
|
@@ -108,6 +109,23 @@ interface RequestEventOptions {
|
|
|
108
109
|
address?: string;
|
|
109
110
|
/** True while the build prerenders the page. Rate limits do not count then. */
|
|
110
111
|
prerender?: boolean;
|
|
112
|
+
/** The `onError` of the app, which gets the errors of this request. */
|
|
113
|
+
onError?: ServerErrorHandler;
|
|
114
|
+
}
|
|
115
|
+
/** Where the server met an error: `'stream'` is a `#loading` body or a route after the response started. */
|
|
116
|
+
type ServerErrorKind = RequestKind | "stream";
|
|
117
|
+
/** What `onError` of `src/middleware.ts` knows about an error. */
|
|
118
|
+
interface ServerErrorInfo {
|
|
119
|
+
/** The request that met the error, when there is one. */
|
|
120
|
+
event: RequestEvent | undefined;
|
|
121
|
+
kind: ServerErrorKind;
|
|
122
|
+
}
|
|
123
|
+
/** The `onError` export of `src/middleware.ts`. */
|
|
124
|
+
type ServerErrorHandler = (error: unknown, info: ServerErrorInfo) => unknown;
|
|
125
|
+
/** The `onError` of a request, with the errors it got, so an error read in two places counts once. */
|
|
126
|
+
interface ErrorSink {
|
|
127
|
+
handler: ServerErrorHandler;
|
|
128
|
+
handled: WeakSet<object>;
|
|
111
129
|
}
|
|
112
130
|
/**
|
|
113
131
|
* A request that the server handles: a server function call, a form post,
|
|
@@ -177,6 +195,8 @@ declare class RequestEvent {
|
|
|
177
195
|
* `fetch(url, { signal })`, so work that nobody waits for stops.
|
|
178
196
|
*/
|
|
179
197
|
readonly signal: AbortSignal;
|
|
198
|
+
/** Where the errors of the request go, when the app has an `onError`. */
|
|
199
|
+
readonly errors: ErrorSink | undefined;
|
|
180
200
|
private readonly keepGoing?;
|
|
181
201
|
constructor(request: Request, options?: RequestEventOptions);
|
|
182
202
|
/** Aborts `signal`, such as when the response's reader went away. The server calls it. */
|
|
@@ -284,6 +304,12 @@ declare class Redirect extends Error {
|
|
|
284
304
|
declare function redirect(location: string, status?: number): never;
|
|
285
305
|
declare function isRedirect(error: unknown): error is Redirect;
|
|
286
306
|
//#endregion
|
|
307
|
+
//#region src/runtime/search-params.d.ts
|
|
308
|
+
/** `$searchParam` on the server: the parameter of the request's URL. */
|
|
309
|
+
declare function searchParam(context: {
|
|
310
|
+
consume<T>(context: Context$1<T>, scope: number): T;
|
|
311
|
+
}, name: string, options?: SearchParamOptions<unknown>): unknown;
|
|
312
|
+
//#endregion
|
|
287
313
|
//#region src/runtime/router.d.ts
|
|
288
314
|
/** Imports the module of a route file. */
|
|
289
315
|
type Loader = () => Promise<{
|
|
@@ -898,8 +924,14 @@ declare class Context {
|
|
|
898
924
|
params: Record<string, string>;
|
|
899
925
|
/** The request of the page, when it renders with one. */
|
|
900
926
|
event: RequestEvent | undefined;
|
|
927
|
+
/** The sink of the event, or of the `onError` option of a render without a request. */
|
|
928
|
+
errors: ErrorSink | undefined;
|
|
901
929
|
/** Results of server function calls in this render, so the same call runs once. */
|
|
902
930
|
readonly calls: Map<string, unknown>;
|
|
931
|
+
/** The event of the request, or undefined when the render has none. */
|
|
932
|
+
requestEvent(): RequestEvent | undefined;
|
|
933
|
+
/** Where the errors of the render go, when the app has an `onError`. */
|
|
934
|
+
errorSink(): ErrorSink | undefined;
|
|
903
935
|
/** The event of the page, for `getEvent()` in a component, which the compiler rewrites to this. */
|
|
904
936
|
getEvent(): RequestEvent;
|
|
905
937
|
/** Starts an entry of the trace of the request, in development. */
|
|
@@ -1307,6 +1339,8 @@ interface RenderResult {
|
|
|
1307
1339
|
defer?: "found" | "moved" | "missing";
|
|
1308
1340
|
}
|
|
1309
1341
|
interface RenderOptions {
|
|
1342
|
+
/** The `onError` of the app, which gets the errors of a render without a request event. */
|
|
1343
|
+
onError?: ServerErrorHandler;
|
|
1310
1344
|
/** The URL prefix of server function calls, for forms that post to one. Defaults to `/_brumate`. */
|
|
1311
1345
|
rpc?: string;
|
|
1312
1346
|
/** In development: the swaps of `#loading` bodies keep their fallbacks, for the devtools. */
|
|
@@ -1446,7 +1480,7 @@ declare function streamParts(parts: RenderResult, options?: DocumentOptions): Re
|
|
|
1446
1480
|
* logged, as for a server function that fails. The body renders with this value too, so the
|
|
1447
1481
|
* HTML cannot print what the state does not carry.
|
|
1448
1482
|
*/
|
|
1449
|
-
declare function caught(error: unknown, ctx: Context): unknown;
|
|
1483
|
+
declare function caught(error: unknown, ctx: Context, kind?: ServerErrorKind): unknown;
|
|
1450
1484
|
interface RequestOptions {
|
|
1451
1485
|
/**
|
|
1452
1486
|
* Other origins that may call server functions and post forms to them,
|
|
@@ -1460,6 +1494,11 @@ interface RequestOptions {
|
|
|
1460
1494
|
* The Vite plugin passes the default export of `src/middleware.ts`.
|
|
1461
1495
|
*/
|
|
1462
1496
|
middleware?: EntryMiddleware;
|
|
1497
|
+
/**
|
|
1498
|
+
* The `onError` export of `src/middleware.ts`, which gets each error of the server that is not
|
|
1499
|
+
* a `ServerError`, in place of `console.error`. The Vite plugin passes it.
|
|
1500
|
+
*/
|
|
1501
|
+
onError?: ServerErrorHandler;
|
|
1463
1502
|
/**
|
|
1464
1503
|
* The middleware of each `'use server'` file, by the ID of each of its
|
|
1465
1504
|
* functions. It runs before the function, after the middleware of the
|
|
@@ -1577,5 +1616,5 @@ declare function handleRoute(tree: RouteNode, request: Request, options?: RouteO
|
|
|
1577
1616
|
*/
|
|
1578
1617
|
declare function spread(attributes: Record<string, unknown>, on?: string[], names?: boolean): string | Promise<string>;
|
|
1579
1618
|
//#endregion
|
|
1580
|
-
export { idempotent as $,
|
|
1581
|
-
//# sourceMappingURL=server-
|
|
1619
|
+
export { idempotent as $, defineMiddleware as $t, handleRoute as A, safeParse as At, renderToStream as B, searchParam as Bt, attribute as C, parseSubmission as Ct, component as D, fieldErrors as Dt, children as E, ValidationIssue as Et, memo as F, MiddlewareLoader as Ft, start as G, RequestEvent as Gt, settled as H, Locals as Ht, packState as I, RouteMatch as It, streamParts as J, ServerError as Jt, stateScript as K, RequestEventOptions as Kt, read as L, RouteNode as Lt, insert as M, Handler as Mt, isCrossSite as N, Loader as Nt, dynamic as O, parse as Ot, lazy as P, Middleware as Pt, IdempotentOptions as Q, dedupe as Qt, ready as R, RouteView as Rt, actionResult as S, SuccessfulSubmission as St, caught as T, ValidationError as Tt, spacerTag as U, Redirect as Ut, setClientBundles as V, EntryMiddleware as Vt, spread as W, RequestCall as Wt, wait as X, ServerErrorInfo as Xt, streamState as Y, ServerErrorHandler as Yt, waitAll as Z, ServerErrorKind as Zt, ScopeEntry as _, FailedSubmission as _t, DocumentOptions as a, Session as an, setCacheStore as at, StreamOptions as b, Submission as bt, Mark as c, parseCookies as cn, RateLimitConfig as ct, PageCache as d, RateLimitOptions as dt, getEvent as en, CacheStore as et, RenderOptions as f, RateLimitStore as ft, RouteOptions as g, rateLimit as gt, RevealOrder as h, configureRateLimit as ht, DeferTarget as i, CookieOptions as in, revalidate as it, inlineBodies as j, EndpointLoader as jt, handleRequest as k, parseForm as kt, Memo as l, serializeCookie as ln, RateLimitError as lt, RequestOptions as m, clientAddress as mt, Component as n, redirect as nn, cached as nt, ItemSource as o, SessionOptions as on, storageStore as ot, RenderResult as p, Window as pt, stateValue as q, RequestKind as qt, Context as r, withEvent as rn, memoryStore as rt, Lazy as s, createSession as sn, RateLimit as st, ClientBundles as t, isRedirect as tn, CachedOptions as tt, NotReady as u, toNodeHeaders as un, RateLimitMiddleware as ut, StateAttributes as v, IntentSubmission as vt, binding as w, ParseResult as wt, action as x, SubmissionOptions as xt, StateMap as y, ReplyOptions as yt, render as z, matchRoute as zt };
|
|
1620
|
+
//# sourceMappingURL=server-dP_ucRiJ.d.ts.map
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { a as Route, r as NavigationState, t as Context } from "./context-btHuB01Z.js";
|
|
2
|
+
import { n as RouteParams, r as RoutePath } from "./routes-BZNt7DSZ.js";
|
|
3
|
+
//#region src/runtime/signals.d.ts
|
|
4
|
+
declare const BINDABLE: unique symbol;
|
|
5
|
+
declare const WRITES: unique symbol;
|
|
6
|
+
/** The mark of a prop that a parent can bind. It has no value at runtime. */
|
|
7
|
+
interface BindableMark<T> {
|
|
8
|
+
readonly [BINDABLE]: T;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* What a binding writes. A binding of a signal of `T` takes a prop that writes `W` when `W` is
|
|
12
|
+
* assignable to `T`, as a signal of `HTMLElement | undefined` takes the ref of a `div`.
|
|
13
|
+
*/
|
|
14
|
+
interface WritableMark<W> {
|
|
15
|
+
readonly [WRITES]: (value: W) => void;
|
|
16
|
+
}
|
|
17
|
+
/** What `$bind` returns: the mark of a prop, and the write side that checks the type of a ref. */
|
|
18
|
+
interface BoundSignal<T> extends BindableMark<T>, WritableMark<T> {}
|
|
19
|
+
/**
|
|
20
|
+
* Marks a prop that a parent can bind with `$bind`, such as
|
|
21
|
+
* `open?: Bindable<boolean>`. The parent passes `T` or `$bind(name)`.
|
|
22
|
+
* Inside the component, `$props<T>()` gives `T`.
|
|
23
|
+
*/
|
|
24
|
+
type Bindable<T> = T | BindableMark<T>;
|
|
25
|
+
/** The props as the component reads them, with `Bindable<T>` as `T`. */
|
|
26
|
+
type Unbound<T> = { [K in keyof T]: Exclude<T[K], BindableMark<unknown>>; };
|
|
27
|
+
/**
|
|
28
|
+
* Returns the props of the component. Destructure the call to keep each prop
|
|
29
|
+
* reactive. Destructure it with `let` to write props, such as
|
|
30
|
+
* `let { open = false } = $props()`.
|
|
31
|
+
*/
|
|
32
|
+
declare function $props<T = Record<string, any>>(): Unbound<T>;
|
|
33
|
+
/** Declares writable state. The variable reads and writes the signal. */
|
|
34
|
+
declare function $signal<T>(value: T): T;
|
|
35
|
+
declare function $signal<T>(): T | undefined;
|
|
36
|
+
/** The value of a memo: what a promise settles to, or the latest value of an async iterable. */
|
|
37
|
+
type MemoValue<T> = Awaited<T> extends AsyncIterable<infer U> ? U : Awaited<T>;
|
|
38
|
+
/**
|
|
39
|
+
* Declares a value computed from other values. A promise is awaited where it
|
|
40
|
+
* is read. An async iterable gives each of its values in turn.
|
|
41
|
+
*/
|
|
42
|
+
declare function $memo<T>(_value: T): MemoValue<T>;
|
|
43
|
+
/**
|
|
44
|
+
* Declares a memo that takes the value once it stops changing for `ms`
|
|
45
|
+
* milliseconds, such as a search query while the user types. On the server,
|
|
46
|
+
* and until the value first changes, it is the value.
|
|
47
|
+
*/
|
|
48
|
+
declare function $debounced<T>(_value: T, _ms: number): MemoValue<T>;
|
|
49
|
+
/**
|
|
50
|
+
* Declares a memo that takes the value at most once every `ms`
|
|
51
|
+
* milliseconds, and the last value after the wait, such as a position while
|
|
52
|
+
* the pointer moves. On the server, and until the value first changes, it is the value.
|
|
53
|
+
*/
|
|
54
|
+
declare function $throttled<T>(_value: T, _ms: number): MemoValue<T>;
|
|
55
|
+
/**
|
|
56
|
+
* Declares a value that follows a memo, and that handlers can write. A write
|
|
57
|
+
* shows a guess, such as a new item while the form that adds it posts. The
|
|
58
|
+
* value goes back to the memo when the memo changes, or when the server
|
|
59
|
+
* calls of the page finish, such as after a failed post.
|
|
60
|
+
*/
|
|
61
|
+
declare function $optimistic<T>(_source: T): T;
|
|
62
|
+
/** Runs a callback when the values it reads change, after the page resumes. Never on load. */
|
|
63
|
+
declare function $effect(_callback: () => void | (() => void)): void;
|
|
64
|
+
/** Runs a callback in the browser when a trigger fires. */
|
|
65
|
+
declare function $client(_callback: () => void | (() => void), _trigger?: "visible" | "idle" | "load"): void;
|
|
66
|
+
/** Reads a value without depending on it. */
|
|
67
|
+
declare function $untrack<T>(_value: T): T;
|
|
68
|
+
/** True while a new value of a memo, or of a memo it reads, loads on the client. Always false on the server. */
|
|
69
|
+
declare function $isPending(_memo: unknown): boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Waits for a memo to have its value, and gives it. It resolves at once when the memo is settled,
|
|
72
|
+
* and after the load when the memo loads its first value or loads again. When the inputs of the
|
|
73
|
+
* memo change while it waits, it waits for the load of the current inputs. It rejects with the
|
|
74
|
+
* error of the memo, when `timeout` milliseconds pass, or when `signal` aborts. Use it in a handler,
|
|
75
|
+
* an effect or a `$client` callback, never where a memo computes or markup renders.
|
|
76
|
+
*/
|
|
77
|
+
declare function $resolve<T>(_memo: T, _options?: {
|
|
78
|
+
timeout?: number;
|
|
79
|
+
signal?: AbortSignal;
|
|
80
|
+
}): Promise<Awaited<T>>;
|
|
81
|
+
/**
|
|
82
|
+
* True when the parent passed a prop with `$bind`, so a write of it reaches the parent. The prop is
|
|
83
|
+
* one that the component destructures with `let`. Always false on the server, where nothing writes.
|
|
84
|
+
*/
|
|
85
|
+
declare function $isBound(_prop: unknown): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* True when the caller passed the prop, even as `undefined`. A part uses it to tell a controlled
|
|
88
|
+
* value, such as `value=(null)`, from no value. Declare it with `const` in the component script.
|
|
89
|
+
*/
|
|
90
|
+
declare function $isPassed(_prop: unknown): boolean;
|
|
91
|
+
/** Returns an ID that is unique in the page and the same on the server and the client. */
|
|
92
|
+
declare function $id(): string;
|
|
93
|
+
/** Provides a value of a context to the components inside this one. */
|
|
94
|
+
declare function $setContext<T>(_context: Context<T>, _value: T): void;
|
|
95
|
+
/** Reads a context from the nearest component above that provides it, or its default value. */
|
|
96
|
+
declare function $getContext<T>(_context: Context<T>): T;
|
|
97
|
+
/**
|
|
98
|
+
* The route of the page: its URL, its query string and its params, typed
|
|
99
|
+
* from the route files as `href` is. The server reads the request, and the
|
|
100
|
+
* browser reads `location`. It changes when navigation changes the URL.
|
|
101
|
+
*/
|
|
102
|
+
declare function $route<P extends RoutePath = RoutePath>(_path?: P): Route<RouteParams<P>>;
|
|
103
|
+
/** The options of `$searchParam`. */
|
|
104
|
+
interface SearchParamOptions<T> {
|
|
105
|
+
/** The value while the parameter is not in the URL. A write of this value leaves the parameter out. */
|
|
106
|
+
default?: T;
|
|
107
|
+
/** Converts the text of the parameter to a value. Defaults to the text. */
|
|
108
|
+
parse?: (text: string) => T;
|
|
109
|
+
/** Converts a value to the text of the parameter. Defaults to `String`. */
|
|
110
|
+
serialize?: (value: T) => string;
|
|
111
|
+
/** `'push'` adds an entry to the history for each change, and `'replace'` (the default) changes the entry. */
|
|
112
|
+
history?: "push" | "replace";
|
|
113
|
+
/** True asks the server for the page again when the parameter changes, as a link to the new URL does. */
|
|
114
|
+
server?: boolean;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* A signal bound to one parameter of the query string. The server reads the URL of the request.
|
|
118
|
+
* A write in the browser changes the URL with `history.replaceState`, or `pushState` with
|
|
119
|
+
* `{ history: 'push' }`, and asks the server nothing. Back and forward write the signal.
|
|
120
|
+
*/
|
|
121
|
+
declare function $searchParam(name: string, options?: SearchParamOptions<string>): string | null;
|
|
122
|
+
declare function $searchParam<T>(name: string, options: SearchParamOptions<T> & {
|
|
123
|
+
default: T;
|
|
124
|
+
}): T;
|
|
125
|
+
declare function $searchParam<T>(name: string, options: SearchParamOptions<T> & {
|
|
126
|
+
parse: (text: string) => T;
|
|
127
|
+
}): T | null;
|
|
128
|
+
/** The navigation that loads, with `pending` false when none does. Always `{ pending: false }` on the server. */
|
|
129
|
+
declare function $navigation(): NavigationState;
|
|
130
|
+
/** Changes an object or an array in a signal through a draft, and writes the signal with the result. */
|
|
131
|
+
declare function $produce<T>(_signal: T, _recipe: (draft: T) => T | void): void;
|
|
132
|
+
/** Sets the title of the page. The last component that sets it wins. */
|
|
133
|
+
declare function $title(_value: unknown): void;
|
|
134
|
+
/**
|
|
135
|
+
* The latest result of a server function that a form of this component posts
|
|
136
|
+
* to, or undefined before the first post. Pending while the form sends.
|
|
137
|
+
*/
|
|
138
|
+
declare function $action<F extends (...args: never[]) => unknown>(_fn: F): Awaited<ReturnType<F>> | undefined;
|
|
139
|
+
/**
|
|
140
|
+
* Passes a child a signal, or a prop that the component writes, so a write
|
|
141
|
+
* of the prop in the child writes it. The child destructures the prop with
|
|
142
|
+
* `let`. Pass it as the value of a prop: `<Dialog open=$bind(open) />`.
|
|
143
|
+
*
|
|
144
|
+
* - Only a prop of type `Bindable<T>` takes it.
|
|
145
|
+
* - With `set`, a write calls `set(next)` in place of writing the signal.
|
|
146
|
+
*/
|
|
147
|
+
declare function $bind<T>(signal: T, set?: (next: T) => unknown): BoundSignal<T>;
|
|
148
|
+
/**
|
|
149
|
+
* Marks a function that a script makes as an event handler, so a spread can
|
|
150
|
+
* pass it on, as it passes on a handler that a caller writes in markup.
|
|
151
|
+
* `args` are JSON values that go with the handler, and it runs as
|
|
152
|
+
* `fn(...args, event)`.
|
|
153
|
+
*/
|
|
154
|
+
declare function $handler<A extends unknown[], E = Event>(fn: (...args: [...A, E]) => unknown, ...args: A): (event: E) => unknown;
|
|
155
|
+
/** A function that does not read the event. */
|
|
156
|
+
declare function $handler<A extends unknown[]>(fn: (...args: A) => unknown, ...args: A): (event: Event) => unknown;
|
|
157
|
+
/**
|
|
158
|
+
* Writes what the writes of the handler so far changed to the page, so the code after it can read
|
|
159
|
+
* the DOM, such as to focus or measure what a write rendered. A handler is one pass, and the page
|
|
160
|
+
* changes when it returns. Does nothing outside a handler, and on the server.
|
|
161
|
+
*/
|
|
162
|
+
declare function flush(): void;
|
|
163
|
+
//#endregion
|
|
164
|
+
export { Unbound as A, $title as C, BoundSignal as D, BindableMark as E, flush as M, MemoValue as O, $throttled as S, Bindable as T, $resolve as _, $effect as a, $setContext as b, $id as c, $isPending as d, $memo as f, $props as g, $produce as h, $debounced as i, WritableMark as j, SearchParamOptions as k, $isBound as l, $optimistic as m, $bind as n, $getContext as o, $navigation as p, $client as r, $handler as s, $action as t, $isPassed as u, $route as v, $untrack as w, $signal as x, $searchParam as y };
|
|
165
|
+
//# sourceMappingURL=signals-BwD4u22K.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as LoaderOptions } from "./boot-
|
|
1
|
+
import { t as LoaderOptions } from "./boot-CMvhoWRu.js";
|
|
2
2
|
//#region src/runtime/static-loader.d.ts
|
|
3
3
|
/**
|
|
4
4
|
* `start` for a site that loads every page with a full page load, as with
|
|
@@ -8,4 +8,4 @@ import { t as LoaderOptions } from "./boot-Difa0qdg.js";
|
|
|
8
8
|
declare function startWithoutNavigation(options: LoaderOptions): () => void;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { startWithoutNavigation as t };
|
|
11
|
-
//# sourceMappingURL=static-loader-
|
|
11
|
+
//# sourceMappingURL=static-loader-CGthkX0s.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as HAS_LATE_MARKUP, l as HAS_LISTENERS, r as HAS_BLOCKS, t as HAS_ACTIONS } from "./features-
|
|
1
|
+
import { c as HAS_LATE_MARKUP, l as HAS_LISTENERS, r as HAS_BLOCKS, t as HAS_ACTIONS } from "./features-CbgII-o7.js";
|
|
2
2
|
//#region src/runtime/boot.ts
|
|
3
3
|
/** True on the dev server. A Vite build replaces it with `false`, so the devtools calls go. */
|
|
4
4
|
const DEV = import.meta.env?.DEV;
|
|
@@ -201,7 +201,7 @@ function boot(options, navigate) {
|
|
|
201
201
|
run(template, ref);
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
|
-
const done = import("./defer-
|
|
204
|
+
const done = import("./defer-pKO0S6UT.js").then((module) => module.loadDeferred(template));
|
|
205
205
|
if (DEV) devtools()?.defer?.(template, done);
|
|
206
206
|
};
|
|
207
207
|
const near = template.getAttribute("b-near");
|
|
@@ -287,4 +287,4 @@ function startWithoutNavigation(options) {
|
|
|
287
287
|
//#endregion
|
|
288
288
|
export { boot as n, importCore as r, startWithoutNavigation as t };
|
|
289
289
|
|
|
290
|
-
//# sourceMappingURL=static-loader-
|
|
290
|
+
//# sourceMappingURL=static-loader-DCxASuzA.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-loader-DoHWsf9t.js","names":[],"sources":["../src/runtime/boot.ts","../src/runtime/static-loader.ts"],"sourcesContent":["// The loader's code that every page runs. `loader.ts` adds client navigation,\n// and `static-loader.ts` starts it without, so a site that turns navigation\n// off does not have its code, or the parts of the core that only it uses, in\n// its bundle.\n//\n// This file keeps its arrow functions and its Array methods, for size: the loader ships to every\n// page, and the function declarations and loops measured 20 to 50 bytes of gzip larger.\n\nimport { HAS_ACTIONS, HAS_BLOCKS, HAS_LATE_MARKUP, HAS_LISTENERS } from './features.ts';\nimport type * as Client from './client.ts';\nimport type { ClientModule, DevtoolsHooks } from './client.ts';\nimport type { SerialEntry } from './values.ts';\n\n/** True on the dev server. A Vite build replaces it with `false`, so the devtools calls go. */\nconst DEV = (import.meta as { env?: { DEV?: boolean } }).env?.DEV;\n\n/** The hooks of the devtools overlay, under the same key as the core's. */\nfunction devtools(): DevtoolsHooks | undefined {\n return (globalThis as Record<symbol, DevtoolsHooks | undefined>)[Symbol.for('brumate.devtools')];\n}\n\nexport interface LoaderOptions {\n /**\n * Imports the client module of a component, by component ID. Undefined for\n * a component that has no client code.\n */\n load: (id: string) => Promise<ClientModule> | undefined;\n /** The URL prefix of server function calls. */\n rpc?: string;\n /** Imports the serial entry, which the core takes before it reads the page state. */\n serial?: () => Promise<SerialEntry>;\n /**\n * Loads pages without a full page load: links to the same origin, the back\n * and forward buttons, forms that post to a server function, and redirects\n * from server functions to the same origin. Defaults to true.\n */\n navigate?: boolean | NavigateOptions;\n /**\n * The ID of the build of the page, for skew protection. The Vite plugin\n * sets it. Calls send it, and a page of another build, or a call that\n * answers 409 after a deploy, makes the next navigation a full page load.\n */\n build?: string;\n /**\n * Receives every error of client code first: of a handler, an effect, a\n * `$client` callback or a memo that loads, such as for a reporting\n * service. `scope` is the ID of the scope that the code belongs to. The\n * error then renders the `#catch` body of the nearest `#try`, or the page\n * gets a `brumate:error` event on `window` and the error is logged.\n */\n onError?: (error: unknown, info: { scope?: number | string }) => void;\n}\n\nexport interface NavigateOptions {\n /**\n * Swaps the page inside a view transition, where the browser has them.\n * CSS can tell links, the back and forward buttons and forms apart with\n * the types `push`, `traverse` and `form`. A redirect from a server\n * function has the type `form`.\n */\n transition?: boolean;\n /**\n * After a navigation, moves the focus to the first `<h1>` of the routes\n * that changed, or to `<main>`, as a full page load starts it at the top.\n * Defaults to true.\n */\n focus?: boolean;\n}\n\ninterface Entry {\n raw: string;\n type: string;\n modifiers: string[];\n ref: string;\n}\n\n// Parsed `b-on` values, so repeated events do not parse them again.\nconst parsed = new Map<string, Entry[]>();\n\nexport function entries(element: Element): Entry[] {\n const value = element.getAttribute('b-on') ?? '';\n return (parsed.get(value) ??\n parsed\n .set(\n value,\n value\n .split(' ')\n .filter(Boolean)\n .map((entry) => {\n const [name, ref] = entry.split('=') as [string, string];\n const [type, ...modifiers] = name.split(':') as [string, ...string[]];\n return { raw: entry, type, modifiers, ref };\n }),\n )\n .get(value))!;\n}\n\n/** The functions of the core that the loader calls. */\nexport type Core = (typeof Client)['loader'];\n\n/**\n * Imports the core. It reads one export by name, so a build keeps only it and\n * the helpers that compiled components call.\n */\nlet corePromise: Promise<Core> | undefined;\nexport const importCore = (): Promise<Core> =>\n (corePromise ??= import('./client.ts').then(\n (client) => client.loader,\n (error: unknown) => {\n // A load that fails can start again, such as after the network comes back.\n corePromise = undefined;\n throw error;\n },\n ));\n\n/** Runs a function when the browser is idle. */\nconst idle = (fn: () => void): unknown => (window.requestIdleCallback ?? setTimeout)(fn);\n\n/** What the loader gives the code that loads pages without a full page load. */\nexport interface Navigation {\n options: LoaderOptions;\n listen: (\n target: EventTarget,\n type: string,\n listener: (event: Event) => void,\n flags?: AddEventListenerOptions | boolean,\n ) => void;\n core: () => Promise<Core> | undefined;\n /** Starts the core, or returns the one that runs. */\n start: () => Promise<Core>;\n scan: (root: ParentNode) => void;\n}\n\n/**\n * Starts resuming the page. Listens to the events in `b-on` attributes\n * and loads `brumate/client` and the component's module on the first one.\n * `navigate` adds client navigation, and returns how to import the core.\n * Returns a function that removes the listeners and stops the core.\n */\nexport function boot(\n options: LoaderOptions,\n navigate?: (navigation: Navigation) => () => Promise<Core>,\n): () => void {\n let core: Promise<Core> | undefined;\n // Once stopped, the loader starts nothing, also from markup that the core inserts later with the\n // hooks that this loader gave it. A new loader can reuse the IDs of client scopes, so a stale\n // start would run in a scope of the new page.\n let stopped = false;\n /** The event types that the document listens to, and whether each listener is passive. */\n const types = new Map<string, boolean>();\n const removers: (() => void)[] = [];\n const listen = (\n target: EventTarget,\n type: string,\n listener: (event: Event) => void,\n flags?: AddEventListenerOptions | boolean,\n ): void => {\n target.addEventListener(type, listener, flags);\n removers.push(() => target.removeEventListener(type, listener, flags));\n };\n\n // Client navigation imports the core with the code that reads the pages it adds.\n let load = importCore;\n // The modules that the loader asked for, which the core takes, so a handler whose\n // code loaded runs without another `import()`. In Chrome, an `import()` of a module that is\n // loaded already still resolves in a task of its own, which can wait for the next frame.\n const modules = new Map<string, Promise<ClientModule> | undefined>();\n const loadModule = (id: string): Promise<ClientModule> | undefined => {\n if (modules.has(id)) {\n return modules.get(id);\n }\n const promise = options.load(id);\n modules.set(id, promise);\n // A load that fails can start again, such as after the network comes back.\n promise?.catch(() => modules.delete(id));\n return promise;\n };\n // The serial entry loads with the core, so the core can make the values of the app.\n let serialLoad: Promise<SerialEntry> | undefined;\n const loadSerial = (): Promise<SerialEntry> | undefined => {\n serialLoad ??= options.serial?.();\n serialLoad?.catch(() => (serialLoad = undefined));\n return serialLoad;\n };\n const loadCore = (): Promise<Core> =>\n (core ??= Promise.all([load(), loadSerial()]).then(([client, serial]) => {\n client.init({ ...options, load: loadModule, listen: scanInsert, inserted, serial });\n return client;\n }));\n\n // The devtools panel asks for the core when it opens, so it can show the page before any event.\n listen(document, 'brumate:core', () => void loadCore());\n\n const run = (element: Element, ref: string, event?: Event): void => {\n if (stopped) {\n return;\n }\n void loadCore().then((client) => client.handle(element, ref, event));\n };\n\n /**\n * A key of `prevent` matches its `event.key` while only the modifier that it names is held. A\n * key alone matches while Ctrl, Meta and Alt are up, so the shortcuts of the browser, such as\n * Cmd+Left or Alt+Left, keep their default. `Mod+` is Ctrl or Meta. Shift does not count.\n */\n const keyMatches = (key: string, event: KeyboardEvent): boolean => {\n const plus = key.indexOf('+', 1);\n const modifier = plus > 0 ? key.slice(0, plus) : '';\n if ((event.key === ' ' ? 'Space' : event.key) !== (plus > 0 ? key.slice(plus + 1) : key)) {\n return false;\n }\n switch (modifier) {\n case 'Mod':\n return (event.ctrlKey || event.metaKey) && !event.altKey;\n case 'Ctrl':\n return event.ctrlKey && !event.metaKey && !event.altKey;\n case 'Meta':\n return event.metaKey && !event.ctrlKey && !event.altKey;\n case 'Alt':\n return event.altKey && !event.ctrlKey && !event.metaKey;\n default:\n return !event.ctrlKey && !event.metaKey && !event.altKey;\n }\n };\n\n const apply = (event: Event, element: Element, entry: Entry): boolean => {\n for (const modifier of entry.modifiers) {\n // `prevent(ArrowDown,Enter)` prevents only these keys, by `event.key`. A key that commits\n // or moves within the text of an input method, such as Enter while it composes, is the\n // input method's, so it keeps its default.\n if (\n modifier === 'prevent' ||\n (modifier.startsWith('prevent(') &&\n !(event as KeyboardEvent).isComposing &&\n modifier\n .slice(8, -1)\n .split(',')\n .some((key) => keyMatches(key, event as KeyboardEvent)))\n ) {\n event.preventDefault();\n }\n }\n if (entry.modifiers.includes('once')) {\n element.setAttribute(\n 'b-on',\n entries(element)\n .map((item) => item.raw)\n .filter((raw) => raw !== entry.raw)\n .join(' '),\n );\n }\n run(element, entry.ref, event);\n return entry.modifiers.includes('stop');\n };\n\n /**\n * Handlers run as if each element had its own listener: those with\n * `capture` from the outside in, then the others from the target outwards.\n * An event that does not bubble, such as `focus`, reaches only the others\n * of its target. `stop` ends the event where it is.\n */\n const onEvent = (event: Event): void => {\n // The checks of `cancelWhen`, from the target up, run before any handler.\n for (let node = event.target as Node | null; node; node = node.parentNode) {\n for (const [type, check] of cancels.get(node as Element) ?? []) {\n if (type !== event.type) {\n continue;\n }\n let cancel = false;\n try {\n cancel = check(event);\n } catch (error) {\n // A check that throws cancels nothing, and the other checks and the handlers still run.\n console.error(error);\n }\n if (cancel) {\n event.preventDefault();\n return;\n }\n }\n }\n const path: Element[] = [];\n for (\n let node = event.target as Node | null;\n node && node !== document;\n node = node.parentNode\n ) {\n if (node.nodeType === 1 && (node as Element).hasAttribute('b-on')) {\n path.push(node as Element);\n }\n }\n const phase = (elements: Element[], capture: boolean): boolean => {\n for (const element of elements) {\n let stop = false;\n for (const entry of entries(element)) {\n if (\n entry.type === event.type &&\n entry.modifiers.includes('capture') === capture &&\n apply(event, element, entry)\n ) {\n stop = true;\n }\n }\n if (stop) {\n event.stopPropagation();\n return true;\n }\n }\n return false;\n };\n if (!phase([...path].reverse(), true)) {\n phase(event.bubbles ? path : path.filter((element) => element === event.target), false);\n }\n };\n\n // The checks of `cancelWhen`, by element. `events.ts` reaches them through a symbol of the registry.\n const cancels = new WeakMap<Node, Set<[string, (event: Event) => boolean]>>();\n (globalThis as { [key: symbol]: unknown })[Symbol.for('brumate.cancel')] = (\n element: Element,\n type: string,\n check: (event: Event) => boolean,\n ): (() => void) => {\n const entry: [string, typeof check] = [type, check];\n let set = cancels.get(element);\n if (!set) {\n cancels.set(element, (set = new Set()));\n }\n set.add(entry);\n delegate(type, false);\n return () => void set.delete(entry);\n };\n\n /** True for an entry that prevents the default action, which a passive listener cannot do. */\n const prevents = (entry: Entry): boolean =>\n entry.modifiers.some((modifier) => modifier.startsWith('prevent'));\n\n /**\n * Listens to an event type on the document. The listener is passive, so\n * scrolling does not wait for it, until an entry of the type prevents. `click` and `submit` never\n * scroll, so they are never passive: a `prevent` that is written after load cancels them.\n */\n const delegate = (type: string, cancel: boolean): void => {\n const prevent = cancel || type === 'click' || type === 'submit';\n const passive = types.get(type);\n if (passive === false || (passive === true && !prevent)) {\n return;\n }\n if (passive) {\n document.removeEventListener(type, onEvent, true);\n }\n types.set(type, !prevent);\n listen(document, type, onEvent, { capture: true, passive: !prevent });\n };\n\n // Templates are started once, even when markup is scanned again.\n const started = new WeakSet<Element>();\n const select = (root: ParentNode, selector: string): Element[] => {\n const found: Element[] = [];\n const add = (element: Element): void => {\n if (element.tagName === 'TEMPLATE') {\n if (started.has(element)) {\n return;\n }\n started.add(element);\n }\n found.push(element);\n };\n if ((root as Element).matches?.(selector)) {\n add(root as Element);\n }\n for (const element of root.querySelectorAll(selector)) {\n add(element);\n }\n return found;\n };\n\n // The values of `b-on` whose event types the document listens to already. The rows of a\n // list repeat the same few values.\n const delegated = new Set<string>();\n const onElement = (element: Element): void => {\n const value = element.getAttribute('b-on')!;\n if (!delegated.has(value)) {\n delegated.add(value);\n for (const entry of entries(element)) {\n delegate(entry.type, prevents(entry));\n }\n }\n };\n const onListener = (template: Element): void => {\n const target = template.getAttribute('b-listen') === 'window' ? window : document;\n for (const entry of entries(template)) {\n // Markup that is gone, such as a page that navigation replaced, no longer listens.\n listen(\n target,\n entry.type,\n (event) => {\n if (template.isConnected) {\n apply(event, template, entry);\n }\n },\n { capture: entry.modifiers.includes('capture'), passive: !prevents(entry) },\n );\n }\n };\n // A `#defer` block whose body the server sends in the same response, with `b-hole`, waits for it.\n const onBlock = (root: ParentNode, template: Element): void => {\n const client = template.getAttribute('b-client');\n const [trigger, ref] = (client ?? template.getAttribute('b-defer')!).split(\n client ? '=' : ':',\n ) as [string, string];\n // A `#defer` block asks the server for its body, with a module that only it needs.\n const go = (): void => {\n if (client) {\n run(template, ref);\n return;\n }\n const done = import('./defer.ts').then((module) => module.loadDeferred(template));\n if (DEV) {\n devtools()?.defer?.(template, done);\n }\n };\n // The element that a `$client` callback reads through `ref` (`b-b`), or that a component\n // forwards to its signal (`b-r`), or the one after the marker.\n // Other markers can follow it, and a template has no box, so it is never in view.\n const near = template.getAttribute('b-near');\n let after = template.nextElementSibling;\n while (after?.tagName === 'TEMPLATE') {\n after = after.nextElementSibling;\n }\n const selector = `[b-b=\"${near}\"],[b-r=\"${near}\"]`;\n const next =\n (near && (root.querySelector(selector) ?? document.querySelector(selector))) || after;\n if (trigger === 'idle') {\n idle(go);\n } else if (trigger === 'visible' && next && typeof IntersectionObserver !== 'undefined') {\n const observer = new IntersectionObserver((records) => {\n if (records.some((record) => record.isIntersecting)) {\n observer.disconnect();\n go();\n }\n });\n observer.observe(next);\n } else {\n go();\n }\n };\n const SCANNED = '[b-on],template[b-listen],template[b-client],template[b-defer]';\n // One query of the markup for everything that the loader starts. The blocks start after the\n // rest, as they did when each kind had its own query.\n const scan = (root: ParentNode): void => {\n if (stopped) {\n return;\n }\n const blocks: Element[] = [];\n for (const element of select(root, SCANNED)) {\n if (element.tagName === 'TEMPLATE') {\n if (HAS_LISTENERS && element.hasAttribute('b-listen')) {\n onListener(element);\n } else if (\n HAS_BLOCKS &&\n (element.hasAttribute('b-client') ||\n (element.hasAttribute('b-defer') && !element.hasAttribute('b-hole')))\n ) {\n blocks.push(element);\n }\n continue;\n }\n if (element.hasAttribute('b-on')) {\n onElement(element);\n }\n }\n for (const template of blocks) {\n onBlock(root, template);\n }\n };\n\n // A form of an `$action` sends its data with `fetch`, and the core writes the result into the page.\n listen(document, 'submit', (event) => {\n const form = event.target as HTMLFormElement;\n if (!HAS_ACTIONS || event.defaultPrevented || !form.hasAttribute?.('b-result')) {\n return;\n }\n event.preventDefault();\n const submitter = (event as SubmitEvent).submitter;\n void loadCore().then((client) => client.submitAction(form, submitter));\n });\n\n if (navigate) {\n load = navigate({ options, listen, core: () => core, start: loadCore, scan });\n } else {\n // A hot update whose markup changed loads the page again.\n listen(document, 'brumate:reload', () => location.reload());\n }\n\n scan(document);\n // Markup that streams in later, such as a `#loading` body, has handlers too.\n const scanAdded = (records: MutationRecord[]): void => {\n for (const record of records) {\n for (const node of record.addedNodes) {\n if (node.nodeType === 1) {\n scan(node as Element);\n }\n }\n }\n };\n // Without markup that others insert, the core scans all that comes into the page. The rest of\n // the page that the browser reads after an `async` script starts is scanned when it ends.\n const observer = HAS_LATE_MARKUP ? new MutationObserver(scanAdded) : undefined;\n observer?.observe(document, { childList: true, subtree: true });\n if (!HAS_LATE_MARKUP && document.readyState === 'loading') {\n listen(document, 'DOMContentLoaded', () => scan(document));\n }\n // The core scans the markup that it inserts before the insert, so the records of the insert\n // are dropped instead of scanned again. The markup that others inserted first is scanned\n // first.\n const scanInsert = (root: ParentNode): void => {\n if (observer) {\n scanAdded(observer.takeRecords());\n }\n scan(root);\n };\n const inserted = (): void => {\n observer?.takeRecords();\n };\n\n // The core starts at once and loads the code of the components on the page, so a call of a\n // function of another component, such as a function prop, runs at once and in order.\n void loadCore().catch(() => {});\n return () => {\n stopped = true;\n observer?.disconnect();\n for (const remove of removers.splice(0)) {\n remove();\n }\n void core?.then((client) => client.dispose());\n };\n}\n","// The loader without client navigation, for `navigate: false`. It is a module\n// of its own, so a bundle that starts it has no import of the navigation code,\n// and keeps none of the core's exports that only navigation reads.\n\nimport { boot } from './boot.ts';\nimport type { LoaderOptions } from './boot.ts';\n\nexport type { LoaderOptions } from './boot.ts';\n\n/**\n * `start` for a site that loads every page with a full page load, as with\n * `navigate: false`. A bundle that only calls it leaves out the code of\n * client navigation.\n */\nexport function startWithoutNavigation(options: LoaderOptions): () => void {\n return boot(options);\n}\n"],"mappings":";;;AAcA,MAAM,MAAO,YAA4C,KAAK;;AAG9D,SAAS,WAAsC;CAC7C,OAAQ,WAAyD,OAAO,IAAI,kBAAkB;AAChG;AA0DA,MAAM,yBAAS,IAAI,IAAqB;AAExC,SAAgB,QAAQ,SAA2B;CACjD,MAAM,QAAQ,QAAQ,aAAa,M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UAAU,SAAS,YAAY,CAAC;EAElC,KAAK,IAAI;CACX;CACA,MAAM,iBAAuB;EAC3B,UAAU,YAAY;CACxB;CAIA,SAAc,CAAC,CAAC,YAAY,CAAC,CAAC;CAC9B,aAAa;EACX,UAAU;EACV,UAAU,WAAW;EACrB,KAAK,MAAM,UAAU,SAAS,OAAO,CAAC,GACpC,OAAO;EAET,MAAW,MAAM,WAAW,OAAO,QAAQ,CAAC;CAC9C;AACF;;;;;;;;AC1gBA,SAAgB,uBAAuB,SAAoC;CACzE,OAAO,KAAK,OAAO;AACrB"}
|
|
1
|
+
{"version":3,"file":"static-loader-DCxASuzA.js","names":[],"sources":["../src/runtime/boot.ts","../src/runtime/static-loader.ts"],"sourcesContent":["// The loader's code that every page runs. `loader.ts` adds client navigation,\n// and `static-loader.ts` starts it without, so a site that turns navigation\n// off does not have its code, or the parts of the core that only it uses, in\n// its bundle.\n//\n// This file keeps its arrow functions and its Array methods, for size: the loader ships to every\n// page, and the function declarations and loops measured 20 to 50 bytes of gzip larger.\n\nimport { HAS_ACTIONS, HAS_BLOCKS, HAS_LATE_MARKUP, HAS_LISTENERS } from './features.ts';\nimport type * as Client from './client.ts';\nimport type { ClientModule, DevtoolsHooks } from './client.ts';\nimport type { SerialEntry } from './values.ts';\n\n/** True on the dev server. A Vite build replaces it with `false`, so the devtools calls go. */\nconst DEV = (import.meta as { env?: { DEV?: boolean } }).env?.DEV;\n\n/** The hooks of the devtools overlay, under the same key as the core's. */\nfunction devtools(): DevtoolsHooks | undefined {\n return (globalThis as Record<symbol, DevtoolsHooks | undefined>)[Symbol.for('brumate.devtools')];\n}\n\nexport interface LoaderOptions {\n /**\n * Imports the client module of a component, by component ID. Undefined for\n * a component that has no client code.\n */\n load: (id: string) => Promise<ClientModule> | undefined;\n /** The URL prefix of server function calls. */\n rpc?: string;\n /** Imports the serial entry, which the core takes before it reads the page state. */\n serial?: () => Promise<SerialEntry>;\n /**\n * Loads pages without a full page load: links to the same origin, the back\n * and forward buttons, forms that post to a server function, and redirects\n * from server functions to the same origin. Defaults to true.\n */\n navigate?: boolean | NavigateOptions;\n /**\n * The ID of the build of the page, for skew protection. The Vite plugin\n * sets it. Calls send it, and a page of another build, or a call that\n * answers 409 after a deploy, makes the next navigation a full page load.\n */\n build?: string;\n /**\n * Receives every error of client code first: of a handler, an effect, a\n * `$client` callback or a memo that loads, such as for a reporting\n * service. `scope` is the ID of the scope that the code belongs to. The\n * error then renders the `#catch` body of the nearest `#try`, or the page\n * gets a `brumate:error` event on `window` and the error is logged.\n */\n onError?: (error: unknown, info: { scope?: number | string }) => void;\n}\n\nexport interface NavigateOptions {\n /**\n * Swaps the page inside a view transition, where the browser has them.\n * CSS can tell links, the back and forward buttons and forms apart with\n * the types `push`, `traverse` and `form`. A redirect from a server\n * function has the type `form`.\n */\n transition?: boolean;\n /**\n * After a navigation, moves the focus to the first `<h1>` of the routes\n * that changed, or to `<main>`, as a full page load starts it at the top.\n * Defaults to true.\n */\n focus?: boolean;\n}\n\ninterface Entry {\n raw: string;\n type: string;\n modifiers: string[];\n ref: string;\n}\n\n// Parsed `b-on` values, so repeated events do not parse them again.\nconst parsed = new Map<string, Entry[]>();\n\nexport function entries(element: Element): Entry[] {\n const value = element.getAttribute('b-on') ?? '';\n return (parsed.get(value) ??\n parsed\n .set(\n value,\n value\n .split(' ')\n .filter(Boolean)\n .map((entry) => {\n const [name, ref] = entry.split('=') as [string, string];\n const [type, ...modifiers] = name.split(':') as [string, ...string[]];\n return { raw: entry, type, modifiers, ref };\n }),\n )\n .get(value))!;\n}\n\n/** The functions of the core that the loader calls. */\nexport type Core = (typeof Client)['loader'];\n\n/**\n * Imports the core. It reads one export by name, so a build keeps only it and\n * the helpers that compiled components call.\n */\nlet corePromise: Promise<Core> | undefined;\nexport const importCore = (): Promise<Core> =>\n (corePromise ??= import('./client.ts').then(\n (client) => client.loader,\n (error: unknown) => {\n // A load that fails can start again, such as after the network comes back.\n corePromise = undefined;\n throw error;\n },\n ));\n\n/** Runs a function when the browser is idle. */\nconst idle = (fn: () => void): unknown => (window.requestIdleCallback ?? setTimeout)(fn);\n\n/** What the loader gives the code that loads pages without a full page load. */\nexport interface Navigation {\n options: LoaderOptions;\n listen: (\n target: EventTarget,\n type: string,\n listener: (event: Event) => void,\n flags?: AddEventListenerOptions | boolean,\n ) => void;\n core: () => Promise<Core> | undefined;\n /** Starts the core, or returns the one that runs. */\n start: () => Promise<Core>;\n scan: (root: ParentNode) => void;\n}\n\n/**\n * Starts resuming the page. Listens to the events in `b-on` attributes\n * and loads `brumate/client` and the component's module on the first one.\n * `navigate` adds client navigation, and returns how to import the core.\n * Returns a function that removes the listeners and stops the core.\n */\nexport function boot(\n options: LoaderOptions,\n navigate?: (navigation: Navigation) => () => Promise<Core>,\n): () => void {\n let core: Promise<Core> | undefined;\n // Once stopped, the loader starts nothing, also from markup that the core inserts later with the\n // hooks that this loader gave it. A new loader can reuse the IDs of client scopes, so a stale\n // start would run in a scope of the new page.\n let stopped = false;\n /** The event types that the document listens to, and whether each listener is passive. */\n const types = new Map<string, boolean>();\n const removers: (() => void)[] = [];\n const listen = (\n target: EventTarget,\n type: string,\n listener: (event: Event) => void,\n flags?: AddEventListenerOptions | boolean,\n ): void => {\n target.addEventListener(type, listener, flags);\n removers.push(() => target.removeEventListener(type, listener, flags));\n };\n\n // Client navigation imports the core with the code that reads the pages it adds.\n let load = importCore;\n // The modules that the loader asked for, which the core takes, so a handler whose\n // code loaded runs without another `import()`. In Chrome, an `import()` of a module that is\n // loaded already still resolves in a task of its own, which can wait for the next frame.\n const modules = new Map<string, Promise<ClientModule> | undefined>();\n const loadModule = (id: string): Promise<ClientModule> | undefined => {\n if (modules.has(id)) {\n return modules.get(id);\n }\n const promise = options.load(id);\n modules.set(id, promise);\n // A load that fails can start again, such as after the network comes back.\n promise?.catch(() => modules.delete(id));\n return promise;\n };\n // The serial entry loads with the core, so the core can make the values of the app.\n let serialLoad: Promise<SerialEntry> | undefined;\n const loadSerial = (): Promise<SerialEntry> | undefined => {\n serialLoad ??= options.serial?.();\n serialLoad?.catch(() => (serialLoad = undefined));\n return serialLoad;\n };\n const loadCore = (): Promise<Core> =>\n (core ??= Promise.all([load(), loadSerial()]).then(([client, serial]) => {\n client.init({ ...options, load: loadModule, listen: scanInsert, inserted, serial });\n return client;\n }));\n\n // The devtools panel asks for the core when it opens, so it can show the page before any event.\n listen(document, 'brumate:core', () => void loadCore());\n\n const run = (element: Element, ref: string, event?: Event): void => {\n if (stopped) {\n return;\n }\n void loadCore().then((client) => client.handle(element, ref, event));\n };\n\n /**\n * A key of `prevent` matches its `event.key` while only the modifier that it names is held. A\n * key alone matches while Ctrl, Meta and Alt are up, so the shortcuts of the browser, such as\n * Cmd+Left or Alt+Left, keep their default. `Mod+` is Ctrl or Meta. Shift does not count.\n */\n const keyMatches = (key: string, event: KeyboardEvent): boolean => {\n const plus = key.indexOf('+', 1);\n const modifier = plus > 0 ? key.slice(0, plus) : '';\n if ((event.key === ' ' ? 'Space' : event.key) !== (plus > 0 ? key.slice(plus + 1) : key)) {\n return false;\n }\n switch (modifier) {\n case 'Mod':\n return (event.ctrlKey || event.metaKey) && !event.altKey;\n case 'Ctrl':\n return event.ctrlKey && !event.metaKey && !event.altKey;\n case 'Meta':\n return event.metaKey && !event.ctrlKey && !event.altKey;\n case 'Alt':\n return event.altKey && !event.ctrlKey && !event.metaKey;\n default:\n return !event.ctrlKey && !event.metaKey && !event.altKey;\n }\n };\n\n const apply = (event: Event, element: Element, entry: Entry): boolean => {\n for (const modifier of entry.modifiers) {\n // `prevent(ArrowDown,Enter)` prevents only these keys, by `event.key`. A key that commits\n // or moves within the text of an input method, such as Enter while it composes, is the\n // input method's, so it keeps its default.\n if (\n modifier === 'prevent' ||\n (modifier.startsWith('prevent(') &&\n !(event as KeyboardEvent).isComposing &&\n modifier\n .slice(8, -1)\n .split(',')\n .some((key) => keyMatches(key, event as KeyboardEvent)))\n ) {\n event.preventDefault();\n }\n }\n if (entry.modifiers.includes('once')) {\n element.setAttribute(\n 'b-on',\n entries(element)\n .map((item) => item.raw)\n .filter((raw) => raw !== entry.raw)\n .join(' '),\n );\n }\n run(element, entry.ref, event);\n return entry.modifiers.includes('stop');\n };\n\n /**\n * Handlers run as if each element had its own listener: those with\n * `capture` from the outside in, then the others from the target outwards.\n * An event that does not bubble, such as `focus`, reaches only the others\n * of its target. `stop` ends the event where it is.\n */\n const onEvent = (event: Event): void => {\n // The checks of `cancelWhen`, from the target up, run before any handler.\n for (let node = event.target as Node | null; node; node = node.parentNode) {\n for (const [type, check] of cancels.get(node as Element) ?? []) {\n if (type !== event.type) {\n continue;\n }\n let cancel = false;\n try {\n cancel = check(event);\n } catch (error) {\n // A check that throws cancels nothing, and the other checks and the handlers still run.\n console.error(error);\n }\n if (cancel) {\n event.preventDefault();\n return;\n }\n }\n }\n const path: Element[] = [];\n for (\n let node = event.target as Node | null;\n node && node !== document;\n node = node.parentNode\n ) {\n if (node.nodeType === 1 && (node as Element).hasAttribute('b-on')) {\n path.push(node as Element);\n }\n }\n const phase = (elements: Element[], capture: boolean): boolean => {\n for (const element of elements) {\n let stop = false;\n for (const entry of entries(element)) {\n if (\n entry.type === event.type &&\n entry.modifiers.includes('capture') === capture &&\n apply(event, element, entry)\n ) {\n stop = true;\n }\n }\n if (stop) {\n event.stopPropagation();\n return true;\n }\n }\n return false;\n };\n if (!phase([...path].reverse(), true)) {\n phase(event.bubbles ? path : path.filter((element) => element === event.target), false);\n }\n };\n\n // The checks of `cancelWhen`, by element. `events.ts` reaches them through a symbol of the registry.\n const cancels = new WeakMap<Node, Set<[string, (event: Event) => boolean]>>();\n (globalThis as { [key: symbol]: unknown })[Symbol.for('brumate.cancel')] = (\n element: Element,\n type: string,\n check: (event: Event) => boolean,\n ): (() => void) => {\n const entry: [string, typeof check] = [type, check];\n let set = cancels.get(element);\n if (!set) {\n cancels.set(element, (set = new Set()));\n }\n set.add(entry);\n delegate(type, false);\n return () => void set.delete(entry);\n };\n\n /** True for an entry that prevents the default action, which a passive listener cannot do. */\n const prevents = (entry: Entry): boolean =>\n entry.modifiers.some((modifier) => modifier.startsWith('prevent'));\n\n /**\n * Listens to an event type on the document. The listener is passive, so\n * scrolling does not wait for it, until an entry of the type prevents. `click` and `submit` never\n * scroll, so they are never passive: a `prevent` that is written after load cancels them.\n */\n const delegate = (type: string, cancel: boolean): void => {\n const prevent = cancel || type === 'click' || type === 'submit';\n const passive = types.get(type);\n if (passive === false || (passive === true && !prevent)) {\n return;\n }\n if (passive) {\n document.removeEventListener(type, onEvent, true);\n }\n types.set(type, !prevent);\n listen(document, type, onEvent, { capture: true, passive: !prevent });\n };\n\n // Templates are started once, even when markup is scanned again.\n const started = new WeakSet<Element>();\n const select = (root: ParentNode, selector: string): Element[] => {\n const found: Element[] = [];\n const add = (element: Element): void => {\n if (element.tagName === 'TEMPLATE') {\n if (started.has(element)) {\n return;\n }\n started.add(element);\n }\n found.push(element);\n };\n if ((root as Element).matches?.(selector)) {\n add(root as Element);\n }\n for (const element of root.querySelectorAll(selector)) {\n add(element);\n }\n return found;\n };\n\n // The values of `b-on` whose event types the document listens to already. The rows of a\n // list repeat the same few values.\n const delegated = new Set<string>();\n const onElement = (element: Element): void => {\n const value = element.getAttribute('b-on')!;\n if (!delegated.has(value)) {\n delegated.add(value);\n for (const entry of entries(element)) {\n delegate(entry.type, prevents(entry));\n }\n }\n };\n const onListener = (template: Element): void => {\n const target = template.getAttribute('b-listen') === 'window' ? window : document;\n for (const entry of entries(template)) {\n // Markup that is gone, such as a page that navigation replaced, no longer listens.\n listen(\n target,\n entry.type,\n (event) => {\n if (template.isConnected) {\n apply(event, template, entry);\n }\n },\n { capture: entry.modifiers.includes('capture'), passive: !prevents(entry) },\n );\n }\n };\n // A `#defer` block whose body the server sends in the same response, with `b-hole`, waits for it.\n const onBlock = (root: ParentNode, template: Element): void => {\n const client = template.getAttribute('b-client');\n const [trigger, ref] = (client ?? template.getAttribute('b-defer')!).split(\n client ? '=' : ':',\n ) as [string, string];\n // A `#defer` block asks the server for its body, with a module that only it needs.\n const go = (): void => {\n if (client) {\n run(template, ref);\n return;\n }\n const done = import('./defer.ts').then((module) => module.loadDeferred(template));\n if (DEV) {\n devtools()?.defer?.(template, done);\n }\n };\n // The element that a `$client` callback reads through `ref` (`b-b`), or that a component\n // forwards to its signal (`b-r`), or the one after the marker.\n // Other markers can follow it, and a template has no box, so it is never in view.\n const near = template.getAttribute('b-near');\n let after = template.nextElementSibling;\n while (after?.tagName === 'TEMPLATE') {\n after = after.nextElementSibling;\n }\n const selector = `[b-b=\"${near}\"],[b-r=\"${near}\"]`;\n const next =\n (near && (root.querySelector(selector) ?? document.querySelector(selector))) || after;\n if (trigger === 'idle') {\n idle(go);\n } else if (trigger === 'visible' && next && typeof IntersectionObserver !== 'undefined') {\n const observer = new IntersectionObserver((records) => {\n if (records.some((record) => record.isIntersecting)) {\n observer.disconnect();\n go();\n }\n });\n observer.observe(next);\n } else {\n go();\n }\n };\n const SCANNED = '[b-on],template[b-listen],template[b-client],template[b-defer]';\n // One query of the markup for everything that the loader starts. The blocks start after the\n // rest, as they did when each kind had its own query.\n const scan = (root: ParentNode): void => {\n if (stopped) {\n return;\n }\n const blocks: Element[] = [];\n for (const element of select(root, SCANNED)) {\n if (element.tagName === 'TEMPLATE') {\n if (HAS_LISTENERS && element.hasAttribute('b-listen')) {\n onListener(element);\n } else if (\n HAS_BLOCKS &&\n (element.hasAttribute('b-client') ||\n (element.hasAttribute('b-defer') && !element.hasAttribute('b-hole')))\n ) {\n blocks.push(element);\n }\n continue;\n }\n if (element.hasAttribute('b-on')) {\n onElement(element);\n }\n }\n for (const template of blocks) {\n onBlock(root, template);\n }\n };\n\n // A form of an `$action` sends its data with `fetch`, and the core writes the result into the page.\n listen(document, 'submit', (event) => {\n const form = event.target as HTMLFormElement;\n if (!HAS_ACTIONS || event.defaultPrevented || !form.hasAttribute?.('b-result')) {\n return;\n }\n event.preventDefault();\n const submitter = (event as SubmitEvent).submitter;\n void loadCore().then((client) => client.submitAction(form, submitter));\n });\n\n if (navigate) {\n load = navigate({ options, listen, core: () => core, start: loadCore, scan });\n } else {\n // A hot update whose markup changed loads the page again.\n listen(document, 'brumate:reload', () => location.reload());\n }\n\n scan(document);\n // Markup that streams in later, such as a `#loading` body, has handlers too.\n const scanAdded = (records: MutationRecord[]): void => {\n for (const record of records) {\n for (const node of record.addedNodes) {\n if (node.nodeType === 1) {\n scan(node as Element);\n }\n }\n }\n };\n // Without markup that others insert, the core scans all that comes into the page. The rest of\n // the page that the browser reads after an `async` script starts is scanned when it ends.\n const observer = HAS_LATE_MARKUP ? new MutationObserver(scanAdded) : undefined;\n observer?.observe(document, { childList: true, subtree: true });\n if (!HAS_LATE_MARKUP && document.readyState === 'loading') {\n listen(document, 'DOMContentLoaded', () => scan(document));\n }\n // The core scans the markup that it inserts before the insert, so the records of the insert\n // are dropped instead of scanned again. The markup that others inserted first is scanned\n // first.\n const scanInsert = (root: ParentNode): void => {\n if (observer) {\n scanAdded(observer.takeRecords());\n }\n scan(root);\n };\n const inserted = (): void => {\n observer?.takeRecords();\n };\n\n // The core starts at once and loads the code of the components on the page, so a call of a\n // function of another component, such as a function prop, runs at once and in order.\n void loadCore().catch(() => {});\n return () => {\n stopped = true;\n observer?.disconnect();\n for (const remove of removers.splice(0)) {\n remove();\n }\n void core?.then((client) => client.dispose());\n };\n}\n","// The loader without client navigation, for `navigate: false`. It is a module\n// of its own, so a bundle that starts it has no import of the navigation code,\n// and keeps none of the core's exports that only navigation reads.\n\nimport { boot } from './boot.ts';\nimport type { LoaderOptions } from './boot.ts';\n\nexport type { LoaderOptions } from './boot.ts';\n\n/**\n * `start` for a site that loads every page with a full page load, as with\n * `navigate: false`. A bundle that only calls it leaves out the code of\n * client navigation.\n */\nexport function startWithoutNavigation(options: LoaderOptions): () => void {\n return boot(options);\n}\n"],"mappings":";;;AAcA,MAAM,MAAO,YAA4C,KAAK;;AAG9D,SAAS,WAAsC;CAC7C,OAAQ,WAAyD,OAAO,IAAI,kBAA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,SAAS,eAAe,WAC9C,OAAO,UAAU,0BAA0B,KAAK,QAAQ,CAAC;CAK3D,MAAM,cAAc,SAA2B;EAC7C,IAAI,UACF,UAAU,SAAS,YAAY,CAAC;EAElC,KAAK,IAAI;CACX;CACA,MAAM,iBAAuB;EAC3B,UAAU,YAAY;CACxB;CAIA,SAAc,CAAC,CAAC,YAAY,CAAC,CAAC;CAC9B,aAAa;EACX,UAAU;EACV,UAAU,WAAW;EACrB,KAAK,MAAM,UAAU,SAAS,OAAO,CAAC,GACpC,OAAO;EAET,MAAW,MAAM,WAAW,OAAO,QAAQ,CAAC;CAC9C;AACF;;;;;;;;AC1gBA,SAAgB,uBAAuB,SAAoC;CACzE,OAAO,KAAK,OAAO;AACrB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { n as MODIFIERS } from "./events-LgLdp1R7.js";
|
|
2
2
|
import { S as rawHTML, g as isRaw, h as isInternal } from "./html-t1JpkODI.js";
|
|
3
|
-
import {
|
|
3
|
+
import { S as onValuePlugin, _ as isBinding, c as ElementReference, d as PARTS, o as CHILDREN_REF, v as isPropWrapper, w as stateValues, x as onSerialOptions, y as isSlotReference } from "./search-params-CM1RWR2P.js";
|
|
4
4
|
import { Feature, Stream, createPlugin, fromCrossJSON, toCrossJSONStream } from "seroval";
|
|
5
5
|
import { AbortSignalPlugin, CustomEventPlugin, DOMExceptionPlugin, EventPlugin, FormDataPlugin, HeadersPlugin, ImageDataPlugin, ReadableStreamPlugin, RequestPlugin, ResponsePlugin, URLPlugin, URLSearchParamsPlugin } from "seroval-plugins/web";
|
|
6
6
|
//#region src/runtime/calls.ts
|
|
@@ -531,4 +531,4 @@ async function fromChunkStream(stream) {
|
|
|
531
531
|
//#endregion
|
|
532
532
|
export { plugins as a, functionReferences as c, callPlugins as i, fromChunkStream as n, serialOptions as o, toChunkStream as r, syncPlugins as s, STREAM_TYPE as t };
|
|
533
533
|
|
|
534
|
-
//# sourceMappingURL=stream-
|
|
534
|
+
//# sourceMappingURL=stream-DRjx0keF.js.map
|