brumate 0.5.1 → 0.5.2
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/{client-BYHGusTe.js → client-De-7aGlO.js} +31 -7
- package/dist/client-De-7aGlO.js.map +1 -0
- package/dist/{defer-B63oF5Oa.js → defer-DlFYiAuK.js} +2 -2
- package/dist/{defer-B63oF5Oa.js.map → defer-DlFYiAuK.js.map} +1 -1
- package/dist/{devtools-D_SQpXTg.js → devtools-Di_dI9tS.js} +4 -4
- package/dist/{devtools-D_SQpXTg.js.map → devtools-Di_dI9tS.js.map} +1 -1
- package/dist/{devtools-panel-B9yokst5.js → devtools-panel-BvIKX1LY.js} +2 -2
- package/dist/{devtools-panel-B9yokst5.js.map → devtools-panel-BvIKX1LY.js.map} +1 -1
- package/dist/{loader-DKxhLjJw.js → loader-krRrJuIv.js} +2 -2
- package/dist/{loader-DKxhLjJw.js.map → loader-krRrJuIv.js.map} +1 -1
- package/dist/{rpc-CIVU4Ktx.js → rpc-BYYAj1vV.js} +2 -2
- package/dist/{rpc-CIVU4Ktx.js.map → rpc-BYYAj1vV.js.map} +1 -1
- package/dist/runtime/client.js +1 -1
- package/dist/runtime/devtools.js +1 -1
- package/dist/runtime/loader.js +2 -2
- package/dist/runtime/static-loader.js +1 -1
- package/dist/runtime/testing.js +1 -1
- package/dist/{static-loader-Bdet7g76.js → static-loader-DoHWsf9t.js} +2 -2
- package/dist/{static-loader-Bdet7g76.js.map → static-loader-DoHWsf9t.js.map} +1 -1
- package/package.json +1 -1
- package/dist/client-BYHGusTe.js.map +0 -1
|
@@ -286,14 +286,38 @@ function isTemplate(ref) {
|
|
|
286
286
|
* functions of other components wait for it, so the code that they call has loaded.
|
|
287
287
|
*/
|
|
288
288
|
const loadingCode = /* @__PURE__ */ new Set();
|
|
289
|
+
/** The same loads as `loadingCode`, by the ID of the component. */
|
|
290
|
+
const loadingComponents = /* @__PURE__ */ new Map();
|
|
289
291
|
/** The components whose code loads, or has loaded, with the page. */
|
|
290
292
|
const pageComponents = /* @__PURE__ */ new Set();
|
|
291
293
|
/** Loads the code of a component and all of its parts, as the page reads its scopes. */
|
|
292
294
|
function loadComponent(id) {
|
|
293
295
|
if (options === void 0 || pageComponents.has(id)) return;
|
|
294
296
|
pageComponents.add(id);
|
|
295
|
-
const code = loadModule(id).catch(() => {}).finally(() =>
|
|
297
|
+
const code = loadModule(id).catch(() => {}).finally(() => {
|
|
298
|
+
loadingCode.delete(code);
|
|
299
|
+
loadingComponents.delete(id);
|
|
300
|
+
});
|
|
296
301
|
loadingCode.add(code);
|
|
302
|
+
loadingComponents.set(id, code);
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* The code that still loads for the components at a scope and above it. An update of the scope
|
|
306
|
+
* renders the templates and calls the function props of those components, never the code of a
|
|
307
|
+
* component below it, so a layout that stays updates while the code of a new page loads.
|
|
308
|
+
*
|
|
309
|
+
* The walk is the one of contexts. Children that a component C inserted go to C through `t`,
|
|
310
|
+
* and C goes to the parent P that wrote the children through `o`, so the code of P, which
|
|
311
|
+
* the templates and function props of the children come from, is on the walk too.
|
|
312
|
+
*/
|
|
313
|
+
function codeAbove(scope) {
|
|
314
|
+
const waits = [];
|
|
315
|
+
if (loadingComponents.size === 0) return waits;
|
|
316
|
+
for (let current = scope; current; current = current.t ?? current.p ?? current.o) {
|
|
317
|
+
const code = current.m === void 0 ? void 0 : loadingComponents.get(current.m);
|
|
318
|
+
if (code) waits.push(code);
|
|
319
|
+
}
|
|
320
|
+
return waits;
|
|
297
321
|
}
|
|
298
322
|
/** Resolves when the code of the components on the page has loaded. */
|
|
299
323
|
function codeReady() {
|
|
@@ -1392,7 +1416,7 @@ function trigger(scope, slot) {
|
|
|
1392
1416
|
for (const check of waiters.keys()) check();
|
|
1393
1417
|
const id = findRoot(scope).m;
|
|
1394
1418
|
const children = childrenReady(scope);
|
|
1395
|
-
if (modules.has(id) &&
|
|
1419
|
+
if (modules.has(id) && codeAbove(scope).length === 0 && !children) {
|
|
1396
1420
|
pass(() => queueWrite(scope, slot));
|
|
1397
1421
|
return;
|
|
1398
1422
|
}
|
|
@@ -1409,8 +1433,8 @@ function trigger(scope, slot) {
|
|
|
1409
1433
|
const list = [[scope, slot]];
|
|
1410
1434
|
if (running > 0) waiting = list;
|
|
1411
1435
|
const loading = loadModule(id).then(async () => {
|
|
1412
|
-
const waits = [
|
|
1413
|
-
for (const [, , load] of list) waits.push(load);
|
|
1436
|
+
const waits = [children];
|
|
1437
|
+
for (const [target, , load] of list) waits.push(...codeAbove(target), load);
|
|
1414
1438
|
await Promise.allSettled(waits);
|
|
1415
1439
|
const before = origin;
|
|
1416
1440
|
const viaBefore = viaContext;
|
|
@@ -1966,12 +1990,12 @@ function action(name, id, method, result) {
|
|
|
1966
1990
|
* call loads, so the core holds only this.
|
|
1967
1991
|
*/
|
|
1968
1992
|
function submitAction(form, submitter) {
|
|
1969
|
-
import("./rpc-
|
|
1993
|
+
import("./rpc-BYYAj1vV.js").then((module) => module.sendAction(form, submitter));
|
|
1970
1994
|
}
|
|
1971
1995
|
/** Calls a server function. */
|
|
1972
1996
|
async function rpc(id, args) {
|
|
1973
1997
|
const signal = memoSignal();
|
|
1974
|
-
return track(import("./rpc-
|
|
1998
|
+
return track(import("./rpc-BYYAj1vV.js").then((module) => module.call(rpcPrefix, id, args, signal)));
|
|
1975
1999
|
}
|
|
1976
2000
|
/** A function prop rendered on the client calls the parent's exported handler. */
|
|
1977
2001
|
function handlerProp(value, ref, scope, bound = [], modifiers) {
|
|
@@ -4188,4 +4212,4 @@ function noop() {}
|
|
|
4188
4212
|
//#endregion
|
|
4189
4213
|
export { keep as $, getScope as $t, attr as A, updateRoute as At, componentNodes as B, resolve as Bt, fillSpread as C, submitAction as Ct, reveal as D, provideValue as Dt, loading as E, consumeContext as Et, text as F, effect as Ft, place as G, updated as Gt, dynamicNodes as H, timed as Ht, writeText as I, get as It, appendText as J, insert as Jt, setItem as K, fail as Kt, prop as L, isBound as Lt, content as M, binding as Mt, portalTo as N, bindings as Nt, started as O, setGlobal as Ot, restRef as P, cells as Pt, fillList as Q, descendants as Qt, spreadProps as R, memo as Rt, fillSettled as S, spread as St, keepValue as T, track as Tt, elementAt as U, unreadMemo as Ut, dynamic as V, set as Vt, foreignNodes as W, update as Wt, clone as X, afterInsert as Xt, branchNodes as Y, title as Yt, fillBranch as Z, createScope as Zt, retag as _, removeRoot as _t, deferInBrowser as a, nameComment as an, setAttr as at, countLoads as b, handlerProp as bt, toList as c, hooks as cn, setOn as ct, branch as d, skew as dn, dispose as dt, makeId as en, keepText as et, fill as f, forget as ft, reset as g, remount as gt, rekey as h, leaveRoutes as ht, addStyle as i, loadModule as in, putText as it, attrs as j, asyncMemo as jt, wait as k, updateContext as kt, windowList as l, rpcPrefix as ln, setSpread as lt, offscreen as m, leavePage as mt, addHead as n, setOwner as nn, markBlock as nt, setVar as o, DEVTOOLS as on, setAttrText as ot, held as p, init as pt, setSlots as q, children as qt, addPortal as r, sink as rn, nodes as rt, list as s, build as sn, setContent as st, loader as t, removeScope as tn, listNodes as tt, windowStart as u, scopes as un, template as ut, after as v, action as vt, fillValue as w, guess as wt, fillAttrs as x, rpc as xt, attempt as y, handle as yt, component as z, pending as zt };
|
|
4190
4214
|
|
|
4191
|
-
//# sourceMappingURL=client-
|
|
4215
|
+
//# sourceMappingURL=client-De-7aGlO.js.map
|