Skip to content

Commit

Permalink
chore: rename pending signal
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanPiercey committed Jan 25, 2025
1 parent 202a936 commit 81ece37
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 93 deletions.
32 changes: 16 additions & 16 deletions .sizes.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
{
"name": "*",
"total": {
"min": 17899,
"brotli": 6554
"min": 17895,
"brotli": 6539
}
},
{
Expand All @@ -18,12 +18,12 @@
"brotli": 144
},
"runtime": {
"min": 4038,
"brotli": 1744
"min": 4034,
"brotli": 1746
},
"total": {
"min": 4227,
"brotli": 1888
"min": 4223,
"brotli": 1890
}
},
{
Expand All @@ -33,12 +33,12 @@
"brotli": 100
},
"runtime": {
"min": 3506,
"brotli": 1584
"min": 3502,
"brotli": 1586
},
"total": {
"min": 3617,
"brotli": 1684
"min": 3613,
"brotli": 1686
}
},
{
Expand All @@ -48,12 +48,12 @@
"brotli": 541
},
"runtime": {
"min": 7706,
"brotli": 3173
"min": 7702,
"brotli": 3172
},
"total": {
"min": 8846,
"brotli": 3714
"min": 8842,
"brotli": 3713
}
},
{
Expand All @@ -63,11 +63,11 @@
"brotli": 478
},
"runtime": {
"min": 8682,
"min": 8678,
"brotli": 3538
},
"total": {
"min": 9630,
"min": 9626,
"brotli": 4016
}
}
Expand Down
84 changes: 42 additions & 42 deletions .sizes/dom.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// size: 17899 (min) 6554 (brotli)
// size: 17895 (min) 6539 (brotli)
var empty = [],
rest = Symbol();
function attrTag(attrs2) {
Expand Down Expand Up @@ -50,7 +50,7 @@ function triggerMacroTask() {
}
var pendingScopes = [];
function createScope($global) {
let scope = { h: 1, $global: $global };
let scope = { g: 1, $global: $global };
return pendingScopes.push(scope), scope;
}
var emptyScope = createScope({});
Expand All @@ -59,7 +59,7 @@ function getEmptyScope(marker) {
}
function destroyBranch(branch) {
if (((branch.y = 1), branch.m?.forEach(destroyBranch), branch.n))
for (let scope of branch.n) for (let id in scope.j) scope.j[id]?.abort();
for (let scope of branch.n) for (let id in scope.h) scope.h[id]?.abort();
}
function removeAndDestroyBranch(branch) {
destroyBranch(branch);
Expand Down Expand Up @@ -209,17 +209,17 @@ var registeredValues = {},
if ("*" === token) scope[data3] = visit.previousSibling;
else if ("$" === token) closestBranchMarkers.set(scopeId, visit);
else if ("[" === token)
this.g &&
(dataIndex && branchEnd(this.g, visit, visit),
this.o.push(this.g)),
(this.g = scopeId),
this.f &&
(dataIndex && branchEnd(this.f, visit, visit),
this.o.push(this.f)),
(this.f = scopeId),
(scope.a = visit);
else if ("]" === token) {
scope[data3] = visit;
let curParent = visit.parentNode,
startNode = branchEnd(this.g, visit, visit).a;
startNode = branchEnd(this.f, visit, visit).a;
curParent !== startNode.parentNode && curParent.prepend(startNode),
(this.g = this.o.pop());
(this.f = this.o.pop());
} else if ("|" === token) {
let next = data3.indexOf(" "),
curNode = (scope[~next ? data3.slice(0, next) : data3] = visit);
Expand Down Expand Up @@ -915,7 +915,7 @@ function createRendererWithOwner(template, rawWalks, setup, getArgs) {
id = {},
walks = rawWalks ? trimWalkString(rawWalks) : " ";
return (owner) => ({
k: id,
j: id,
F: template,
E: walks,
x: setup,
Expand Down Expand Up @@ -1229,7 +1229,7 @@ function byFirstArg(name) {
return name;
}
function isDifferentRenderer(a, b) {
return a !== b && (a?.k || 0) !== b?.k;
return a !== b && (a?.j || 0) !== b?.j;
}
var MARK = {},
CLEAN = {},
Expand Down Expand Up @@ -1320,7 +1320,7 @@ function loopClosure(ownerLoopNodeAccessor, fn, getIntersection) {
[];
if (loopScopes !== emptyMarkerArray)
for (let scope of loopScopes)
scope.h || queueSource(scope, signal, value2);
scope.g || queueSource(scope, signal, value2);
};
return (helperSignal._ = signal), helperSignal;
}
Expand All @@ -1336,8 +1336,8 @@ function conditionalClosure(
helperSignal = (scope, value2) => {
let conditionalScope = scope[scopeAccessor];
conditionalScope &&
!conditionalScope.h &&
scope[rendererAccessor]?.k === getRenderer().k &&
!conditionalScope.g &&
scope[rendererAccessor]?.j === getRenderer().j &&
queueSource(conditionalScope, signal, value2);
};
return (helperSignal._ = signal), helperSignal;
Expand All @@ -1355,7 +1355,7 @@ function dynamicClosure(
let subscribers = ownerScope[ownerSubscribersAccessor];
if (subscribers)
for (let subscriber of subscribers)
subscriber.h || queueSource(subscriber, _signal, value2);
subscriber.g || queueSource(subscriber, _signal, value2);
},
subscribe = (scope) => {
(getOwnerScope(scope)[ownerSubscribersAccessor] ||= new Set()).add(scope),
Expand Down Expand Up @@ -1405,7 +1405,7 @@ function effect(id, fn) {
}
);
}
var pendingSignal,
var pendingRender,
pendingEffects = [],
rendering = !1;
function queueSource(scope, signal, value2) {
Expand All @@ -1420,44 +1420,44 @@ function queueSource(scope, signal, value2) {
);
}
function queueRender(scope, signal, value2) {
let nextSignal = { f: scope, H: signal, I: value2, d: void 0 };
if (pendingSignal)
if (sortScopeByDOMPosition(pendingSignal.f, nextSignal.f) < 0)
(nextSignal.d = pendingSignal), (pendingSignal = nextSignal);
let nextRender = { k: scope, H: signal, I: value2, d: void 0 };
if (pendingRender)
if (comparePendingRenders(pendingRender, nextRender) < 0)
(nextRender.d = pendingRender), (pendingRender = nextRender);
else {
let currentSignal = pendingSignal;
let curRender = pendingRender;
for (
;
currentSignal.d &&
sortScopeByDOMPosition(currentSignal.d.f, nextSignal.f) >= 0;
curRender.d && comparePendingRenders(curRender.d, nextRender) >= 0;

)
currentSignal = currentSignal.d;
(nextSignal.d = currentSignal.d), (currentSignal.d = nextSignal);
curRender = curRender.d;
(nextRender.d = curRender.d), (curRender.d = nextRender);
}
else pendingSignal = nextSignal;
else pendingRender = nextRender;
}
function queueEffect(scope, fn) {
pendingEffects.push(scope, fn);
}
function run() {
let effects = pendingEffects;
try {
(rendering = !0), runSignals();
(rendering = !0), runRenders();
} finally {
(pendingSignal = void 0), (rendering = !1);
(pendingRender = void 0), (rendering = !1);
}
(pendingEffects = []), runEffects(effects);
}
function prepareEffects(fn) {
let prevSignals = pendingSignal,
let prevRender = pendingRender,
prevEffects = pendingEffects,
preparedEffects = (pendingEffects = []);
pendingRender = void 0;
try {
(rendering = !0), (pendingSignal = void 0), fn(), runSignals();
(rendering = !0), fn(), runRenders();
} finally {
(rendering = !1),
(pendingSignal = prevSignals),
(pendingRender = prevRender),
(pendingEffects = prevEffects);
}
return preparedEffects;
Expand All @@ -1468,18 +1468,18 @@ function runEffects(effects = pendingEffects) {
(0, effects[i + 1])(scope, scope);
}
}
function runSignals() {
for (; pendingSignal; )
pendingSignal.f.b?.y || pendingSignal.H(pendingSignal.f, pendingSignal.I),
(pendingSignal = pendingSignal.d);
function runRenders() {
for (; pendingRender; )
pendingRender.k.b?.y || pendingRender.H(pendingRender.k, pendingRender.I),
(pendingRender = pendingRender.d);
!(function () {
for (let scope of pendingScopes) scope.h = 0;
for (let scope of pendingScopes) scope.g = 0;
pendingScopes = [];
})();
}
function sortScopeByDOMPosition(a, b) {
let aStart = ownerStartNode(a),
bStart = ownerStartNode(b);
function comparePendingRenders(a, b) {
let aStart = ownerStartNode(a.k),
bStart = ownerStartNode(b.k);
return aStart === bStart
? 0
: aStart
Expand All @@ -1494,13 +1494,13 @@ function ownerStartNode(scope) {
return (scope.b || scope).a;
}
function resetAbortSignal(scope, id) {
let ctrl = scope.j?.[id];
ctrl && (queueEffect(ctrl, abort), (scope.j[id] = void 0));
let ctrl = scope.h?.[id];
ctrl && (queueEffect(ctrl, abort), (scope.h[id] = void 0));
}
function getAbortSignal(scope, id) {
return (
scope.b && (scope.b.n ||= new Set()).add(scope),
((scope.j ||= {})[id] ||= new AbortController()).signal
((scope.h ||= {})[id] ||= new AbortController()).signal
);
}
function abort(ctrl) {
Expand Down
2 changes: 1 addition & 1 deletion .sizes/name-cache.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"vars":{"props":{"$empty":"e","$rest":"t","$attrTag":"n","$attrTags":"r","$attrTagIterator":"i","$forIn":"l","$forOf":"o","$forTo":"f","$isScheduled":"u","$port2":"a","$flushAndWaitFrame":"c","$triggerMacroTask":"s","$createScope":"d","$emptyScope":"h","$getEmptyScope":"g","$destroyScope":"p","$_destroyScope":"v","$onDestroy":"b","$removeAndDestroyScope":"m","$insertBefore":"y","$registeredValues":"k","$Render":"w","$isResuming":"C","$register":"A","$registerBoundSignal":"S","$init":"N","$registerSubscriber":"x","$nodeRef":"$","$MARK":"M","$CLEAN":"E","$DIRTY":"I","$state":"T","$value":"_","$accessorId":"O","$intersection":"B","$defaultGetOwnerScope":"V","$closure":"j","$dynamicClosure":"R","$childClosures":"q","$dynamicSubscribers":"D","$setTagVar":"P","$tagVarSignal":"W","$setTagVarChange":"L","$tagVarSignalChange":"z","$renderBodyClosures":"F","$tagIdsByGlobal":"U","$nextTagId":"G","$inChild":"J","$intersections":"X","$effect":"Z","$pendingSignals":"H","$pendingEffects":"K","$rendering":"Q","$queueEffect":"Y","$run":"ee","$prepareEffects":"te","$runEffects":"ne","$runSignals":"re","$resetAbortSignal":"ie","$getAbortSignal":"le","$stringifyClassObject":"oe","$NON_DIMENSIONAL":"fe","$stringifyStyleObject":"ue","$toDelimitedString":"ae","$isEventHandler":"ce","$getEventHandlerName":"se","$normalizeDynamicRenderer":"de","$elementHandlersByEvent":"he","$defaultDelegator":"ge","$on":"pe","$createDelegator":"ve","$handleDelegated":"be","$stripSpacesAndPunctuation":"me","$controllable_input_checked":"ye","$controllable_input_checked_effect":"ke","$controllable_input_checkedValue":"we","$controllable_input_checkedValue_effect":"Ce","$controllable_input_value":"Ae","$controllable_input_value_effect":"Se","$controllable_select_value":"Ne","$controllable_select_value_effect":"xe","$setSelectOptions":"$e","$controllable_detailsOrDialog_open":"Me","$controllable_detailsOrDialog_open_effect":"Ee","$inputType":"Ie","$setValueAndUpdateSelection":"Te","$setCheckboxValue":"_e","$delegateFormControl":"Oe","$formChangeHandlers":"Be","$syncControllable":"Ve","$onFormChange":"je","$onFormReset":"Re","$hasValueChanged":"qe","$hasCheckboxChanged":"De","$hasSelectChanged":"Pe","$hasFormElementChanged":"We","$normalizeStrProp":"Le","$normalizeBoolProp":"ze","$toValueProp":"Fe","$fallback":"Ue","$parser":"Ge","$parseHTML":"Je","$attr":"Xe","$setAttribute":"Ze","$classAttr":"He","$styleAttr":"Ke","$data":"Qe","$attrs":"Ye","$hasAttrAlias":"et","$partialAttrs":"tt","$attrsInternal":"nt","$attrsEvents":"rt","$html":"it","$props":"lt","$normalizeAttrValue":"ot","$lifecycle":"ft","$walker":"ut","$trimWalkString":"at","$walk":"ct","$walkInternal":"st","$createScopeWithRenderer":"dt","$createScopeWithTagNameOrRenderer":"ht","$initRenderer":"gt","$dynamicTagAttrs":"pt","$createRendererWithOwner":"vt","$createRenderer":"bt","$_clone":"mt","$conditional":"yt","$inConditionalScope":"kt","$conditionalOnlyChild":"wt","$setConditionalRendererOnlyChild":"Ct","$emptyMarkerMap":"At","$emptyMarkerArray":"St","$emptyMap":"Nt","$emptyArray":"xt","$loopOf":"$t","$loopIn":"Mt","$loopTo":"Et","$loop":"It","$inLoopScope":"Tt","$bySecondArg":"_t","$byFirstArg":"Ot","$isDifferentRenderer":"Bt","$classIdToScope":"Vt","$compat":"jt","$noop":"Rt","$createTemplate":"qt","$mount":"Dt","$parseHTMLOrSingleNode":"Wt","$marker":"Ft","$_clickCount_effect":"Qt","$_clickCount":"Yt","$_setup_":"zt","$_expr_comment_comments_id$ifBody":"ss","$_id$ifBody":"as","$_comment_comments$ifBody":"ts","$_ifBody":"ns","$_expr_input_path_i$forBody":"os","$_if$forBody":"cs","$_open$forBody_effect":"is","$_open$forBody":"ms","$_id$forBody":"ls","$_i$forBody":"us","$_comment_comments$forBody":"es","$_comment_text$forBody":"ds","$_comment$forBody":"rs","$_params_2$forBody":"bs","$_input_path$forBody":"ps","$_for":"hs","$_input_path_":"vs","$_input_comments_":"fs","$_input_$1":"js","$_input_":"ks","$_params__":"Ss","$noop2":"Pt","$textContent":"Lt","$normalizeString":"Ut","$contentClosures":"Gt","$_expr_comment_comments_id$if_content":"Zs","$_id$if_content":"$s","$_comment_comments$if_content":"_s","$_if_content":"gs","$_expr_input_path_i$for_content":"ws","$_if$for_content":"xs","$_open$for_content_effect":"Bs","$_open$for_content":"Ds","$_id$for_content":"Es","$_i$for_content":"Hs","$_comment_comments$for_content":"Xs","$_comment_text$for_content":"qs","$_comment$for_content":"ys","$_params_2$for_content":"zs","$_input_path$for_content":"As","$pendingSignal":"Ht","$scopeIsConnected":"Jt","$sortScopeByDOMPosition":"Xt","$ownerStartNode":"Zt","$queueSource":"Kt","$pendingScopes":"en","$loopClosure":"tn","$conditionalClosure":"nn","$queueRender":"rn","$abort":"on","$destroyBranch":"ln","$removeAndDestroyBranch":"un","$createBranchScopeWithRenderer":"fn","$createBranchScopeWithTagNameOrRenderer":"an","$createBranch":"cn"}}}
{"vars":{"props":{"$empty":"e","$rest":"t","$attrTag":"n","$attrTags":"r","$attrTagIterator":"i","$forIn":"l","$forOf":"o","$forTo":"f","$isScheduled":"u","$port2":"a","$flushAndWaitFrame":"c","$triggerMacroTask":"s","$createScope":"d","$emptyScope":"h","$getEmptyScope":"g","$destroyScope":"p","$_destroyScope":"v","$onDestroy":"b","$removeAndDestroyScope":"m","$insertBefore":"y","$registeredValues":"k","$Render":"w","$isResuming":"C","$register":"A","$registerBoundSignal":"S","$init":"N","$registerSubscriber":"x","$nodeRef":"$","$MARK":"M","$CLEAN":"E","$DIRTY":"I","$state":"T","$value":"_","$accessorId":"O","$intersection":"B","$defaultGetOwnerScope":"V","$closure":"j","$dynamicClosure":"R","$childClosures":"q","$dynamicSubscribers":"D","$setTagVar":"P","$tagVarSignal":"W","$setTagVarChange":"L","$tagVarSignalChange":"z","$renderBodyClosures":"F","$tagIdsByGlobal":"U","$nextTagId":"G","$inChild":"J","$intersections":"X","$effect":"Z","$pendingSignals":"H","$pendingEffects":"K","$rendering":"Q","$queueEffect":"Y","$run":"ee","$prepareEffects":"te","$runEffects":"ne","$runSignals":"re","$resetAbortSignal":"ie","$getAbortSignal":"le","$stringifyClassObject":"oe","$NON_DIMENSIONAL":"fe","$stringifyStyleObject":"ue","$toDelimitedString":"ae","$isEventHandler":"ce","$getEventHandlerName":"se","$normalizeDynamicRenderer":"de","$elementHandlersByEvent":"he","$defaultDelegator":"ge","$on":"pe","$createDelegator":"ve","$handleDelegated":"be","$stripSpacesAndPunctuation":"me","$controllable_input_checked":"ye","$controllable_input_checked_effect":"ke","$controllable_input_checkedValue":"we","$controllable_input_checkedValue_effect":"Ce","$controllable_input_value":"Ae","$controllable_input_value_effect":"Se","$controllable_select_value":"Ne","$controllable_select_value_effect":"xe","$setSelectOptions":"$e","$controllable_detailsOrDialog_open":"Me","$controllable_detailsOrDialog_open_effect":"Ee","$inputType":"Ie","$setValueAndUpdateSelection":"Te","$setCheckboxValue":"_e","$delegateFormControl":"Oe","$formChangeHandlers":"Be","$syncControllable":"Ve","$onFormChange":"je","$onFormReset":"Re","$hasValueChanged":"qe","$hasCheckboxChanged":"De","$hasSelectChanged":"Pe","$hasFormElementChanged":"We","$normalizeStrProp":"Le","$normalizeBoolProp":"ze","$toValueProp":"Fe","$fallback":"Ue","$parser":"Ge","$parseHTML":"Je","$attr":"Xe","$setAttribute":"Ze","$classAttr":"He","$styleAttr":"Ke","$data":"Qe","$attrs":"Ye","$hasAttrAlias":"et","$partialAttrs":"tt","$attrsInternal":"nt","$attrsEvents":"rt","$html":"it","$props":"lt","$normalizeAttrValue":"ot","$lifecycle":"ft","$walker":"ut","$trimWalkString":"at","$walk":"ct","$walkInternal":"st","$createScopeWithRenderer":"dt","$createScopeWithTagNameOrRenderer":"ht","$initRenderer":"gt","$dynamicTagAttrs":"pt","$createRendererWithOwner":"vt","$createRenderer":"bt","$_clone":"mt","$conditional":"yt","$inConditionalScope":"kt","$conditionalOnlyChild":"wt","$setConditionalRendererOnlyChild":"Ct","$emptyMarkerMap":"At","$emptyMarkerArray":"St","$emptyMap":"Nt","$emptyArray":"xt","$loopOf":"$t","$loopIn":"Mt","$loopTo":"Et","$loop":"It","$inLoopScope":"Tt","$bySecondArg":"_t","$byFirstArg":"Ot","$isDifferentRenderer":"Bt","$classIdToScope":"Vt","$compat":"jt","$noop":"Rt","$createTemplate":"qt","$mount":"Dt","$parseHTMLOrSingleNode":"Wt","$marker":"Ft","$_clickCount_effect":"Qt","$_clickCount":"Yt","$_setup_":"zt","$_expr_comment_comments_id$ifBody":"ss","$_id$ifBody":"as","$_comment_comments$ifBody":"ts","$_ifBody":"ns","$_expr_input_path_i$forBody":"os","$_if$forBody":"cs","$_open$forBody_effect":"is","$_open$forBody":"ms","$_id$forBody":"ls","$_i$forBody":"us","$_comment_comments$forBody":"es","$_comment_text$forBody":"ds","$_comment$forBody":"rs","$_params_2$forBody":"bs","$_input_path$forBody":"ps","$_for":"hs","$_input_path_":"vs","$_input_comments_":"fs","$_input_$1":"js","$_input_":"ks","$_params__":"Ss","$noop2":"Pt","$textContent":"Lt","$normalizeString":"Ut","$contentClosures":"Gt","$_expr_comment_comments_id$if_content":"Zs","$_id$if_content":"$s","$_comment_comments$if_content":"_s","$_if_content":"gs","$_expr_input_path_i$for_content":"ws","$_if$for_content":"xs","$_open$for_content_effect":"Bs","$_open$for_content":"Ds","$_id$for_content":"Es","$_i$for_content":"Hs","$_comment_comments$for_content":"Xs","$_comment_text$for_content":"qs","$_comment$for_content":"ys","$_params_2$for_content":"zs","$_input_path$for_content":"As","$pendingSignal":"Ht","$scopeIsConnected":"Jt","$sortScopeByDOMPosition":"Xt","$ownerStartNode":"Zt","$queueSource":"Kt","$pendingScopes":"en","$loopClosure":"tn","$conditionalClosure":"nn","$queueRender":"rn","$abort":"on","$destroyBranch":"ln","$removeAndDestroyBranch":"un","$createBranchScopeWithRenderer":"fn","$createBranchScopeWithTagNameOrRenderer":"an","$createBranch":"cn","$pendingRender":"sn","$runRenders":"dn","$comparePendingRenders":"hn"}}}
Loading

0 comments on commit 81ece37

Please sign in to comment.