@askrjs/askr 0.0.24 → 0.0.25

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.
@@ -1 +1 @@
1
- {"version":3,"file":"for.d.ts","sourceRoot":"","sources":["../../src/runtime/for.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EACL,KAAK,iBAAiB,EAOvB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAc,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAazD,UAAU,YAAY;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAmHD,iBAAS,eAAe,IAAI,YAAY,CAEvC;AAED,OAAO,EAAE,eAAe,EAAE,CAAC;AAE3B,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC;IACR,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC3B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,KAAK,EAAE,KAAK,GAAG,SAAS,CAAC;IAC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EACb,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GACpB,eAAe,CAAC,CAAC,CAAC,CAkJpB;AAED,wBAAgB,iBAAiB,CAAC,CAAC,EACjC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EACrB,QAAQ,EAAE,CAAC,EAAE,GACZ,KAAK,EAAE,CAoVT;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAChC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EACrB,MAAM,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,GAC/B,KAAK,EAAE,CAST"}
@@ -1 +1 @@
1
- import{getCurrentInstance as R,createComponentInstance as B,setCurrentComponentInstance as y,getCurrentStateIndex as K,finalizeReadSubscriptions as E,setStateIndex as H}from"./component.js";import{ELEMENT_TYPE as L}from"../common/jsx.js";const k=globalThis,s={itemsCreated:0,itemsReused:0,itemsRemoved:0,itemsMoved:0,rowFactoryInvocations:0,keyLookups:0,keyHits:0,keyMisses:0,domInserts:0,domRemoves:0,domMoves:0,domAttrSets:0,domTextSets:0,reconcilePhaseMs:0,domCommitPhaseMs:0,fastLaneName:null};function T(){k.__ASKR_BENCH__&&(s.itemsCreated=0,s.itemsReused=0,s.itemsRemoved=0,s.itemsMoved=0,s.rowFactoryInvocations=0,s.keyLookups=0,s.keyHits=0,s.keyMisses=0,s.domInserts=0,s.domRemoves=0,s.domMoves=0,s.domAttrSets=0,s.domTextSets=0,s.reconcilePhaseMs=0,s.domCommitPhaseMs=0,s.fastLaneName=null)}function l(r){if(k.__ASKR_BENCH__)switch(r){case"itemCreated":s.itemsCreated++;break;case"itemReused":s.itemsReused++;break;case"itemRemoved":s.itemsRemoved++;break;case"itemMoved":s.itemsMoved++;break;case"rowFactory":s.rowFactoryInvocations++;break;case"keyLookup":s.keyLookups++;break;case"keyHit":s.keyHits++;break;case"keyMiss":s.keyMisses++;break;case"domInsert":s.domInserts++;break;case"domRemove":s.domRemoves++;break;case"domMove":s.domMoves++;break;case"domAttrSet":s.domAttrSets++;break;case"domTextSet":s.domTextSets++;break}}function F(r){k.__ASKR_BENCH__&&(s.fastLaneName=r)}function M(r,i){k.__ASKR_BENCH__&&(r==="reconcile"?s.reconcilePhaseMs=i:s.domCommitPhaseMs=i)}function j(){return{...s}}function C(r){if(r&&typeof r=="object"&&"$$typeof"in r&&r.$$typeof===L){const i=r;if(typeof i.type=="function"){const u=i.type,m=u(i.props||{});return C(m)}return i}return r}function U(r,i,u){const m=typeof r=="function"?null:r,f=R();return{sourceState:m,items:new Map,orderedKeys:[],byFn:i,renderFn:u,parentInstance:f,mounted:!1}}let N=1;function w(r,i,u,m){l("itemCreated");let f=u;const p=Object.assign(()=>f,{set(t){const e=typeof t=="function"?t(f):t;e!==f&&(f=e)}});p[Symbol.iterator]=function*(){yield p,yield p.set};const _=()=>null,a=B(`for-item-${r}`,_,{},null);m.parentInstance&&(a.ownerFrame=m.parentInstance.ownerFrame);const b=R();y(a);const I=K();a._currentRenderToken=N++,a._pendingReadStates=new Set,l("rowFactory");const v=C(m.renderFn(i,()=>p()));if(v&&typeof v=="object"&&"type"in v){const t=v;t.key=r,typeof t.type=="string"&&(t.props||(t.props={}),t.props["data-key"]===void 0&&(t.props["data-key"]=String(r)))}E(a),y(b);const d={key:r,item:i,indexSignal:p,componentInstance:a,vnode:v,_startStateIndex:I};return a._pendingFlushTask=()=>{const t=R();y(a),a.stateIndexCheck=-1;const e=a.stateValues;for(let c=0;c<e.length;c++){const n=e[c];n&&(n._hasBeenRead=!1)}H(I),a._currentRenderToken=N++,a._pendingReadStates=new Set;try{const c=C(m.renderFn(i,()=>p()));d.vnode=c,E(a)}finally{y(t)}const o=m.parentInstance;o&&o._enqueueRun?.()},d}function P(r,i){k.__ASKR_BENCH__&&T();const u=k.__ASKR_BENCH__?performance.now():0,{items:m,orderedKeys:f,byFn:p}=r,_=f.length,a=i.length;if(_<=a){let d=!0;for(let t=0;t<_;t++)if(p(i[t],t)!==f[t]){d=!1;break}if(d){F("APPEND");const t=[];for(let e=0;e<_;e++){const o=i[e],c=f[e],n=m.get(c);l("itemReused");const g=n.item!==o,h=n.indexSignal()!==e;if(g){n.item=o;const S=R();y(n.componentInstance),l("rowFactory"),n.vnode=C(r.renderFn(o,()=>n.indexSignal()));try{n.vnode&&typeof n.vnode=="object"&&"type"in n.vnode&&(n.vnode.key=c)}catch(x){}y(S)}h&&n.indexSignal.set(e),t.push(n.vnode)}for(let e=_;e<a;e++){const o=i[e],c=p(o,e),n=w(c,o,e,r);m.set(c,n),t.push(n.vnode),f[e]=c}return k.__ASKR_BENCH__&&M("reconcile",performance.now()-u),t}}if(a<=_){let d=!0;for(let t=0;t<a;t++)if(p(i[t],t)!==f[t]){d=!1;break}if(d){F("TRUNCATE");const t=[];for(let e=0;e<a;e++){const o=i[e],c=f[e],n=m.get(c);l("itemReused");const g=n.item!==o,h=n.indexSignal()!==e;if(g){n.item=o;const S=R();y(n.componentInstance),l("rowFactory"),n.vnode=C(r.renderFn(o,()=>n.indexSignal()));try{n.vnode&&typeof n.vnode=="object"&&"type"in n.vnode&&(n.vnode.key=c)}catch(x){}y(S)}h&&n.indexSignal.set(e),t.push(n.vnode)}for(let e=a;e<_;e++){const o=f[e],c=m.get(o);if(c){l("itemRemoved");const n=c.componentInstance;n.abortController.abort();for(const g of n.cleanupFns)try{g()}catch{}m.delete(o)}}return f.length=a,r.orderedKeys=f,k.__ASKR_BENCH__&&M("reconcile",performance.now()-u),t}}if(_===a){let d=!0;for(let t=0;t<_;t++)if(p(i[t],t)!==f[t]){d=!1;break}if(d){F("NO_REORDER");const t=[];for(let e=0;e<_;e++){const o=i[e],c=f[e],n=m.get(c);l("itemReused");const g=n.item!==o,h=n.indexSignal()!==e;if(g){n.item=o;const S=R();y(n.componentInstance),l("rowFactory");const x=C(r.renderFn(o,()=>n.indexSignal()));n.vnode=x,y(S)}h&&n.indexSignal.set(e),t.push(n.vnode)}return k.__ASKR_BENCH__&&M("reconcile",performance.now()-u),t}}F("FULL_KEYED");const b=new Set(f),I=[],v=[];for(let d=0;d<i.length;d++){const t=i[d],e=p(t,d);l("keyLookup"),b.delete(e),I.push(e);const o=m.get(e);if(l(o?"keyHit":"keyMiss"),o){l("itemReused");const c=o.item!==t,n=o.indexSignal()!==d;if(c){o.item=t;const g=R();y(o.componentInstance),l("rowFactory"),o.vnode=C(r.renderFn(t,()=>o.indexSignal()));try{o.vnode&&typeof o.vnode=="object"&&"type"in o.vnode&&(o.vnode.key=e)}catch(h){}y(g)}n&&o.indexSignal.set(d),v.push(o.vnode)}else{const c=w(e,t,d,r);m.set(e,c),v.push(c.vnode)}}for(const d of b){const t=m.get(d);if(t){l("itemRemoved");const e=t.componentInstance;e.abortController.abort();for(const o of e.cleanupFns)try{o()}catch{}m.delete(d)}}return r.orderedKeys=I,k.__ASKR_BENCH__&&M("reconcile",performance.now()-u),v}function $(r,i){const u=i();if(!Array.isArray(u))throw new Error("For source must evaluate to an array");return P(r,u)}export{U as createForState,w as createItemInstance,$ as evaluateForState,j as getBenchMetrics,P as reconcileForItems};
1
+ import{getCurrentInstance as R,createComponentInstance as K,setCurrentComponentInstance as y,getCurrentStateIndex as H,finalizeReadSubscriptions as E,setStateIndex as L}from"./component.js";import{ELEMENT_TYPE as T}from"../common/jsx.js";const v=globalThis,s={itemsCreated:0,itemsReused:0,itemsRemoved:0,itemsMoved:0,rowFactoryInvocations:0,keyLookups:0,keyHits:0,keyMisses:0,domInserts:0,domRemoves:0,domMoves:0,domAttrSets:0,domTextSets:0,reconcilePhaseMs:0,domCommitPhaseMs:0,fastLaneName:null};function P(){v.__ASKR_BENCH__&&(s.itemsCreated=0,s.itemsReused=0,s.itemsRemoved=0,s.itemsMoved=0,s.rowFactoryInvocations=0,s.keyLookups=0,s.keyHits=0,s.keyMisses=0,s.domInserts=0,s.domRemoves=0,s.domMoves=0,s.domAttrSets=0,s.domTextSets=0,s.reconcilePhaseMs=0,s.domCommitPhaseMs=0,s.fastLaneName=null)}function l(r){if(v.__ASKR_BENCH__)switch(r){case"itemCreated":s.itemsCreated++;break;case"itemReused":s.itemsReused++;break;case"itemRemoved":s.itemsRemoved++;break;case"itemMoved":s.itemsMoved++;break;case"rowFactory":s.rowFactoryInvocations++;break;case"keyLookup":s.keyLookups++;break;case"keyHit":s.keyHits++;break;case"keyMiss":s.keyMisses++;break;case"domInsert":s.domInserts++;break;case"domRemove":s.domRemoves++;break;case"domMove":s.domMoves++;break;case"domAttrSet":s.domAttrSets++;break;case"domTextSet":s.domTextSets++;break}}function F(r){v.__ASKR_BENCH__&&(s.fastLaneName=r)}function M(r,i){v.__ASKR_BENCH__&&(r==="reconcile"?s.reconcilePhaseMs=i:s.domCommitPhaseMs=i)}function U(){return{...s}}function C(r){if(r&&typeof r=="object"&&"$$typeof"in r&&r.$$typeof===T){const i=r;if(typeof i.type=="function"){const u=i.type,m=u(i.props||{});return C(m)}return i}return r}function $(r,i,u){const m=typeof r=="function"?null:r,f=R();return{sourceState:m,items:new Map,orderedKeys:[],byFn:i,renderFn:u,parentInstance:f,mounted:!1}}let N=1;function w(r,i,u,m){l("itemCreated");let f=u;const p=Object.assign(()=>f,{set(t){const e=typeof t=="function"?t(f):t;e!==f&&(f=e)}});p[Symbol.iterator]=function*(){yield p,yield p.set};const _=()=>null,a=K(`for-item-${r}`,_,{},null);m.parentInstance&&(a.ownerFrame=m.parentInstance.ownerFrame);const b=R();y(a);const I=H();a._currentRenderToken=N++,a._pendingReadStates=new Set,l("rowFactory");const k=C(m.renderFn(i,()=>p()));if(k&&typeof k=="object"&&"type"in k){const t=k;t.key=r,typeof t.type=="string"&&(t.props||(t.props={}),t.props["data-key"]===void 0&&(t.props["data-key"]=String(r)))}E(a),y(b);const d={key:r,item:i,indexSignal:p,componentInstance:a,vnode:k,_startStateIndex:I};return a._pendingFlushTask=()=>{const t=R();y(a),a.stateIndexCheck=-1;const e=a.stateValues;for(let c=0;c<e.length;c++){const n=e[c];n&&(n._hasBeenRead=!1)}L(I),a._currentRenderToken=N++,a._pendingReadStates=new Set;try{const c=C(m.renderFn(i,()=>p()));d.vnode=c,E(a)}finally{y(t)}const o=m.parentInstance;o&&o._enqueueRun?.()},d}function A(r,i){v.__ASKR_BENCH__&&P();const u=v.__ASKR_BENCH__?performance.now():0,{items:m,orderedKeys:f,byFn:p}=r,_=f.length,a=i.length;if(_<=a){let d=!0;for(let t=0;t<_;t++)if(p(i[t],t)!==f[t]){d=!1;break}if(d){F("APPEND");const t=[];for(let e=0;e<_;e++){const o=i[e],c=f[e],n=m.get(c);l("itemReused");const g=n.item!==o,h=n.indexSignal()!==e;if(g){n.item=o;const S=R();y(n.componentInstance),l("rowFactory"),n.vnode=C(r.renderFn(o,()=>n.indexSignal()));try{n.vnode&&typeof n.vnode=="object"&&"type"in n.vnode&&(n.vnode.key=c)}catch(x){}y(S)}h&&n.indexSignal.set(e),t.push(n.vnode)}for(let e=_;e<a;e++){const o=i[e],c=p(o,e),n=w(c,o,e,r);m.set(c,n),t.push(n.vnode),f[e]=c}return v.__ASKR_BENCH__&&M("reconcile",performance.now()-u),t}}if(a<=_){let d=!0;for(let t=0;t<a;t++)if(p(i[t],t)!==f[t]){d=!1;break}if(d){F("TRUNCATE");const t=[];for(let e=0;e<a;e++){const o=i[e],c=f[e],n=m.get(c);l("itemReused");const g=n.item!==o,h=n.indexSignal()!==e;if(g){n.item=o;const S=R();y(n.componentInstance),l("rowFactory"),n.vnode=C(r.renderFn(o,()=>n.indexSignal()));try{n.vnode&&typeof n.vnode=="object"&&"type"in n.vnode&&(n.vnode.key=c)}catch(x){}y(S)}h&&n.indexSignal.set(e),t.push(n.vnode)}for(let e=a;e<_;e++){const o=f[e],c=m.get(o);if(c){l("itemRemoved");const n=c.componentInstance;n.abortController.abort();for(const g of n.cleanupFns)try{g()}catch{}m.delete(o)}}return f.length=a,r.orderedKeys=f,v.__ASKR_BENCH__&&M("reconcile",performance.now()-u),t}}if(_===a){let d=!0;for(let t=0;t<_;t++)if(p(i[t],t)!==f[t]){d=!1;break}if(d){F("NO_REORDER");const t=[];for(let e=0;e<_;e++){const o=i[e],c=f[e],n=m.get(c);l("itemReused");const g=n.item!==o,h=n.indexSignal()!==e;if(g){n.item=o;const S=R();y(n.componentInstance),l("rowFactory");const x=C(r.renderFn(o,()=>n.indexSignal()));n.vnode=x;try{n.vnode&&typeof n.vnode=="object"&&"type"in n.vnode&&(n.vnode.key=c)}catch(B){}y(S)}h&&n.indexSignal.set(e),t.push(n.vnode)}return v.__ASKR_BENCH__&&M("reconcile",performance.now()-u),t}}F("FULL_KEYED");const b=new Set(f),I=[],k=[];for(let d=0;d<i.length;d++){const t=i[d],e=p(t,d);l("keyLookup"),b.delete(e),I.push(e);const o=m.get(e);if(l(o?"keyHit":"keyMiss"),o){l("itemReused");const c=o.item!==t,n=o.indexSignal()!==d;if(c){o.item=t;const g=R();y(o.componentInstance),l("rowFactory"),o.vnode=C(r.renderFn(t,()=>o.indexSignal()));try{o.vnode&&typeof o.vnode=="object"&&"type"in o.vnode&&(o.vnode.key=e)}catch(h){}y(g)}n&&o.indexSignal.set(d),k.push(o.vnode)}else{const c=w(e,t,d,r);m.set(e,c),k.push(c.vnode)}}for(const d of b){const t=m.get(d);if(t){l("itemRemoved");const e=t.componentInstance;e.abortController.abort();for(const o of e.cleanupFns)try{o()}catch{}m.delete(d)}}return r.orderedKeys=I,v.__ASKR_BENCH__&&M("reconcile",performance.now()-u),k}function O(r,i){const u=i();if(!Array.isArray(u))throw new Error("For source must evaluate to an array");return A(r,u)}export{$ as createForState,w as createItemInstance,O as evaluateForState,U as getBenchMetrics,A as reconcileForItems};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@askrjs/askr",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "Actor-backed deterministic UI framework",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",