react-perfscope 0.6.0 → 0.7.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/auto.cjs CHANGED
@@ -24,7 +24,9 @@ function createConfiguredRecorder() {
24
24
  recorder.use(interaction);
25
25
  const frame = (0, import_core.createFrameCollector)();
26
26
  recorder.use(frame);
27
- const finalize = (result) => Promise.resolve(interaction.finalize(result)).then((r) => selfProfiler.finalize(r)).then((r) => heap.finalize(r)).then((r) => frame.finalize(r));
27
+ const leak = (0, import_react.createLeakCollector)();
28
+ recorder.use(leak);
29
+ const finalize = (result) => Promise.resolve(interaction.finalize(result)).then((r) => selfProfiler.finalize(r)).then((r) => heap.finalize(r)).then((r) => frame.finalize(r)).then((r) => leak.finalize(r));
28
30
  return { recorder, finalize };
29
31
  }
30
32
 
package/dist/auto.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/auto.ts","../src/bootstrap.ts"],"sourcesContent":["import { createSourceMapResolver } from '@react-perfscope/core'\nimport { installDevToolsHook } from '@react-perfscope/react'\nimport { mount } from '@react-perfscope/ui'\nimport { createConfiguredRecorder } from './bootstrap'\n\n/**\n * Side-effect entry. Importing `react-perfscope/auto` bootstraps a Recorder\n * with the render collector and mounts the UI. Idempotent — importing twice\n * is a no-op (the first import wins).\n *\n * Bails when `process.env.NODE_ENV === 'production'` (build plugins also\n * guard against prod, but this is defense-in-depth).\n */\nfunction bootstrap(): void {\n if (typeof globalThis === 'undefined') return\n const g = globalThis as { __REACT_PERFSCOPE_AUTO_MOUNTED__?: boolean }\n if (g.__REACT_PERFSCOPE_AUTO_MOUNTED__) return\n\n const env = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env?.NODE_ENV\n if (env === 'production') return\n\n if (typeof document === 'undefined') return\n\n try {\n // Install the React DevTools hook SYNCHRONOUSLY before react-dom is\n // evaluated. react-dom captures `__REACT_DEVTOOLS_GLOBAL_HOOK__` exactly\n // once at module-load time, so the hook must exist by the time the user\n // bundle imports react-dom. A no-op listener is enough to register the\n // hook — when the render collector later activates, it adds the real\n // commit handler to the same global hook.\n installDevToolsHook(() => {})\n\n const { recorder, finalize } = createConfiguredRecorder()\n const resolver = createSourceMapResolver()\n mount({\n recorder,\n resolveFrame: (f) => resolver.resolve(f),\n finalize,\n })\n g.__REACT_PERFSCOPE_AUTO_MOUNTED__ = true\n } catch (err) {\n console.warn('[react-perfscope] auto bootstrap failed:', err)\n }\n}\n\nbootstrap()\n","import {\n createRecorder,\n createForcedReflowCollector,\n createLongTasksCollector,\n createLayoutShiftCollector,\n createNetworkCollector,\n createWebVitalsCollector,\n createSelfProfilingCollector,\n createHeapCollector,\n createInteractionCollector,\n createFrameCollector,\n} from '@react-perfscope/core'\nimport type { Recorder, RecordingResult } from '@react-perfscope/core'\nimport { createRenderCollector } from '@react-perfscope/react'\n\nexport interface ConfiguredRecorder {\n recorder: Recorder\n /** Runs the post-recording finalize chain (interaction → self-profiling →\n * heap → frame) in the order each collector depends on the previous one. */\n finalize: (result: RecordingResult) => Promise<RecordingResult>\n}\n\n/**\n * Assembles the recorder + full collector set that react-perfscope ships,\n * minus the UI. The single source of truth for what gets recorded: both the\n * `/auto` bootstrap and the E2E verification harness call this, so the harness\n * can never validate a collector set that differs from what users get.\n *\n * The caller is responsible for installing the React DevTools hook BEFORE\n * react-dom evaluates (it is timing-sensitive) and for mounting any UI.\n */\nexport function createConfiguredRecorder(): ConfiguredRecorder {\n const recorder = createRecorder()\n recorder.use(createForcedReflowCollector())\n recorder.use(createLongTasksCollector())\n recorder.use(createLayoutShiftCollector())\n recorder.use(createNetworkCollector())\n recorder.use(createWebVitalsCollector())\n recorder.use(createRenderCollector())\n const selfProfiler = createSelfProfilingCollector()\n recorder.use(selfProfiler)\n const heap = createHeapCollector()\n recorder.use(heap)\n const interaction = createInteractionCollector()\n recorder.use(interaction)\n const frame = createFrameCollector()\n recorder.use(frame)\n\n // Assemble interactions first so self-profiling can attribute their\n // processing windows, then attach the heap series and frame timestamps.\n const finalize = (result: RecordingResult): Promise<RecordingResult> =>\n Promise.resolve(interaction.finalize(result))\n .then((r) => selfProfiler.finalize(r))\n .then((r) => heap.finalize(r))\n .then((r) => frame.finalize(r))\n\n return { recorder, finalize }\n}\n"],"mappings":";;;AAAA,IAAAA,eAAwC;AACxC,IAAAC,gBAAoC;AACpC,gBAAsB;;;ACFtB,kBAWO;AAEP,mBAAsC;AAkB/B,SAAS,2BAA+C;AAC7D,QAAM,eAAW,4BAAe;AAChC,WAAS,QAAI,yCAA4B,CAAC;AAC1C,WAAS,QAAI,sCAAyB,CAAC;AACvC,WAAS,QAAI,wCAA2B,CAAC;AACzC,WAAS,QAAI,oCAAuB,CAAC;AACrC,WAAS,QAAI,sCAAyB,CAAC;AACvC,WAAS,QAAI,oCAAsB,CAAC;AACpC,QAAM,mBAAe,0CAA6B;AAClD,WAAS,IAAI,YAAY;AACzB,QAAM,WAAO,iCAAoB;AACjC,WAAS,IAAI,IAAI;AACjB,QAAM,kBAAc,wCAA2B;AAC/C,WAAS,IAAI,WAAW;AACxB,QAAM,YAAQ,kCAAqB;AACnC,WAAS,IAAI,KAAK;AAIlB,QAAM,WAAW,CAAC,WAChB,QAAQ,QAAQ,YAAY,SAAS,MAAM,CAAC,EACzC,KAAK,CAAC,MAAM,aAAa,SAAS,CAAC,CAAC,EACpC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,EAC5B,KAAK,CAAC,MAAM,MAAM,SAAS,CAAC,CAAC;AAElC,SAAO,EAAE,UAAU,SAAS;AAC9B;;;AD5CA,SAAS,YAAkB;AACzB,MAAI,OAAO,eAAe,YAAa;AACvC,QAAM,IAAI;AACV,MAAI,EAAE,iCAAkC;AAExC,QAAM,MAAO,WAA6D,SAAS,KAAK;AACxF,MAAI,QAAQ,aAAc;AAE1B,MAAI,OAAO,aAAa,YAAa;AAErC,MAAI;AAOF,2CAAoB,MAAM;AAAA,IAAC,CAAC;AAE5B,UAAM,EAAE,UAAU,SAAS,IAAI,yBAAyB;AACxD,UAAM,eAAW,sCAAwB;AACzC,yBAAM;AAAA,MACJ;AAAA,MACA,cAAc,CAAC,MAAM,SAAS,QAAQ,CAAC;AAAA,MACvC;AAAA,IACF,CAAC;AACD,MAAE,mCAAmC;AAAA,EACvC,SAAS,KAAK;AACZ,YAAQ,KAAK,4CAA4C,GAAG;AAAA,EAC9D;AACF;AAEA,UAAU;","names":["import_core","import_react"]}
1
+ {"version":3,"sources":["../src/auto.ts","../src/bootstrap.ts"],"sourcesContent":["import { createSourceMapResolver } from '@react-perfscope/core'\nimport { installDevToolsHook } from '@react-perfscope/react'\nimport { mount } from '@react-perfscope/ui'\nimport { createConfiguredRecorder } from './bootstrap'\n\n/**\n * Side-effect entry. Importing `react-perfscope/auto` bootstraps a Recorder\n * with the render collector and mounts the UI. Idempotent — importing twice\n * is a no-op (the first import wins).\n *\n * Bails when `process.env.NODE_ENV === 'production'` (build plugins also\n * guard against prod, but this is defense-in-depth).\n */\nfunction bootstrap(): void {\n if (typeof globalThis === 'undefined') return\n const g = globalThis as { __REACT_PERFSCOPE_AUTO_MOUNTED__?: boolean }\n if (g.__REACT_PERFSCOPE_AUTO_MOUNTED__) return\n\n const env = (globalThis as { process?: { env?: { NODE_ENV?: string } } }).process?.env?.NODE_ENV\n if (env === 'production') return\n\n if (typeof document === 'undefined') return\n\n try {\n // Install the React DevTools hook SYNCHRONOUSLY before react-dom is\n // evaluated. react-dom captures `__REACT_DEVTOOLS_GLOBAL_HOOK__` exactly\n // once at module-load time, so the hook must exist by the time the user\n // bundle imports react-dom. A no-op listener is enough to register the\n // hook — when the render collector later activates, it adds the real\n // commit handler to the same global hook.\n installDevToolsHook(() => {})\n\n const { recorder, finalize } = createConfiguredRecorder()\n const resolver = createSourceMapResolver()\n mount({\n recorder,\n resolveFrame: (f) => resolver.resolve(f),\n finalize,\n })\n g.__REACT_PERFSCOPE_AUTO_MOUNTED__ = true\n } catch (err) {\n console.warn('[react-perfscope] auto bootstrap failed:', err)\n }\n}\n\nbootstrap()\n","import {\n createRecorder,\n createForcedReflowCollector,\n createLongTasksCollector,\n createLayoutShiftCollector,\n createNetworkCollector,\n createWebVitalsCollector,\n createSelfProfilingCollector,\n createHeapCollector,\n createInteractionCollector,\n createFrameCollector,\n} from '@react-perfscope/core'\nimport type { Recorder, RecordingResult } from '@react-perfscope/core'\nimport { createRenderCollector, createLeakCollector } from '@react-perfscope/react'\n\nexport interface ConfiguredRecorder {\n recorder: Recorder\n /** Runs the post-recording finalize chain (interaction → self-profiling →\n * heap → frame) in the order each collector depends on the previous one. */\n finalize: (result: RecordingResult) => Promise<RecordingResult>\n}\n\n/**\n * Assembles the recorder + full collector set that react-perfscope ships,\n * minus the UI. The single source of truth for what gets recorded: both the\n * `/auto` bootstrap and the E2E verification harness call this, so the harness\n * can never validate a collector set that differs from what users get.\n *\n * The caller is responsible for installing the React DevTools hook BEFORE\n * react-dom evaluates (it is timing-sensitive) and for mounting any UI.\n */\nexport function createConfiguredRecorder(): ConfiguredRecorder {\n const recorder = createRecorder()\n recorder.use(createForcedReflowCollector())\n recorder.use(createLongTasksCollector())\n recorder.use(createLayoutShiftCollector())\n recorder.use(createNetworkCollector())\n recorder.use(createWebVitalsCollector())\n recorder.use(createRenderCollector())\n const selfProfiler = createSelfProfilingCollector()\n recorder.use(selfProfiler)\n const heap = createHeapCollector()\n recorder.use(heap)\n const interaction = createInteractionCollector()\n recorder.use(interaction)\n const frame = createFrameCollector()\n recorder.use(frame)\n const leak = createLeakCollector()\n recorder.use(leak)\n\n // Assemble interactions first so self-profiling can attribute their\n // processing windows, then attach the heap series, frame timestamps, and\n // leak suspects.\n const finalize = (result: RecordingResult): Promise<RecordingResult> =>\n Promise.resolve(interaction.finalize(result))\n .then((r) => selfProfiler.finalize(r))\n .then((r) => heap.finalize(r))\n .then((r) => frame.finalize(r))\n .then((r) => leak.finalize(r))\n\n return { recorder, finalize }\n}\n"],"mappings":";;;AAAA,IAAAA,eAAwC;AACxC,IAAAC,gBAAoC;AACpC,gBAAsB;;;ACFtB,kBAWO;AAEP,mBAA2D;AAkBpD,SAAS,2BAA+C;AAC7D,QAAM,eAAW,4BAAe;AAChC,WAAS,QAAI,yCAA4B,CAAC;AAC1C,WAAS,QAAI,sCAAyB,CAAC;AACvC,WAAS,QAAI,wCAA2B,CAAC;AACzC,WAAS,QAAI,oCAAuB,CAAC;AACrC,WAAS,QAAI,sCAAyB,CAAC;AACvC,WAAS,QAAI,oCAAsB,CAAC;AACpC,QAAM,mBAAe,0CAA6B;AAClD,WAAS,IAAI,YAAY;AACzB,QAAM,WAAO,iCAAoB;AACjC,WAAS,IAAI,IAAI;AACjB,QAAM,kBAAc,wCAA2B;AAC/C,WAAS,IAAI,WAAW;AACxB,QAAM,YAAQ,kCAAqB;AACnC,WAAS,IAAI,KAAK;AAClB,QAAM,WAAO,kCAAoB;AACjC,WAAS,IAAI,IAAI;AAKjB,QAAM,WAAW,CAAC,WAChB,QAAQ,QAAQ,YAAY,SAAS,MAAM,CAAC,EACzC,KAAK,CAAC,MAAM,aAAa,SAAS,CAAC,CAAC,EACpC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,EAC5B,KAAK,CAAC,MAAM,MAAM,SAAS,CAAC,CAAC,EAC7B,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AAEjC,SAAO,EAAE,UAAU,SAAS;AAC9B;;;ADhDA,SAAS,YAAkB;AACzB,MAAI,OAAO,eAAe,YAAa;AACvC,QAAM,IAAI;AACV,MAAI,EAAE,iCAAkC;AAExC,QAAM,MAAO,WAA6D,SAAS,KAAK;AACxF,MAAI,QAAQ,aAAc;AAE1B,MAAI,OAAO,aAAa,YAAa;AAErC,MAAI;AAOF,2CAAoB,MAAM;AAAA,IAAC,CAAC;AAE5B,UAAM,EAAE,UAAU,SAAS,IAAI,yBAAyB;AACxD,UAAM,eAAW,sCAAwB;AACzC,yBAAM;AAAA,MACJ;AAAA,MACA,cAAc,CAAC,MAAM,SAAS,QAAQ,CAAC;AAAA,MACvC;AAAA,IACF,CAAC;AACD,MAAE,mCAAmC;AAAA,EACvC,SAAS,KAAK;AACZ,YAAQ,KAAK,4CAA4C,GAAG;AAAA,EAC9D;AACF;AAEA,UAAU;","names":["import_core","import_react"]}
package/dist/auto.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createConfiguredRecorder
3
- } from "./chunk-HQT4LEXO.js";
3
+ } from "./chunk-AZMABLM7.js";
4
4
 
5
5
  // src/auto.ts
6
6
  import { createSourceMapResolver } from "@react-perfscope/core";
@@ -11,7 +11,7 @@ import {
11
11
  createInteractionCollector,
12
12
  createFrameCollector
13
13
  } from "@react-perfscope/core";
14
- import { createRenderCollector } from "@react-perfscope/react";
14
+ import { createRenderCollector, createLeakCollector } from "@react-perfscope/react";
15
15
  function createConfiguredRecorder() {
16
16
  const recorder = createRecorder();
17
17
  recorder.use(createForcedReflowCollector());
@@ -28,11 +28,13 @@ function createConfiguredRecorder() {
28
28
  recorder.use(interaction);
29
29
  const frame = createFrameCollector();
30
30
  recorder.use(frame);
31
- const finalize = (result) => Promise.resolve(interaction.finalize(result)).then((r) => selfProfiler.finalize(r)).then((r) => heap.finalize(r)).then((r) => frame.finalize(r));
31
+ const leak = createLeakCollector();
32
+ recorder.use(leak);
33
+ const finalize = (result) => Promise.resolve(interaction.finalize(result)).then((r) => selfProfiler.finalize(r)).then((r) => heap.finalize(r)).then((r) => frame.finalize(r)).then((r) => leak.finalize(r));
32
34
  return { recorder, finalize };
33
35
  }
34
36
 
35
37
  export {
36
38
  createConfiguredRecorder
37
39
  };
38
- //# sourceMappingURL=chunk-HQT4LEXO.js.map
40
+ //# sourceMappingURL=chunk-AZMABLM7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/bootstrap.ts"],"sourcesContent":["import {\n createRecorder,\n createForcedReflowCollector,\n createLongTasksCollector,\n createLayoutShiftCollector,\n createNetworkCollector,\n createWebVitalsCollector,\n createSelfProfilingCollector,\n createHeapCollector,\n createInteractionCollector,\n createFrameCollector,\n} from '@react-perfscope/core'\nimport type { Recorder, RecordingResult } from '@react-perfscope/core'\nimport { createRenderCollector, createLeakCollector } from '@react-perfscope/react'\n\nexport interface ConfiguredRecorder {\n recorder: Recorder\n /** Runs the post-recording finalize chain (interaction → self-profiling →\n * heap → frame) in the order each collector depends on the previous one. */\n finalize: (result: RecordingResult) => Promise<RecordingResult>\n}\n\n/**\n * Assembles the recorder + full collector set that react-perfscope ships,\n * minus the UI. The single source of truth for what gets recorded: both the\n * `/auto` bootstrap and the E2E verification harness call this, so the harness\n * can never validate a collector set that differs from what users get.\n *\n * The caller is responsible for installing the React DevTools hook BEFORE\n * react-dom evaluates (it is timing-sensitive) and for mounting any UI.\n */\nexport function createConfiguredRecorder(): ConfiguredRecorder {\n const recorder = createRecorder()\n recorder.use(createForcedReflowCollector())\n recorder.use(createLongTasksCollector())\n recorder.use(createLayoutShiftCollector())\n recorder.use(createNetworkCollector())\n recorder.use(createWebVitalsCollector())\n recorder.use(createRenderCollector())\n const selfProfiler = createSelfProfilingCollector()\n recorder.use(selfProfiler)\n const heap = createHeapCollector()\n recorder.use(heap)\n const interaction = createInteractionCollector()\n recorder.use(interaction)\n const frame = createFrameCollector()\n recorder.use(frame)\n const leak = createLeakCollector()\n recorder.use(leak)\n\n // Assemble interactions first so self-profiling can attribute their\n // processing windows, then attach the heap series, frame timestamps, and\n // leak suspects.\n const finalize = (result: RecordingResult): Promise<RecordingResult> =>\n Promise.resolve(interaction.finalize(result))\n .then((r) => selfProfiler.finalize(r))\n .then((r) => heap.finalize(r))\n .then((r) => frame.finalize(r))\n .then((r) => leak.finalize(r))\n\n return { recorder, finalize }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,uBAAuB,2BAA2B;AAkBpD,SAAS,2BAA+C;AAC7D,QAAM,WAAW,eAAe;AAChC,WAAS,IAAI,4BAA4B,CAAC;AAC1C,WAAS,IAAI,yBAAyB,CAAC;AACvC,WAAS,IAAI,2BAA2B,CAAC;AACzC,WAAS,IAAI,uBAAuB,CAAC;AACrC,WAAS,IAAI,yBAAyB,CAAC;AACvC,WAAS,IAAI,sBAAsB,CAAC;AACpC,QAAM,eAAe,6BAA6B;AAClD,WAAS,IAAI,YAAY;AACzB,QAAM,OAAO,oBAAoB;AACjC,WAAS,IAAI,IAAI;AACjB,QAAM,cAAc,2BAA2B;AAC/C,WAAS,IAAI,WAAW;AACxB,QAAM,QAAQ,qBAAqB;AACnC,WAAS,IAAI,KAAK;AAClB,QAAM,OAAO,oBAAoB;AACjC,WAAS,IAAI,IAAI;AAKjB,QAAM,WAAW,CAAC,WAChB,QAAQ,QAAQ,YAAY,SAAS,MAAM,CAAC,EACzC,KAAK,CAAC,MAAM,aAAa,SAAS,CAAC,CAAC,EACpC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,EAC5B,KAAK,CAAC,MAAM,MAAM,SAAS,CAAC,CAAC,EAC7B,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AAEjC,SAAO,EAAE,UAAU,SAAS;AAC9B;","names":[]}
package/dist/index.cjs CHANGED
@@ -47,7 +47,9 @@ function createConfiguredRecorder() {
47
47
  recorder.use(interaction);
48
48
  const frame = (0, import_core.createFrameCollector)();
49
49
  recorder.use(frame);
50
- const finalize = (result) => Promise.resolve(interaction.finalize(result)).then((r) => selfProfiler.finalize(r)).then((r) => heap.finalize(r)).then((r) => frame.finalize(r));
50
+ const leak = (0, import_react.createLeakCollector)();
51
+ recorder.use(leak);
52
+ const finalize = (result) => Promise.resolve(interaction.finalize(result)).then((r) => selfProfiler.finalize(r)).then((r) => heap.finalize(r)).then((r) => frame.finalize(r)).then((r) => leak.finalize(r));
51
53
  return { recorder, finalize };
52
54
  }
53
55
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/bootstrap.ts"],"sourcesContent":["export * from '@react-perfscope/core'\nexport * from '@react-perfscope/react'\nexport * from '@react-perfscope/ui'\nexport { createConfiguredRecorder } from './bootstrap'\nexport type { ConfiguredRecorder } from './bootstrap'\n","import {\n createRecorder,\n createForcedReflowCollector,\n createLongTasksCollector,\n createLayoutShiftCollector,\n createNetworkCollector,\n createWebVitalsCollector,\n createSelfProfilingCollector,\n createHeapCollector,\n createInteractionCollector,\n createFrameCollector,\n} from '@react-perfscope/core'\nimport type { Recorder, RecordingResult } from '@react-perfscope/core'\nimport { createRenderCollector } from '@react-perfscope/react'\n\nexport interface ConfiguredRecorder {\n recorder: Recorder\n /** Runs the post-recording finalize chain (interaction → self-profiling →\n * heap → frame) in the order each collector depends on the previous one. */\n finalize: (result: RecordingResult) => Promise<RecordingResult>\n}\n\n/**\n * Assembles the recorder + full collector set that react-perfscope ships,\n * minus the UI. The single source of truth for what gets recorded: both the\n * `/auto` bootstrap and the E2E verification harness call this, so the harness\n * can never validate a collector set that differs from what users get.\n *\n * The caller is responsible for installing the React DevTools hook BEFORE\n * react-dom evaluates (it is timing-sensitive) and for mounting any UI.\n */\nexport function createConfiguredRecorder(): ConfiguredRecorder {\n const recorder = createRecorder()\n recorder.use(createForcedReflowCollector())\n recorder.use(createLongTasksCollector())\n recorder.use(createLayoutShiftCollector())\n recorder.use(createNetworkCollector())\n recorder.use(createWebVitalsCollector())\n recorder.use(createRenderCollector())\n const selfProfiler = createSelfProfilingCollector()\n recorder.use(selfProfiler)\n const heap = createHeapCollector()\n recorder.use(heap)\n const interaction = createInteractionCollector()\n recorder.use(interaction)\n const frame = createFrameCollector()\n recorder.use(frame)\n\n // Assemble interactions first so self-profiling can attribute their\n // processing windows, then attach the heap series and frame timestamps.\n const finalize = (result: RecordingResult): Promise<RecordingResult> =>\n Promise.resolve(interaction.finalize(result))\n .then((r) => selfProfiler.finalize(r))\n .then((r) => heap.finalize(r))\n .then((r) => frame.finalize(r))\n\n return { recorder, finalize }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,kCAAd;AACA,0BAAc,mCADd;AAEA,0BAAc,gCAFd;;;ACAA,kBAWO;AAEP,mBAAsC;AAkB/B,SAAS,2BAA+C;AAC7D,QAAM,eAAW,4BAAe;AAChC,WAAS,QAAI,yCAA4B,CAAC;AAC1C,WAAS,QAAI,sCAAyB,CAAC;AACvC,WAAS,QAAI,wCAA2B,CAAC;AACzC,WAAS,QAAI,oCAAuB,CAAC;AACrC,WAAS,QAAI,sCAAyB,CAAC;AACvC,WAAS,QAAI,oCAAsB,CAAC;AACpC,QAAM,mBAAe,0CAA6B;AAClD,WAAS,IAAI,YAAY;AACzB,QAAM,WAAO,iCAAoB;AACjC,WAAS,IAAI,IAAI;AACjB,QAAM,kBAAc,wCAA2B;AAC/C,WAAS,IAAI,WAAW;AACxB,QAAM,YAAQ,kCAAqB;AACnC,WAAS,IAAI,KAAK;AAIlB,QAAM,WAAW,CAAC,WAChB,QAAQ,QAAQ,YAAY,SAAS,MAAM,CAAC,EACzC,KAAK,CAAC,MAAM,aAAa,SAAS,CAAC,CAAC,EACpC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,EAC5B,KAAK,CAAC,MAAM,MAAM,SAAS,CAAC,CAAC;AAElC,SAAO,EAAE,UAAU,SAAS;AAC9B;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts","../src/bootstrap.ts"],"sourcesContent":["export * from '@react-perfscope/core'\nexport * from '@react-perfscope/react'\nexport * from '@react-perfscope/ui'\nexport { createConfiguredRecorder } from './bootstrap'\nexport type { ConfiguredRecorder } from './bootstrap'\n","import {\n createRecorder,\n createForcedReflowCollector,\n createLongTasksCollector,\n createLayoutShiftCollector,\n createNetworkCollector,\n createWebVitalsCollector,\n createSelfProfilingCollector,\n createHeapCollector,\n createInteractionCollector,\n createFrameCollector,\n} from '@react-perfscope/core'\nimport type { Recorder, RecordingResult } from '@react-perfscope/core'\nimport { createRenderCollector, createLeakCollector } from '@react-perfscope/react'\n\nexport interface ConfiguredRecorder {\n recorder: Recorder\n /** Runs the post-recording finalize chain (interaction → self-profiling →\n * heap → frame) in the order each collector depends on the previous one. */\n finalize: (result: RecordingResult) => Promise<RecordingResult>\n}\n\n/**\n * Assembles the recorder + full collector set that react-perfscope ships,\n * minus the UI. The single source of truth for what gets recorded: both the\n * `/auto` bootstrap and the E2E verification harness call this, so the harness\n * can never validate a collector set that differs from what users get.\n *\n * The caller is responsible for installing the React DevTools hook BEFORE\n * react-dom evaluates (it is timing-sensitive) and for mounting any UI.\n */\nexport function createConfiguredRecorder(): ConfiguredRecorder {\n const recorder = createRecorder()\n recorder.use(createForcedReflowCollector())\n recorder.use(createLongTasksCollector())\n recorder.use(createLayoutShiftCollector())\n recorder.use(createNetworkCollector())\n recorder.use(createWebVitalsCollector())\n recorder.use(createRenderCollector())\n const selfProfiler = createSelfProfilingCollector()\n recorder.use(selfProfiler)\n const heap = createHeapCollector()\n recorder.use(heap)\n const interaction = createInteractionCollector()\n recorder.use(interaction)\n const frame = createFrameCollector()\n recorder.use(frame)\n const leak = createLeakCollector()\n recorder.use(leak)\n\n // Assemble interactions first so self-profiling can attribute their\n // processing windows, then attach the heap series, frame timestamps, and\n // leak suspects.\n const finalize = (result: RecordingResult): Promise<RecordingResult> =>\n Promise.resolve(interaction.finalize(result))\n .then((r) => selfProfiler.finalize(r))\n .then((r) => heap.finalize(r))\n .then((r) => frame.finalize(r))\n .then((r) => leak.finalize(r))\n\n return { recorder, finalize }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAAc,kCAAd;AACA,0BAAc,mCADd;AAEA,0BAAc,gCAFd;;;ACAA,kBAWO;AAEP,mBAA2D;AAkBpD,SAAS,2BAA+C;AAC7D,QAAM,eAAW,4BAAe;AAChC,WAAS,QAAI,yCAA4B,CAAC;AAC1C,WAAS,QAAI,sCAAyB,CAAC;AACvC,WAAS,QAAI,wCAA2B,CAAC;AACzC,WAAS,QAAI,oCAAuB,CAAC;AACrC,WAAS,QAAI,sCAAyB,CAAC;AACvC,WAAS,QAAI,oCAAsB,CAAC;AACpC,QAAM,mBAAe,0CAA6B;AAClD,WAAS,IAAI,YAAY;AACzB,QAAM,WAAO,iCAAoB;AACjC,WAAS,IAAI,IAAI;AACjB,QAAM,kBAAc,wCAA2B;AAC/C,WAAS,IAAI,WAAW;AACxB,QAAM,YAAQ,kCAAqB;AACnC,WAAS,IAAI,KAAK;AAClB,QAAM,WAAO,kCAAoB;AACjC,WAAS,IAAI,IAAI;AAKjB,QAAM,WAAW,CAAC,WAChB,QAAQ,QAAQ,YAAY,SAAS,MAAM,CAAC,EACzC,KAAK,CAAC,MAAM,aAAa,SAAS,CAAC,CAAC,EACpC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,EAC5B,KAAK,CAAC,MAAM,MAAM,SAAS,CAAC,CAAC,EAC7B,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;AAEjC,SAAO,EAAE,UAAU,SAAS;AAC9B;","names":[]}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createConfiguredRecorder
3
- } from "./chunk-HQT4LEXO.js";
3
+ } from "./chunk-AZMABLM7.js";
4
4
 
5
5
  // src/index.ts
6
6
  export * from "@react-perfscope/core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-perfscope",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Zero-config React performance profiler with an in-app panel.",
5
5
  "keywords": [
6
6
  "react",
@@ -39,9 +39,9 @@
39
39
  "./dist/auto.cjs"
40
40
  ],
41
41
  "dependencies": {
42
- "@react-perfscope/core": "0.6.0",
43
- "@react-perfscope/ui": "0.6.0",
44
- "@react-perfscope/react": "0.6.0"
42
+ "@react-perfscope/core": "0.7.0",
43
+ "@react-perfscope/ui": "0.7.0",
44
+ "@react-perfscope/react": "0.7.0"
45
45
  },
46
46
  "license": "MIT",
47
47
  "author": "rayforvideos",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/bootstrap.ts"],"sourcesContent":["import {\n createRecorder,\n createForcedReflowCollector,\n createLongTasksCollector,\n createLayoutShiftCollector,\n createNetworkCollector,\n createWebVitalsCollector,\n createSelfProfilingCollector,\n createHeapCollector,\n createInteractionCollector,\n createFrameCollector,\n} from '@react-perfscope/core'\nimport type { Recorder, RecordingResult } from '@react-perfscope/core'\nimport { createRenderCollector } from '@react-perfscope/react'\n\nexport interface ConfiguredRecorder {\n recorder: Recorder\n /** Runs the post-recording finalize chain (interaction → self-profiling →\n * heap → frame) in the order each collector depends on the previous one. */\n finalize: (result: RecordingResult) => Promise<RecordingResult>\n}\n\n/**\n * Assembles the recorder + full collector set that react-perfscope ships,\n * minus the UI. The single source of truth for what gets recorded: both the\n * `/auto` bootstrap and the E2E verification harness call this, so the harness\n * can never validate a collector set that differs from what users get.\n *\n * The caller is responsible for installing the React DevTools hook BEFORE\n * react-dom evaluates (it is timing-sensitive) and for mounting any UI.\n */\nexport function createConfiguredRecorder(): ConfiguredRecorder {\n const recorder = createRecorder()\n recorder.use(createForcedReflowCollector())\n recorder.use(createLongTasksCollector())\n recorder.use(createLayoutShiftCollector())\n recorder.use(createNetworkCollector())\n recorder.use(createWebVitalsCollector())\n recorder.use(createRenderCollector())\n const selfProfiler = createSelfProfilingCollector()\n recorder.use(selfProfiler)\n const heap = createHeapCollector()\n recorder.use(heap)\n const interaction = createInteractionCollector()\n recorder.use(interaction)\n const frame = createFrameCollector()\n recorder.use(frame)\n\n // Assemble interactions first so self-profiling can attribute their\n // processing windows, then attach the heap series and frame timestamps.\n const finalize = (result: RecordingResult): Promise<RecordingResult> =>\n Promise.resolve(interaction.finalize(result))\n .then((r) => selfProfiler.finalize(r))\n .then((r) => heap.finalize(r))\n .then((r) => frame.finalize(r))\n\n return { recorder, finalize }\n}\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,6BAA6B;AAkB/B,SAAS,2BAA+C;AAC7D,QAAM,WAAW,eAAe;AAChC,WAAS,IAAI,4BAA4B,CAAC;AAC1C,WAAS,IAAI,yBAAyB,CAAC;AACvC,WAAS,IAAI,2BAA2B,CAAC;AACzC,WAAS,IAAI,uBAAuB,CAAC;AACrC,WAAS,IAAI,yBAAyB,CAAC;AACvC,WAAS,IAAI,sBAAsB,CAAC;AACpC,QAAM,eAAe,6BAA6B;AAClD,WAAS,IAAI,YAAY;AACzB,QAAM,OAAO,oBAAoB;AACjC,WAAS,IAAI,IAAI;AACjB,QAAM,cAAc,2BAA2B;AAC/C,WAAS,IAAI,WAAW;AACxB,QAAM,QAAQ,qBAAqB;AACnC,WAAS,IAAI,KAAK;AAIlB,QAAM,WAAW,CAAC,WAChB,QAAQ,QAAQ,YAAY,SAAS,MAAM,CAAC,EACzC,KAAK,CAAC,MAAM,aAAa,SAAS,CAAC,CAAC,EACpC,KAAK,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,EAC5B,KAAK,CAAC,MAAM,MAAM,SAAS,CAAC,CAAC;AAElC,SAAO,EAAE,UAAU,SAAS;AAC9B;","names":[]}