@lensmcp/valtio-instrumentation 1.25.5 → 1.25.7

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.
Files changed (2) hide show
  1. package/lib/proxy.js +1 -1
  2. package/package.json +3 -3
package/lib/proxy.js CHANGED
@@ -1 +1 @@
1
- "use strict";var h=Object.defineProperty;var s=(e,t)=>h(e,"name",{value:t,configurable:!0});var g=Object.defineProperty,n=s((e,t)=>g(e,"name",{value:t,configurable:!0}),"s");import{proxy as P,subscribe as I,unstable_enableOp as E}from"valtio/vanilla";import{publish as w,publishLazy as x,depsHash as f}from"@lensmcp/react-instrumentation";import{DEFAULT_PREVIEW_LIMITS as l,previewValue as $}from"./preview.js";import{registerStore as S,subscribersForPathAndParents as _,tagProxy as L}from"./store-registry.js";import{truncatePath as V}from"./snapshot.js";let d=!1;function v(){if(!d)try{E(!0),d=!0}catch{}}s(v,"$"),n(v,"ensureOpsEnabled");let O=0;export function proxy(e,t={}){v();const r=t.storeId??`valtio:store:${++O}`;S(r,t.source);const a=P(e);return L(a,r),w({source:"valtio",category:"state",severity:"info",title:`store-created ${r}`,fingerprint:`valtio-store:${r}`,raw:{kind:"store-created",store:{storeId:r,source:t.source,initialPreview:t.emitInitialPreview===!0?c(e):void 0}}}),I(a,m=>{for(const b of m){const[,o,u,y]=b;if(!(o??[]).length)continue;const p=`valtio-update:${r}:${V(o??[])}`;x(p,()=>{const i=(o??[]).map(String).join(".");return{source:"valtio",category:"state",severity:"info",title:`state-update ${r}.${i}`,fingerprint:p,raw:{kind:"state-update",update:{storeId:r,path:i,changedKeys:(o??[]).map(String),beforeHash:f([y]),afterHash:f([u]),preview:c(u),subscribers:_(r,i)}}}})}},!0),a}s(proxy,"proxy"),n(proxy,"proxy");const T=(()=>{const e=typeof process<"u"?process.env?.LENSMCP_VALTIO_PREVIEW_BYTES:void 0,t=Number(e),r=e!==void 0&&e!==""&&Number.isFinite(t)&&t>=0;return{...l,maxBytes:r?Math.floor(t):l.maxBytes}})();function c(e){try{return $(e,T)}catch{return}}s(c,"d"),n(c,"safePreview");
1
+ "use strict";var g=Object.defineProperty;var o=(e,t)=>g(e,"name",{value:t,configurable:!0});var P=Object.defineProperty,n=o((e,t)=>P(e,"name",{value:t,configurable:!0}),"n");import{proxy as I,subscribe as E,unstable_enableOp as w}from"valtio/vanilla";import{publish as x,publishLazy as S,depsHash as f,notePageState as $}from"@lensmcp/react-instrumentation";import{DEFAULT_PREVIEW_LIMITS as l,previewValue as _}from"./preview.js";import{registerStore as L,subscribersForPathAndParents as T,tagProxy as V}from"./store-registry.js";import{truncatePath as d}from"./snapshot.js";let v=!1;function m(){if(!v)try{w(!0),v=!0}catch{}}o(m,"L"),n(m,"ensureOpsEnabled");let O=0;export function proxy(e,t={}){m();const r=t.storeId??`valtio:store:${++O}`;L(r,t.source);const a=I(e);return V(a,r),x({source:"valtio",category:"state",severity:"info",title:`store-created ${r}`,fingerprint:`valtio-store:${r}`,raw:{kind:"store-created",store:{storeId:r,source:t.source,initialPreview:t.emitInitialPreview===!0?c(e):void 0}}}),E(a,y=>{for(const b of y){const[,s,u,h]=b;if(!(s??[]).length)continue;const p=`valtio-update:${r}:${d(s??[])}`;$(r,d(s??[])),S(p,()=>{const i=(s??[]).map(String).join(".");return{source:"valtio",category:"state",severity:"info",title:`state-update ${r}.${i}`,fingerprint:p,raw:{kind:"state-update",update:{storeId:r,path:i,changedKeys:(s??[]).map(String),beforeHash:f([h]),afterHash:f([u]),preview:c(u),subscribers:T(r,i)}}}})}},!0),a}o(proxy,"proxy"),n(proxy,"proxy");const A=(()=>{const e=typeof process<"u"?process.env?.LENSMCP_VALTIO_PREVIEW_BYTES:void 0,t=Number(e),r=e!==void 0&&e!==""&&Number.isFinite(t)&&t>=0;return{...l,maxBytes:r?Math.floor(t):l.maxBytes}})();function c(e){try{return _(e,A)}catch{return}}o(c,"l"),n(c,"safePreview");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/valtio-instrumentation",
3
- "version": "1.25.5",
3
+ "version": "1.25.7",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",
@@ -14,8 +14,8 @@
14
14
  }
15
15
  },
16
16
  "dependencies": {
17
- "@lensmcp/protocol-types": "1.25.5",
18
- "@lensmcp/react-instrumentation": "1.25.5",
17
+ "@lensmcp/protocol-types": "1.25.7",
18
+ "@lensmcp/react-instrumentation": "1.25.7",
19
19
  "proxy-compare": "^3.0.0",
20
20
  "tslib": "^2.3.0"
21
21
  },