react-dev-profiler 1.0.0 → 1.0.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/index.js CHANGED
@@ -1,9 +1,6 @@
1
1
  // src/DevProfiler.tsx
2
2
  import { Profiler, useRef as useRef4, useState as useState4, useEffect as useEffect4, useCallback as useCallback3 } from "react";
3
3
 
4
- // src/DevProfiler.module.css
5
- var DevProfiler_default = {};
6
-
7
4
  // src/types.ts
8
5
  var HISTORY_SIZE = 60;
9
6
  var INITIAL_PROFILER = {
@@ -37,6 +34,156 @@ var __DEV__ = typeof process !== "undefined" ? process.env.NODE_ENV !== "product
37
34
 
38
35
  // src/hooks.ts
39
36
  import { useState, useEffect, useCallback, useRef } from "react";
37
+
38
+ // src/styles.ts
39
+ var s = {
40
+ wrapper: {
41
+ display: "contents"
42
+ },
43
+ panel: {
44
+ position: "fixed",
45
+ zIndex: 99999,
46
+ background: "rgba(8, 8, 8, 0.95)",
47
+ border: "1px solid #222",
48
+ borderRadius: 10,
49
+ padding: "10px 14px",
50
+ minWidth: 220,
51
+ boxShadow: "0 8px 32px rgba(0, 0, 0, 0.7)",
52
+ fontFamily: "'SF Mono', 'Fira Code', monospace",
53
+ backdropFilter: "blur(12px)",
54
+ userSelect: "none",
55
+ color: "#ccc",
56
+ fontSize: 11
57
+ },
58
+ panelHeader: {
59
+ display: "flex",
60
+ justifyContent: "space-between",
61
+ alignItems: "center",
62
+ marginBottom: 8,
63
+ cursor: "grab",
64
+ touchAction: "none"
65
+ },
66
+ panelTitle: {
67
+ color: "#666",
68
+ fontSize: 9,
69
+ fontWeight: 700,
70
+ letterSpacing: 1.5,
71
+ textTransform: "uppercase",
72
+ display: "flex",
73
+ alignItems: "center",
74
+ gap: 6
75
+ },
76
+ instanceBadge: {
77
+ background: "#222",
78
+ color: "#888",
79
+ fontSize: 8,
80
+ padding: "1px 5px",
81
+ borderRadius: 4,
82
+ letterSpacing: 0.5,
83
+ textTransform: "none"
84
+ },
85
+ headerActions: {
86
+ display: "flex",
87
+ alignItems: "center",
88
+ gap: 8
89
+ },
90
+ iconBtn: {
91
+ background: "none",
92
+ border: "none",
93
+ color: "#444",
94
+ cursor: "pointer",
95
+ padding: 0,
96
+ lineHeight: 1,
97
+ display: "flex",
98
+ alignItems: "center",
99
+ transition: "color 0.15s"
100
+ },
101
+ iconBtnActive: {
102
+ color: "#4ade80"
103
+ },
104
+ closeBtn: {
105
+ background: "none",
106
+ border: "none",
107
+ color: "#444",
108
+ cursor: "pointer",
109
+ fontSize: 13,
110
+ padding: 0,
111
+ lineHeight: 1
112
+ },
113
+ body: {
114
+ display: "flex",
115
+ flexDirection: "column",
116
+ gap: 5
117
+ },
118
+ section: {
119
+ color: "#444",
120
+ fontSize: 8,
121
+ fontWeight: 600,
122
+ letterSpacing: 1,
123
+ textTransform: "uppercase",
124
+ marginTop: 2
125
+ },
126
+ separator: {
127
+ height: 1,
128
+ background: "#1a1a1a",
129
+ margin: "2px 0"
130
+ },
131
+ row: {
132
+ display: "flex",
133
+ justifyContent: "space-between",
134
+ alignItems: "center",
135
+ padding: "1px 0"
136
+ },
137
+ rowLabel: {
138
+ color: "#555",
139
+ fontSize: 10
140
+ },
141
+ rowValue: {
142
+ fontSize: 11,
143
+ fontWeight: 600
144
+ },
145
+ miniRow: {
146
+ display: "flex",
147
+ justifyContent: "space-between",
148
+ color: "#444",
149
+ fontSize: 9,
150
+ marginTop: -2,
151
+ marginBottom: 2
152
+ },
153
+ graphWrap: {
154
+ marginTop: 4
155
+ },
156
+ toggleBtn: {
157
+ position: "fixed",
158
+ zIndex: 99998,
159
+ minWidth: 28,
160
+ height: 24,
161
+ borderRadius: 7,
162
+ border: "1px solid #2a2a2a",
163
+ background: "rgba(20, 20, 20, 0.9)",
164
+ cursor: "pointer",
165
+ display: "flex",
166
+ alignItems: "center",
167
+ justifyContent: "center",
168
+ padding: "0 6px",
169
+ backdropFilter: "blur(8px)"
170
+ },
171
+ toggleFps: {
172
+ fontFamily: "'SF Mono', 'Fira Code', monospace",
173
+ fontSize: 10,
174
+ fontWeight: 700,
175
+ letterSpacing: -0.5
176
+ },
177
+ footer: {
178
+ marginTop: 8,
179
+ color: "#333",
180
+ fontSize: 8,
181
+ textAlign: "center"
182
+ }
183
+ };
184
+ var FLASH_OUTLINE = "2px solid rgba(99, 102, 241, 0.8)";
185
+
186
+ // src/hooks.ts
40
187
  function useAnchorPosition(ref, position = "bottom-left") {
41
188
  const [pos, setPos] = useState({ top: 0, left: 0 });
42
189
  useEffect(() => {
@@ -154,8 +301,12 @@ function useRenderFlash(wrapperRef, open) {
154
301
  mutationCount.current++;
155
302
  if (!wrapperRef.current || mutationCount.current <= 1) return;
156
303
  const el = wrapperRef.current;
157
- el.classList.add(DevProfiler_default.flash);
158
- setTimeout(() => el.classList.remove(DevProfiler_default.flash), 150);
304
+ el.style.outline = FLASH_OUTLINE;
305
+ el.style.outlineOffset = "-2px";
306
+ setTimeout(() => {
307
+ el.style.outline = "";
308
+ el.style.outlineOffset = "";
309
+ }, 150);
159
310
  });
160
311
  observer.observe(wrapperRef.current, { childList: true, subtree: true });
161
312
  return () => observer.disconnect();
@@ -189,7 +340,7 @@ function FrameTimeGraph({ history }) {
189
340
  const w = 140;
190
341
  const h = 32;
191
342
  const barW = Math.max(1, w / HISTORY_SIZE - 0.5);
192
- return /* @__PURE__ */ jsx("div", { className: DevProfiler_default.graphWrap, children: /* @__PURE__ */ jsxs("svg", { width: w, height: h, style: { display: "block" }, children: [
343
+ return /* @__PURE__ */ jsx("div", { style: s.graphWrap, children: /* @__PURE__ */ jsxs("svg", { width: w, height: h, style: { display: "block" }, children: [
193
344
  /* @__PURE__ */ jsx("rect", { width: w, height: h, rx: 3, fill: "#111" }),
194
345
  /* @__PURE__ */ jsx(
195
346
  "line",
@@ -222,16 +373,17 @@ function FrameTimeGraph({ history }) {
222
373
  ] }) });
223
374
  }
224
375
  function StatRow({ label, value, sub, color = "#4ade80" }) {
225
- return /* @__PURE__ */ jsxs("div", { className: DevProfiler_default.row, children: [
226
- /* @__PURE__ */ jsx("span", { className: DevProfiler_default.rowLabel, children: label }),
376
+ return /* @__PURE__ */ jsxs("div", { style: s.row, children: [
377
+ /* @__PURE__ */ jsx("span", { style: s.rowLabel, children: label }),
227
378
  /* @__PURE__ */ jsxs("span", { children: [
228
- /* @__PURE__ */ jsx("span", { className: DevProfiler_default.rowValue, style: { color }, children: value }),
379
+ /* @__PURE__ */ jsx("span", { style: { ...s.rowValue, color }, children: value }),
229
380
  sub && /* @__PURE__ */ jsx("span", { style: { color: "#444", fontSize: 9, marginLeft: 4 }, children: sub })
230
381
  ] })
231
382
  ] });
232
383
  }
233
384
  function getPanelStyle(pos, offset, position) {
234
385
  const style = {
386
+ ...s.panel,
235
387
  transform: `translate(${offset.x}px, ${offset.y}px)`
236
388
  };
237
389
  if (position.startsWith("bottom")) {
@@ -343,23 +495,24 @@ function DevStatsPanel({
343
495
  const fps = stats.frameTime > 0 ? Math.round(1e3 / stats.frameTime) : 0;
344
496
  const memoGain = stats.profiler.baseDuration > 0 ? Math.round((1 - stats.profiler.actualDuration / stats.profiler.baseDuration) * 100) : 0;
345
497
  const p99Color = stats.frameTimeP99 > 33 ? "#ef4444" : stats.frameTimeP99 > 16.67 ? "#f59e0b" : "#4ade80";
498
+ const exportStyle = exported ? { ...s.iconBtn, ...s.iconBtnActive } : s.iconBtn;
346
499
  return createPortal(
347
- /* @__PURE__ */ jsxs("div", { className: DevProfiler_default.panel, style: getPanelStyle(pos, offset, position), children: [
500
+ /* @__PURE__ */ jsxs("div", { style: getPanelStyle(pos, offset, position), children: [
348
501
  /* @__PURE__ */ jsxs(
349
502
  "div",
350
503
  {
351
- className: DevProfiler_default.panelHeader,
504
+ style: s.panelHeader,
352
505
  ...dragHandlers,
353
506
  children: [
354
- /* @__PURE__ */ jsxs("span", { className: DevProfiler_default.panelTitle, children: [
507
+ /* @__PURE__ */ jsxs("span", { style: s.panelTitle, children: [
355
508
  "Dev Profiler",
356
- instanceCount > 1 && instanceId && /* @__PURE__ */ jsx("span", { className: DevProfiler_default.instanceBadge, children: instanceId })
509
+ instanceCount > 1 && instanceId && /* @__PURE__ */ jsx("span", { style: s.instanceBadge, children: instanceId })
357
510
  ] }),
358
- /* @__PURE__ */ jsxs("div", { className: DevProfiler_default.headerActions, children: [
511
+ /* @__PURE__ */ jsxs("div", { style: s.headerActions, children: [
359
512
  /* @__PURE__ */ jsx(
360
513
  "button",
361
514
  {
362
- className: `${DevProfiler_default.exportBtn} ${exported ? DevProfiler_default.exportBtnActive : ""}`,
515
+ style: exportStyle,
363
516
  onClick: handleExport,
364
517
  title: exported ? "Copied!" : "Copy stats to clipboard",
365
518
  children: exported ? /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z" }) }) : /* @__PURE__ */ jsxs("svg", { width: "10", height: "10", viewBox: "0 0 16 16", fill: "currentColor", children: [
@@ -368,17 +521,17 @@ function DevStatsPanel({
368
521
  ] })
369
522
  }
370
523
  ),
371
- /* @__PURE__ */ jsx("button", { className: DevProfiler_default.resetBtn, onClick: handleReset, title: "Reset counters", children: /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M14 1a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h1.6A6 6 0 0 0 2.07 7.5a1 1 0 1 1-1.97-.36A8 8 0 0 1 13 3.35V2a1 1 0 0 1 1-1zM2 15a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1h4a1 1 0 0 1 0 2H4.4A6 6 0 0 0 13.93 8.5a1 1 0 1 1 1.97.36A8 8 0 0 1 3 12.65V14a1 1 0 0 1-1 1z" }) }) }),
372
- /* @__PURE__ */ jsx("button", { className: DevProfiler_default.closeBtn, onClick: onClose, children: "\u2715" })
524
+ /* @__PURE__ */ jsx("button", { style: s.iconBtn, onClick: handleReset, title: "Reset counters", children: /* @__PURE__ */ jsx("svg", { width: "10", height: "10", viewBox: "0 0 16 16", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M14 1a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h1.6A6 6 0 0 0 2.07 7.5a1 1 0 1 1-1.97-.36A8 8 0 0 1 13 3.35V2a1 1 0 0 1 1-1zM2 15a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1h4a1 1 0 0 1 0 2H4.4A6 6 0 0 0 13.93 8.5a1 1 0 1 1 1.97.36A8 8 0 0 1 3 12.65V14a1 1 0 0 1-1 1z" }) }) }),
525
+ /* @__PURE__ */ jsx("button", { style: s.closeBtn, onClick: onClose, children: "\u2715" })
373
526
  ] })
374
527
  ]
375
528
  }
376
529
  ),
377
- /* @__PURE__ */ jsxs("div", { className: DevProfiler_default.body, children: [
378
- /* @__PURE__ */ jsx("span", { className: DevProfiler_default.section, children: "Rendering" }),
530
+ /* @__PURE__ */ jsxs("div", { style: s.body, children: [
531
+ /* @__PURE__ */ jsx("span", { style: s.section, children: "Rendering" }),
379
532
  /* @__PURE__ */ jsx(StatRow, { label: "Frame time", value: `${stats.frameTime.toFixed(1)}ms`, sub: `${fps} fps`, color: ftColor }),
380
533
  /* @__PURE__ */ jsx(FrameTimeGraph, { history: stats.frameTimeHistory }),
381
- /* @__PURE__ */ jsxs("div", { className: DevProfiler_default.miniRow, children: [
534
+ /* @__PURE__ */ jsxs("div", { style: s.miniRow, children: [
382
535
  /* @__PURE__ */ jsxs("span", { children: [
383
536
  "min ",
384
537
  stats.frameTimeMin.toFixed(1)
@@ -394,23 +547,23 @@ function DevStatsPanel({
394
547
  ] }),
395
548
  /* @__PURE__ */ jsx(StatRow, { label: "Renders/s", value: String(stats.rendersPerSecond), color: rpsColor }),
396
549
  /* @__PURE__ */ jsx(StatRow, { label: "Long tasks", value: String(stats.longTasks), color: stats.longTasks > 0 ? "#f59e0b" : "#4ade80" }),
397
- /* @__PURE__ */ jsx("div", { className: DevProfiler_default.separator }),
398
- /* @__PURE__ */ jsx("span", { className: DevProfiler_default.section, children: "React Profiler" }),
550
+ /* @__PURE__ */ jsx("div", { style: s.separator }),
551
+ /* @__PURE__ */ jsx("span", { style: s.section, children: "React Profiler" }),
399
552
  /* @__PURE__ */ jsx(StatRow, { label: "Phase", value: stats.profiler.phase, color: "#888" }),
400
553
  /* @__PURE__ */ jsx(StatRow, { label: "Render", value: `${stats.profiler.actualDuration.toFixed(2)}ms`, color: actualColor }),
401
554
  /* @__PURE__ */ jsx(StatRow, { label: "Base (no memo)", value: `${stats.profiler.baseDuration.toFixed(2)}ms`, color: "#888" }),
402
555
  /* @__PURE__ */ jsx(StatRow, { label: "Memo gain", value: `${memoGain}%`, color: memoGain > 50 ? "#4ade80" : memoGain > 20 ? "#f59e0b" : "#ef4444" }),
403
556
  /* @__PURE__ */ jsx(StatRow, { label: "Commits", value: String(stats.profiler.commitCount) }),
404
- /* @__PURE__ */ jsx("div", { className: DevProfiler_default.separator }),
405
- /* @__PURE__ */ jsx("span", { className: DevProfiler_default.section, children: "DOM" }),
557
+ /* @__PURE__ */ jsx("div", { style: s.separator }),
558
+ /* @__PURE__ */ jsx("span", { style: s.section, children: "DOM" }),
406
559
  /* @__PURE__ */ jsx(StatRow, { label: "Nodes", value: stats.domNodes.toLocaleString() }),
407
560
  /* @__PURE__ */ jsx(StatRow, { label: "Mutations", value: String(stats.domMutations) }),
408
561
  /* @__PURE__ */ jsx(StatRow, { label: "Size", value: stats.dimensions, color: "#888" }),
409
- /* @__PURE__ */ jsx("div", { className: DevProfiler_default.separator }),
410
- /* @__PURE__ */ jsx("span", { className: DevProfiler_default.section, children: "Memory" }),
562
+ /* @__PURE__ */ jsx("div", { style: s.separator }),
563
+ /* @__PURE__ */ jsx("span", { style: s.section, children: "Memory" }),
411
564
  /* @__PURE__ */ jsx(StatRow, { label: "JS Heap", value: stats.memory > 0 ? `${stats.memory} MB` : "N/A" })
412
565
  ] }),
413
- /* @__PURE__ */ jsx("div", { className: DevProfiler_default.footer, children: "Ctrl+I to toggle" })
566
+ /* @__PURE__ */ jsx("div", { style: s.footer, children: "Ctrl+I to toggle" })
414
567
  ] }),
415
568
  document.body
416
569
  );
@@ -421,7 +574,7 @@ import { useState as useState3, useEffect as useEffect3, useRef as useRef3 } fro
421
574
  import { createPortal as createPortal2 } from "react-dom";
422
575
  import { jsx as jsx2 } from "react/jsx-runtime";
423
576
  function getButtonStyle(pos, position) {
424
- const style = {};
577
+ const style = { ...s.toggleBtn };
425
578
  if (position.startsWith("bottom")) {
426
579
  style.bottom = window.innerHeight - pos.top + 8;
427
580
  } else {
@@ -465,11 +618,10 @@ function ToggleButton({
465
618
  /* @__PURE__ */ jsx2(
466
619
  "button",
467
620
  {
468
- className: DevProfiler_default.toggleBtn,
469
621
  onClick,
470
622
  title: "Dev Profiler (Ctrl+I)",
471
623
  style: getButtonStyle(pos, position),
472
- children: /* @__PURE__ */ jsx2("span", { className: DevProfiler_default.toggleFps, style: { color: fpsColor }, children: fps })
624
+ children: /* @__PURE__ */ jsx2("span", { style: { ...s.toggleFps, color: fpsColor }, children: fps })
473
625
  }
474
626
  ),
475
627
  document.body
@@ -532,7 +684,7 @@ function DevProfiler({
532
684
  return () => window.removeEventListener(TOGGLE_EVENT, handler);
533
685
  }, []);
534
686
  if (!__DEV__) return /* @__PURE__ */ jsx3(Fragment, { children });
535
- return /* @__PURE__ */ jsxs2("div", { ref: wrapperRef, className: DevProfiler_default.wrapper, children: [
687
+ return /* @__PURE__ */ jsxs2("div", { ref: wrapperRef, style: { display: "contents" }, children: [
536
688
  /* @__PURE__ */ jsx3(Profiler, { id: "DevProfiler", onRender, children }),
537
689
  !open && /* @__PURE__ */ jsx3(ToggleButton, { targetRef: wrapperRef, onClick: toggle, position }),
538
690
  open && /* @__PURE__ */ jsx3(
@@ -567,6 +719,12 @@ export {
567
719
  * @author Frederic Denis (billywild87) — https://github.com/billywild87
568
720
  * @license MIT
569
721
  */
722
+ /**
723
+ * @module react-dev-profiler
724
+ * @description Inline styles for the profiler UI — no external CSS needed.
725
+ * @author Frederic Denis (billywild87) — https://github.com/billywild87
726
+ * @license MIT
727
+ */
570
728
  /**
571
729
  * @module react-dev-profiler
572
730
  * @description Custom hooks that power the profiler's data collection.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/DevProfiler.tsx","../src/DevProfiler.module.css","../src/types.ts","../src/env.ts","../src/hooks.ts","../src/DevStatsPanel.tsx","../src/ToggleButton.tsx"],"sourcesContent":["/**\n * @module react-dev-profiler\n * @description Main wrapper component — wraps your app and enables profiling.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\nimport { Profiler, useRef, useState, useEffect, useCallback, type ReactNode } from 'react'\nimport styles from './DevProfiler.module.css'\nimport { type ReactProfilerData, type PanelPosition, INITIAL_PROFILER } from './types'\nimport { __DEV__ } from './env'\nimport { useDomTracker, useRenderRate, useRenderFlash, useLongTasks } from './hooks'\nimport { DevStatsPanel } from './DevStatsPanel'\nimport { ToggleButton } from './ToggleButton'\n\n/*\n * Global keyboard shortcut: Ctrl+I (or Cmd+I) to toggle the profiler.\n * Registered once and kept alive across HMR reloads via a window flag.\n */\nconst TOGGLE_EVENT = 'devprofiler:toggle'\nconst BOUND_KEY = '__devprofiler_bound'\n\nif (typeof window !== 'undefined' && __DEV__ && !(window as any)[BOUND_KEY]) {\n (window as any)[BOUND_KEY] = true\n window.addEventListener('keydown', (e) => {\n if ((e.ctrlKey || e.metaKey) && e.key === 'i') {\n e.preventDefault()\n window.dispatchEvent(new CustomEvent(TOGGLE_EVENT))\n }\n })\n}\n\n/* Module-level registry to track active profiler instances. */\nlet instanceCounter = 0\nconst activeInstances = new Set<string>()\n\n/**\n * Wrap your application (or any subtree) with `<DevProfiler>` to enable\n * real-time performance monitoring during development.\n *\n * In production builds the profiler is completely stripped — children\n * are rendered as-is with zero overhead.\n *\n * @example\n * ```tsx\n * import { DevProfiler } from 'react-dev-profiler'\n *\n * function App() {\n * return (\n * <DevProfiler>\n * <YourApp />\n * </DevProfiler>\n * )\n * }\n * ```\n */\nexport function DevProfiler({\n children,\n position = 'bottom-left',\n id,\n}: {\n children: ReactNode\n /** Where to anchor the panel. @default 'bottom-left' */\n position?: PanelPosition\n /** Optional identifier — shown in the panel when multiple instances are active. */\n id?: string\n}) {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const [open, setOpen] = useState(false)\n const toggle = useCallback(() => setOpen(prev => !prev), [])\n\n // Generate a stable instance ID (user-provided or auto-incremented).\n const instanceId = useRef(id ?? `profiler-${++instanceCounter}`).current\n\n useEffect(() => {\n activeInstances.add(instanceId)\n return () => { activeInstances.delete(instanceId) }\n }, [instanceId])\n\n const domTracker = useDomTracker(wrapperRef, open)\n const renderRate = useRenderRate()\n const longTasks = useLongTasks(open)\n useRenderFlash(wrapperRef, open)\n\n const profilerData = useRef<ReactProfilerData>({ ...INITIAL_PROFILER })\n const onRender = useCallback((_id: string, phase: string, actualDuration: number, baseDuration: number) => {\n profilerData.current = {\n phase,\n actualDuration,\n baseDuration,\n commitCount: profilerData.current.commitCount + 1,\n }\n renderRate.tick()\n }, [renderRate])\n\n const handleReset = useCallback(() => {\n domTracker.reset()\n renderRate.reset()\n longTasks.reset()\n profilerData.current = { ...INITIAL_PROFILER }\n }, [domTracker, renderRate, longTasks])\n\n useEffect(() => {\n const handler = () => setOpen(prev => !prev)\n window.addEventListener(TOGGLE_EVENT, handler)\n return () => window.removeEventListener(TOGGLE_EVENT, handler)\n }, [])\n\n if (!__DEV__) return <>{children}</>\n\n return (\n <div ref={wrapperRef} className={styles.wrapper}>\n <Profiler id=\"DevProfiler\" onRender={onRender}>\n {children}\n </Profiler>\n {!open && <ToggleButton targetRef={wrapperRef} onClick={toggle} position={position} />}\n {open && (\n <DevStatsPanel\n targetRef={wrapperRef}\n domTracker={domTracker}\n renderRate={renderRate}\n longTasks={longTasks}\n profilerData={profilerData}\n onClose={toggle}\n onReset={handleReset}\n position={position}\n instanceId={instanceId}\n instanceCount={activeInstances.size}\n />\n )}\n </div>\n )\n}\n","/**\n * react-dev-profiler — Styles\n * Dark, minimal overlay theme with glassmorphism.\n * Author: Frederic Denis (billywild87)\n */\n\n/* Wrapper — takes up the full space of the profiled subtree */\n.wrapper {\n height: 100%;\n width: 100%;\n}\n\n/* Panel — floating overlay anchored near the profiled element */\n.panel {\n position: fixed;\n z-index: 99999;\n background: rgba(8, 8, 8, 0.95);\n border: 1px solid #222;\n border-radius: 10px;\n padding: 10px 14px;\n min-width: 220px;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);\n font-family: 'SF Mono', 'Fira Code', monospace;\n backdrop-filter: blur(12px);\n user-select: none;\n}\n\n/* Draggable header */\n.panelHeader {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 8px;\n cursor: grab;\n touch-action: none;\n}\n\n.panelHeader:active {\n cursor: grabbing;\n}\n\n.panelTitle {\n color: #666;\n font-size: 9px;\n font-weight: 700;\n letter-spacing: 1.5px;\n text-transform: uppercase;\n display: flex;\n align-items: center;\n gap: 6px;\n}\n\n.instanceBadge {\n background: #222;\n color: #888;\n font-size: 8px;\n padding: 1px 5px;\n border-radius: 4px;\n letter-spacing: 0.5px;\n text-transform: none;\n}\n\n.headerActions {\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n/* Export button */\n.exportBtn {\n background: none;\n border: none;\n color: #444;\n cursor: pointer;\n padding: 0;\n line-height: 1;\n display: flex;\n align-items: center;\n transition: color 0.15s;\n}\n\n.exportBtn:hover {\n color: #4ade80;\n}\n\n.exportBtnActive {\n color: #4ade80;\n}\n\n/* Reset button */\n.resetBtn {\n background: none;\n border: none;\n color: #444;\n cursor: pointer;\n padding: 0;\n line-height: 1;\n display: flex;\n align-items: center;\n}\n\n.resetBtn:hover {\n color: #4ade80;\n}\n\n.closeBtn {\n background: none;\n border: none;\n color: #444;\n cursor: pointer;\n font-size: 13px;\n padding: 0;\n line-height: 1;\n}\n\n.closeBtn:hover {\n color: #888;\n}\n\n.body {\n display: flex;\n flex-direction: column;\n gap: 5px;\n}\n\n/* Stat rows */\n.section {\n color: #444;\n font-size: 8px;\n font-weight: 600;\n letter-spacing: 1px;\n text-transform: uppercase;\n margin-top: 2px;\n}\n\n.separator {\n height: 1px;\n background: #1a1a1a;\n margin: 2px 0;\n}\n\n.row {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1px 0;\n}\n\n.rowLabel {\n color: #555;\n font-size: 10px;\n}\n\n.rowValue {\n font-size: 11px;\n font-weight: 600;\n}\n\n.miniRow {\n display: flex;\n justify-content: space-between;\n color: #444;\n font-size: 9px;\n margin-top: -2px;\n margin-bottom: 2px;\n}\n\n/* Frame time graph */\n.graphWrap {\n margin-top: 4px;\n}\n\n/* Toggle button — small floating FPS pill */\n.toggleBtn {\n position: fixed;\n z-index: 99998;\n min-width: 28px;\n height: 24px;\n border-radius: 7px;\n border: 1px solid #2a2a2a;\n background: rgba(20, 20, 20, 0.9);\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0 6px;\n backdrop-filter: blur(8px);\n}\n\n.toggleBtn:hover {\n border-color: #333;\n}\n\n.toggleFps {\n font-family: 'SF Mono', 'Fira Code', monospace;\n font-size: 10px;\n font-weight: 700;\n letter-spacing: -0.5px;\n}\n\n/* Footer hint */\n.footer {\n margin-top: 8px;\n color: #333;\n font-size: 8px;\n text-align: center;\n}\n\n/* DOM mutation flash — brief outline pulse */\n.flash {\n outline: 2px solid rgba(99, 102, 241, 0.8);\n outline-offset: -2px;\n}\n","/**\n * @module react-dev-profiler\n * @description Type definitions and constants for the profiler.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\n/** Data captured from React's built-in <Profiler> callback. */\nexport type ReactProfilerData = {\n phase: string\n actualDuration: number\n baseDuration: number\n commitCount: number\n}\n\n/** Aggregated stats displayed in the profiler panel. */\nexport type DevStats = {\n domMutations: number\n domNodes: number\n frameTime: number\n frameTimeMin: number\n frameTimeMax: number\n frameTimeP99: number\n frameTimeHistory: number[]\n longTasks: number\n rendersPerSecond: number\n memory: number\n dimensions: string\n profiler: ReactProfilerData\n}\n\n/** Where the panel anchors relative to the profiled element. */\nexport type PanelPosition = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'\n\n/** How many frames we keep in the rolling history graph. */\nexport const HISTORY_SIZE = 60\n\nexport const INITIAL_PROFILER: ReactProfilerData = {\n phase: 'mount',\n actualDuration: 0,\n baseDuration: 0,\n commitCount: 0,\n}\n\nexport const INITIAL_STATS: DevStats = {\n domMutations: 0,\n domNodes: 0,\n frameTime: 0,\n frameTimeMin: 0,\n frameTimeMax: 0,\n frameTimeP99: 0,\n frameTimeHistory: [],\n longTasks: 0,\n rendersPerSecond: 0,\n memory: 0,\n dimensions: '–',\n profiler: INITIAL_PROFILER,\n}\n\n/** Returns the value at a given percentile from a pre-sorted array. */\nexport function percentile(sorted: number[], p: number): number {\n if (sorted.length === 0) return 0\n const idx = Math.ceil((p / 100) * sorted.length) - 1\n return sorted[Math.max(0, idx)]\n}\n","/**\n * @module react-dev-profiler\n * @description Environment detection — works with Vite, webpack, Next.js, and any bundler.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\n/**\n * True when running in a development environment.\n * Relies on `process.env.NODE_ENV` which all major bundlers replace at build time,\n * enabling dead-code elimination in production.\n */\nexport const __DEV__: boolean =\n typeof process !== 'undefined'\n ? process.env.NODE_ENV !== 'production'\n : true\n","/**\n * @module react-dev-profiler\n * @description Custom hooks that power the profiler's data collection.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\nimport { useState, useEffect, useCallback, useRef } from 'react'\nimport styles from './DevProfiler.module.css'\nimport type { PanelPosition } from './types'\n\n/**\n * Tracks a corner position of a referenced element using ResizeObserver.\n * Used to anchor the panel and toggle button near the profiled component.\n */\nexport function useAnchorPosition(\n ref: React.RefObject<HTMLDivElement | null>,\n position: PanelPosition = 'bottom-left'\n) {\n const [pos, setPos] = useState({ top: 0, left: 0 })\n\n useEffect(() => {\n if (!ref.current) return\n const update = () => {\n if (!ref.current) return\n const rect = ref.current.getBoundingClientRect()\n const margin = 8\n switch (position) {\n case 'top-left':\n setPos({ top: rect.top + margin, left: rect.left + margin }); break\n case 'top-right':\n setPos({ top: rect.top + margin, left: rect.right - margin }); break\n case 'bottom-right':\n setPos({ top: rect.bottom - margin, left: rect.right - margin }); break\n case 'bottom-left':\n default:\n setPos({ top: rect.bottom - margin, left: rect.left + margin }); break\n }\n }\n const observer = new ResizeObserver(update)\n observer.observe(ref.current)\n observer.observe(document.documentElement)\n return () => observer.disconnect()\n }, [ref, position])\n\n return pos\n}\n\n/**\n * Makes an element draggable via Pointer Events.\n * Returns an offset to apply as CSS transform and event handlers for the drag handle.\n */\nexport function useDraggable() {\n const [offset, setOffset] = useState({ x: 0, y: 0 })\n const dragging = useRef(false)\n const start = useRef({ x: 0, y: 0 })\n\n const onPointerDown = useCallback((e: React.PointerEvent) => {\n dragging.current = true\n start.current = { x: e.clientX - offset.x, y: e.clientY - offset.y }\n ;(e.target as HTMLElement).setPointerCapture(e.pointerId)\n }, [offset])\n\n const onPointerMove = useCallback((e: React.PointerEvent) => {\n if (!dragging.current) return\n setOffset({\n x: e.clientX - start.current.x,\n y: e.clientY - start.current.y,\n })\n }, [])\n\n const onPointerUp = useCallback(() => {\n dragging.current = false\n }, [])\n\n return { offset, handlers: { onPointerDown, onPointerMove, onPointerUp } }\n}\n\n/**\n * Counts real DOM mutations via MutationObserver (ignoring class-only changes).\n * The node count is cached and only recalculated when the DOM actually changes,\n * so we don't pay the cost of querySelectorAll('*') every frame.\n */\nexport function useDomTracker(wrapperRef: React.RefObject<HTMLDivElement | null>, enabled: boolean) {\n const mutations = useRef(0)\n const nodeCount = useRef(0)\n const dirty = useRef(true)\n\n useEffect(() => {\n if (!enabled || !wrapperRef.current) return\n const observer = new MutationObserver((records) => {\n let realMutation = false\n for (const record of records) {\n if (record.type === 'attributes' && record.attributeName === 'class') continue\n realMutation = true\n }\n if (realMutation) {\n mutations.current++\n dirty.current = true\n }\n })\n observer.observe(wrapperRef.current, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['style'],\n })\n return () => observer.disconnect()\n }, [wrapperRef, enabled])\n\n const getNodeCount = useCallback(() => {\n if (dirty.current && wrapperRef.current) {\n nodeCount.current = wrapperRef.current.querySelectorAll('*').length\n dirty.current = false\n }\n return nodeCount.current\n }, [wrapperRef])\n\n const reset = useCallback(() => {\n mutations.current = 0\n dirty.current = true\n }, [])\n\n return { mutations, getNodeCount, reset }\n}\n\n/**\n * Measures how many React renders happen per second.\n * Call `tick()` from the <Profiler> onRender callback; the hook\n * snapshots the count every second and resets it.\n */\nexport function useRenderRate() {\n const renderCount = useRef(0)\n const rendersPerSecond = useRef(0)\n\n const tick = useCallback(() => {\n renderCount.current++\n }, [])\n\n useEffect(() => {\n const id = setInterval(() => {\n rendersPerSecond.current = renderCount.current\n renderCount.current = 0\n }, 1000)\n return () => clearInterval(id)\n }, [])\n\n const reset = useCallback(() => {\n renderCount.current = 0\n rendersPerSecond.current = 0\n }, [])\n\n return { rendersPerSecond, tick, reset }\n}\n\n/**\n * Flashes a subtle outline on the profiled element whenever the DOM mutates.\n * Skips the very first mutation (the initial mount) to avoid a flash on load.\n */\nexport function useRenderFlash(wrapperRef: React.RefObject<HTMLDivElement | null>, open: boolean) {\n const mutationCount = useRef(0)\n\n useEffect(() => {\n if (!open || !wrapperRef.current) return\n const observer = new MutationObserver(() => {\n mutationCount.current++\n if (!wrapperRef.current || mutationCount.current <= 1) return\n const el = wrapperRef.current\n el.classList.add(styles.flash)\n setTimeout(() => el.classList.remove(styles.flash), 150)\n })\n observer.observe(wrapperRef.current, { childList: true, subtree: true })\n return () => observer.disconnect()\n }, [wrapperRef, open])\n}\n\n/**\n * Detects browser \"long tasks\" (>50 ms) using PerformanceObserver.\n * Falls back silently in browsers that don't support the longtask entry type.\n */\nexport function useLongTasks(enabled: boolean) {\n const count = useRef(0)\n\n useEffect(() => {\n if (!enabled || typeof PerformanceObserver === 'undefined') return\n try {\n const observer = new PerformanceObserver((list) => {\n count.current += list.getEntries().length\n })\n observer.observe({ entryTypes: ['longtask'] })\n return () => observer.disconnect()\n } catch {\n // longtask not supported in this browser\n }\n }, [enabled])\n\n const reset = useCallback(() => { count.current = 0 }, [])\n\n return { count, reset }\n}\n","/**\n * @module react-dev-profiler\n * @description The main stats panel — renders all performance metrics in a floating overlay.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\nimport { useState, useEffect, useCallback, useRef, type CSSProperties } from 'react'\nimport { createPortal } from 'react-dom'\nimport styles from './DevProfiler.module.css'\nimport { useAnchorPosition, useDraggable, useDomTracker, useRenderRate, useLongTasks } from './hooks'\nimport { type ReactProfilerData, type PanelPosition, type DevStats, HISTORY_SIZE, INITIAL_STATS, percentile } from './types'\n\n/** Rolling bar chart of frame times (last 60 samples). */\nfunction FrameTimeGraph({ history }: { history: number[] }) {\n const max = Math.max(33, ...history)\n const w = 140\n const h = 32\n const barW = Math.max(1, w / HISTORY_SIZE - 0.5)\n\n return (\n <div className={styles.graphWrap}>\n <svg width={w} height={h} style={{ display: 'block' }}>\n <rect width={w} height={h} rx={3} fill=\"#111\" />\n {/* 60 fps guideline */}\n <line x1={0} y1={h - (16.67 / max) * h} x2={w} y2={h - (16.67 / max) * h}\n stroke=\"#1a3a1a\" strokeWidth={1} />\n {/* 30 fps guideline */}\n <line x1={0} y1={h - (33 / max) * h} x2={w} y2={h - (33 / max) * h}\n stroke=\"#3a1a1a\" strokeWidth={1} />\n {history.map((ms, i) => {\n const x = (i / HISTORY_SIZE) * w\n const barH = Math.min((ms / max) * h, h)\n const color = ms > 33 ? '#ef4444' : ms > 16.67 ? '#f59e0b' : '#4ade80'\n return <rect key={i} x={x} y={h - barH} width={barW} height={barH} fill={color} opacity={0.8} rx={0.5} />\n })}\n </svg>\n </div>\n )\n}\n\n/** Single label → value row used throughout the panel. */\nfunction StatRow({ label, value, sub, color = '#4ade80' }: { label: string, value: string, sub?: string, color?: string }) {\n return (\n <div className={styles.row}>\n <span className={styles.rowLabel}>{label}</span>\n <span>\n <span className={styles.rowValue} style={{ color }}>{value}</span>\n {sub && <span style={{ color: '#444', fontSize: 9, marginLeft: 4 }}>{sub}</span>}\n </span>\n </div>\n )\n}\n\n/** Computes fixed-position styles based on the chosen panel position + drag offset. */\nfunction getPanelStyle(\n pos: { top: number; left: number },\n offset: { x: number; y: number },\n position: PanelPosition,\n): CSSProperties {\n const style: CSSProperties = {\n transform: `translate(${offset.x}px, ${offset.y}px)`,\n }\n if (position.startsWith('bottom')) {\n style.bottom = window.innerHeight - pos.top\n } else {\n style.top = pos.top\n }\n if (position.endsWith('right')) {\n style.right = window.innerWidth - pos.left\n } else {\n style.left = pos.left\n }\n return style\n}\n\n/** Floating stats panel portaled to document.body. */\nexport function DevStatsPanel({\n targetRef,\n domTracker,\n renderRate,\n longTasks,\n profilerData,\n onClose,\n onReset,\n position = 'bottom-left',\n instanceId,\n instanceCount = 1,\n}: {\n targetRef: React.RefObject<HTMLDivElement | null>\n domTracker: ReturnType<typeof useDomTracker>\n renderRate: ReturnType<typeof useRenderRate>\n longTasks: ReturnType<typeof useLongTasks>\n profilerData: React.RefObject<ReactProfilerData>\n onClose: () => void\n onReset: () => void\n position?: PanelPosition\n instanceId?: string\n instanceCount?: number\n}) {\n const [stats, setStats] = useState<DevStats>(INITIAL_STATS)\n const [exported, setExported] = useState(false)\n const lastFrame = useRef(performance.now())\n const frameTimeHistory = useRef<number[]>([])\n const allFrameTimes = useRef<number[]>([])\n const pos = useAnchorPosition(targetRef, position)\n const { offset, handlers: dragHandlers } = useDraggable()\n\n // Collects frame timing data every rAF, then snapshots stats once per second.\n useEffect(() => {\n let animId: number\n let frameCount = 0\n let frameTotalMs = 0\n let lastSecond = performance.now()\n\n const tick = () => {\n const now = performance.now()\n const delta = now - lastFrame.current\n lastFrame.current = now\n frameCount++\n frameTotalMs += delta\n\n if (now - lastSecond >= 1000) {\n const avgFrameTime = frameTotalMs / frameCount\n\n const hist = frameTimeHistory.current\n if (hist.length >= HISTORY_SIZE) hist.shift()\n hist.push(avgFrameTime)\n\n allFrameTimes.current.push(avgFrameTime)\n const sorted = [...allFrameTimes.current].sort((a, b) => a - b)\n\n const el = targetRef.current\n const dims = el ? `${el.offsetWidth} x ${el.offsetHeight}` : '–'\n\n // Chrome-only: performance.memory exposes JS heap usage\n const perf = performance as any\n const mem = perf.memory ? Math.round(perf.memory.usedJSHeapSize / 1024 / 1024) : 0\n\n setStats({\n domMutations: domTracker.mutations.current,\n domNodes: domTracker.getNodeCount(),\n frameTime: avgFrameTime,\n frameTimeMin: sorted[0] ?? 0,\n frameTimeMax: sorted[sorted.length - 1] ?? 0,\n frameTimeP99: percentile(sorted, 99),\n frameTimeHistory: [...hist],\n longTasks: longTasks.count.current,\n rendersPerSecond: renderRate.rendersPerSecond.current,\n memory: mem,\n dimensions: dims,\n profiler: { ...profilerData.current },\n })\n\n frameCount = 0\n frameTotalMs = 0\n lastSecond = now\n }\n animId = requestAnimationFrame(tick)\n }\n animId = requestAnimationFrame(tick)\n return () => cancelAnimationFrame(animId)\n }, [targetRef, domTracker, renderRate, longTasks])\n\n const handleReset = useCallback(() => {\n frameTimeHistory.current = []\n allFrameTimes.current = []\n setStats(INITIAL_STATS)\n onReset()\n }, [onReset])\n\n // Copy current stats as JSON to clipboard.\n const handleExport = useCallback(() => {\n const payload = { timestamp: new Date().toISOString(), ...stats }\n const json = JSON.stringify(payload, null, 2)\n try {\n navigator.clipboard.writeText(json).then(() => {\n setExported(true)\n setTimeout(() => setExported(false), 1200)\n })\n } catch {\n // Fallback for non-secure contexts\n const ta = document.createElement('textarea')\n ta.value = json\n ta.style.position = 'fixed'\n ta.style.opacity = '0'\n document.body.appendChild(ta)\n ta.select()\n document.execCommand('copy')\n document.body.removeChild(ta)\n setExported(true)\n setTimeout(() => setExported(false), 1200)\n }\n }, [stats])\n\n // Color thresholds: green = good, amber = warning, red = bad\n const ftColor = stats.frameTime > 33 ? '#ef4444' : stats.frameTime > 16.67 ? '#f59e0b' : '#4ade80'\n const rpsColor = stats.rendersPerSecond > 30 ? '#ef4444' : stats.rendersPerSecond > 10 ? '#f59e0b' : '#4ade80'\n const actualColor = stats.profiler.actualDuration > 16 ? '#ef4444' : stats.profiler.actualDuration > 8 ? '#f59e0b' : '#4ade80'\n const fps = stats.frameTime > 0 ? Math.round(1000 / stats.frameTime) : 0\n const memoGain = stats.profiler.baseDuration > 0\n ? Math.round((1 - stats.profiler.actualDuration / stats.profiler.baseDuration) * 100)\n : 0\n const p99Color = stats.frameTimeP99 > 33 ? '#ef4444' : stats.frameTimeP99 > 16.67 ? '#f59e0b' : '#4ade80'\n\n return createPortal(\n <div className={styles.panel} style={getPanelStyle(pos, offset, position)}>\n <div\n className={styles.panelHeader}\n {...dragHandlers}\n >\n <span className={styles.panelTitle}>\n Dev Profiler\n {instanceCount > 1 && instanceId && (\n <span className={styles.instanceBadge}>{instanceId}</span>\n )}\n </span>\n <div className={styles.headerActions}>\n <button\n className={`${styles.exportBtn} ${exported ? styles.exportBtnActive : ''}`}\n onClick={handleExport}\n title={exported ? 'Copied!' : 'Copy stats to clipboard'}\n >\n {exported ? (\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 16 16\" fill=\"currentColor\">\n <path d=\"M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z\"/>\n </svg>\n ) : (\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 16 16\" fill=\"currentColor\">\n <path d=\"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25z\"/>\n <path d=\"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z\"/>\n </svg>\n )}\n </button>\n <button className={styles.resetBtn} onClick={handleReset} title=\"Reset counters\">\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 16 16\" fill=\"currentColor\">\n <path d=\"M14 1a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h1.6A6 6 0 0 0 2.07 7.5a1 1 0 1 1-1.97-.36A8 8 0 0 1 13 3.35V2a1 1 0 0 1 1-1zM2 15a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1h4a1 1 0 0 1 0 2H4.4A6 6 0 0 0 13.93 8.5a1 1 0 1 1 1.97.36A8 8 0 0 1 3 12.65V14a1 1 0 0 1-1 1z\"/>\n </svg>\n </button>\n <button className={styles.closeBtn} onClick={onClose}>✕</button>\n </div>\n </div>\n\n <div className={styles.body}>\n <span className={styles.section}>Rendering</span>\n <StatRow label=\"Frame time\" value={`${stats.frameTime.toFixed(1)}ms`} sub={`${fps} fps`} color={ftColor} />\n <FrameTimeGraph history={stats.frameTimeHistory} />\n <div className={styles.miniRow}>\n <span>min {stats.frameTimeMin.toFixed(1)}</span>\n <span>max {stats.frameTimeMax.toFixed(1)}</span>\n <span style={{ color: p99Color }}>p99 {stats.frameTimeP99.toFixed(1)}</span>\n </div>\n <StatRow label=\"Renders/s\" value={String(stats.rendersPerSecond)} color={rpsColor} />\n <StatRow label=\"Long tasks\" value={String(stats.longTasks)} color={stats.longTasks > 0 ? '#f59e0b' : '#4ade80'} />\n\n <div className={styles.separator} />\n <span className={styles.section}>React Profiler</span>\n <StatRow label=\"Phase\" value={stats.profiler.phase} color=\"#888\" />\n <StatRow label=\"Render\" value={`${stats.profiler.actualDuration.toFixed(2)}ms`} color={actualColor} />\n <StatRow label=\"Base (no memo)\" value={`${stats.profiler.baseDuration.toFixed(2)}ms`} color=\"#888\" />\n <StatRow label=\"Memo gain\" value={`${memoGain}%`} color={memoGain > 50 ? '#4ade80' : memoGain > 20 ? '#f59e0b' : '#ef4444'} />\n <StatRow label=\"Commits\" value={String(stats.profiler.commitCount)} />\n\n <div className={styles.separator} />\n <span className={styles.section}>DOM</span>\n <StatRow label=\"Nodes\" value={stats.domNodes.toLocaleString()} />\n <StatRow label=\"Mutations\" value={String(stats.domMutations)} />\n <StatRow label=\"Size\" value={stats.dimensions} color=\"#888\" />\n\n <div className={styles.separator} />\n <span className={styles.section}>Memory</span>\n <StatRow label=\"JS Heap\" value={stats.memory > 0 ? `${stats.memory} MB` : 'N/A'} />\n </div>\n\n <div className={styles.footer}>Ctrl+I to toggle</div>\n </div>,\n document.body\n )\n}\n","/**\n * @module react-dev-profiler\n * @description Minimal floating button that shows the current FPS at a glance.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\nimport { useState, useEffect, useRef, type CSSProperties } from 'react'\nimport { createPortal } from 'react-dom'\nimport styles from './DevProfiler.module.css'\nimport { useAnchorPosition } from './hooks'\nimport type { PanelPosition } from './types'\n\n/** Computes fixed-position styles based on the chosen panel position. */\nfunction getButtonStyle(pos: { top: number; left: number }, position: PanelPosition): CSSProperties {\n const style: CSSProperties = {}\n if (position.startsWith('bottom')) {\n style.bottom = window.innerHeight - pos.top + 8\n } else {\n style.top = pos.top + 8\n }\n if (position.endsWith('right')) {\n style.right = window.innerWidth - pos.left\n } else {\n style.left = pos.left\n }\n return style\n}\n\n/** Small floating pill showing live FPS — click to open the full panel. */\nexport function ToggleButton({\n targetRef,\n onClick,\n position = 'bottom-left',\n}: {\n targetRef: React.RefObject<HTMLDivElement | null>\n onClick: () => void\n position?: PanelPosition\n}) {\n const pos = useAnchorPosition(targetRef, position)\n const [fps, setFps] = useState(0)\n const lastFrame = useRef(performance.now())\n\n useEffect(() => {\n let animId: number\n let count = 0\n let lastSecond = performance.now()\n\n const tick = () => {\n const now = performance.now()\n lastFrame.current = now\n count++\n if (now - lastSecond >= 1000) {\n setFps(count)\n count = 0\n lastSecond = now\n }\n animId = requestAnimationFrame(tick)\n }\n animId = requestAnimationFrame(tick)\n return () => cancelAnimationFrame(animId)\n }, [])\n\n const fpsColor = fps < 30 ? '#ef4444' : fps < 55 ? '#f59e0b' : '#4ade80'\n\n return createPortal(\n <button\n className={styles.toggleBtn}\n onClick={onClick}\n title=\"Dev Profiler (Ctrl+I)\"\n style={getButtonStyle(pos, position)}\n >\n <span className={styles.toggleFps} style={{ color: fpsColor }}>{fps}</span>\n </button>,\n document.body\n )\n}\n"],"mappings":";AAOA,SAAS,UAAU,UAAAA,SAAQ,YAAAC,WAAU,aAAAC,YAAW,eAAAC,oBAAmC;;;ACPnF;;;ACmCO,IAAM,eAAe;AAErB,IAAM,mBAAsC;AAAA,EAC/C,OAAO;AAAA,EACP,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,aAAa;AACjB;AAEO,IAAM,gBAA0B;AAAA,EACnC,cAAc;AAAA,EACd,UAAU;AAAA,EACV,WAAW;AAAA,EACX,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,kBAAkB,CAAC;AAAA,EACnB,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,UAAU;AACd;AAGO,SAAS,WAAW,QAAkB,GAAmB;AA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AAe,YAAY,IAAI;AAE/B,QAAM,eAAeH,QAA0B,EAAE,GAAG,iBAAiB,CAAC;AACtE,QAAM,WAAWE,aAAY,CAAC,KAAa,OAAe,gBAAwB,iBAAyB;AACvG,iBAAa,UAAU;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA,aAAa,aAAa,QAAQ,cAAc;AAAA,IACpD;AACA,eAAW,KAAK;AAAA,EACpB,GAAG,CAAC,UAAU,CAAC;AAEf,QAAM,cAAcA,aAAY,MAAM;AAClC,eAAW,MAAM;AACjB,eAAW,MAAM;AACjB,cAAU,MAAM;AAChB,iBAAa,UAAU,EAAE,GAAG,iBAAiB;AAAA,EACjD,GAAG,CAAC,YAAY,YAAY,SAAS,CAAC;AAEtC,EAAAC,WAAU,MAAM;AACZ,UAAM,UAAU,MAAM,QAAQ,UAAQ,CAAC,IAAI;AAC3C,WAAO,iBAAiB,cAAc,OAAO;AAC7C,WAAO,MAAM,OAAO,oBAAoB,cAAc,OAAO;AAAA,EACjE,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC,QAAS,QAAO,gBAAAL,KAAA,YAAG,UAAS;AAEjC,SACI,gBAAAC,MAAC,SAAI,KAAK,YAAY,WAAW,oBAAO,SACpC;AAAA,oBAAAD,KAAC,YAAS,IAAG,eAAc,UACtB,UACL;AAAA,IACC,CAAC,QAAQ,gBAAAA,KAAC,gBAAa,WAAW,YAAY,SAAS,QAAQ,UAAoB;AAAA,IACnF,QACG,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACG,WAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS;AAAA,QACT,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,eAAe,gBAAgB;AAAA;AAAA,IACnC;AAAA,KAER;AAER;","names":["useRef","useState","useEffect","useCallback","useState","useEffect","useCallback","useRef","useState","useRef","useEffect","useCallback","useState","useEffect","useRef","createPortal","jsx","useState","useRef","useEffect","createPortal","jsx","jsxs","useRef","useState","useCallback","useEffect"]}
1
+ {"version":3,"sources":["../src/DevProfiler.tsx","../src/types.ts","../src/env.ts","../src/hooks.ts","../src/styles.ts","../src/DevStatsPanel.tsx","../src/ToggleButton.tsx"],"sourcesContent":["/**\n * @module react-dev-profiler\n * @description Main wrapper component — wraps your app and enables profiling.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\nimport { Profiler, useRef, useState, useEffect, useCallback, type ReactNode } from 'react'\nimport { type ReactProfilerData, type PanelPosition, INITIAL_PROFILER } from './types'\nimport { __DEV__ } from './env'\nimport { useDomTracker, useRenderRate, useRenderFlash, useLongTasks } from './hooks'\nimport { DevStatsPanel } from './DevStatsPanel'\nimport { ToggleButton } from './ToggleButton'\n\n/*\n * Global keyboard shortcut: Ctrl+I (or Cmd+I) to toggle the profiler.\n * Registered once and kept alive across HMR reloads via a window flag.\n */\nconst TOGGLE_EVENT = 'devprofiler:toggle'\nconst BOUND_KEY = '__devprofiler_bound'\n\nif (typeof window !== 'undefined' && __DEV__ && !(window as any)[BOUND_KEY]) {\n (window as any)[BOUND_KEY] = true\n window.addEventListener('keydown', (e) => {\n if ((e.ctrlKey || e.metaKey) && e.key === 'i') {\n e.preventDefault()\n window.dispatchEvent(new CustomEvent(TOGGLE_EVENT))\n }\n })\n}\n\n/* Module-level registry to track active profiler instances. */\nlet instanceCounter = 0\nconst activeInstances = new Set<string>()\n\n/**\n * Wrap your application (or any subtree) with `<DevProfiler>` to enable\n * real-time performance monitoring during development.\n *\n * In production builds the profiler is completely stripped — children\n * are rendered as-is with zero overhead.\n *\n * @example\n * ```tsx\n * import { DevProfiler } from 'react-dev-profiler'\n *\n * function App() {\n * return (\n * <DevProfiler>\n * <YourApp />\n * </DevProfiler>\n * )\n * }\n * ```\n */\nexport function DevProfiler({\n children,\n position = 'bottom-left',\n id,\n}: {\n children: ReactNode\n /** Where to anchor the panel. @default 'bottom-left' */\n position?: PanelPosition\n /** Optional identifier — shown in the panel when multiple instances are active. */\n id?: string\n}) {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const [open, setOpen] = useState(false)\n const toggle = useCallback(() => setOpen(prev => !prev), [])\n\n // Generate a stable instance ID (user-provided or auto-incremented).\n const instanceId = useRef(id ?? `profiler-${++instanceCounter}`).current\n\n useEffect(() => {\n activeInstances.add(instanceId)\n return () => { activeInstances.delete(instanceId) }\n }, [instanceId])\n\n const domTracker = useDomTracker(wrapperRef, open)\n const renderRate = useRenderRate()\n const longTasks = useLongTasks(open)\n useRenderFlash(wrapperRef, open)\n\n const profilerData = useRef<ReactProfilerData>({ ...INITIAL_PROFILER })\n const onRender = useCallback((_id: string, phase: string, actualDuration: number, baseDuration: number) => {\n profilerData.current = {\n phase,\n actualDuration,\n baseDuration,\n commitCount: profilerData.current.commitCount + 1,\n }\n renderRate.tick()\n }, [renderRate])\n\n const handleReset = useCallback(() => {\n domTracker.reset()\n renderRate.reset()\n longTasks.reset()\n profilerData.current = { ...INITIAL_PROFILER }\n }, [domTracker, renderRate, longTasks])\n\n useEffect(() => {\n const handler = () => setOpen(prev => !prev)\n window.addEventListener(TOGGLE_EVENT, handler)\n return () => window.removeEventListener(TOGGLE_EVENT, handler)\n }, [])\n\n if (!__DEV__) return <>{children}</>\n\n return (\n <div ref={wrapperRef} style={{ display: 'contents' }}>\n <Profiler id=\"DevProfiler\" onRender={onRender}>\n {children}\n </Profiler>\n {!open && <ToggleButton targetRef={wrapperRef} onClick={toggle} position={position} />}\n {open && (\n <DevStatsPanel\n targetRef={wrapperRef}\n domTracker={domTracker}\n renderRate={renderRate}\n longTasks={longTasks}\n profilerData={profilerData}\n onClose={toggle}\n onReset={handleReset}\n position={position}\n instanceId={instanceId}\n instanceCount={activeInstances.size}\n />\n )}\n </div>\n )\n}\n","/**\n * @module react-dev-profiler\n * @description Type definitions and constants for the profiler.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\n/** Data captured from React's built-in <Profiler> callback. */\nexport type ReactProfilerData = {\n phase: string\n actualDuration: number\n baseDuration: number\n commitCount: number\n}\n\n/** Aggregated stats displayed in the profiler panel. */\nexport type DevStats = {\n domMutations: number\n domNodes: number\n frameTime: number\n frameTimeMin: number\n frameTimeMax: number\n frameTimeP99: number\n frameTimeHistory: number[]\n longTasks: number\n rendersPerSecond: number\n memory: number\n dimensions: string\n profiler: ReactProfilerData\n}\n\n/** Where the panel anchors relative to the profiled element. */\nexport type PanelPosition = 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right'\n\n/** How many frames we keep in the rolling history graph. */\nexport const HISTORY_SIZE = 60\n\nexport const INITIAL_PROFILER: ReactProfilerData = {\n phase: 'mount',\n actualDuration: 0,\n baseDuration: 0,\n commitCount: 0,\n}\n\nexport const INITIAL_STATS: DevStats = {\n domMutations: 0,\n domNodes: 0,\n frameTime: 0,\n frameTimeMin: 0,\n frameTimeMax: 0,\n frameTimeP99: 0,\n frameTimeHistory: [],\n longTasks: 0,\n rendersPerSecond: 0,\n memory: 0,\n dimensions: '–',\n profiler: INITIAL_PROFILER,\n}\n\n/** Returns the value at a given percentile from a pre-sorted array. */\nexport function percentile(sorted: number[], p: number): number {\n if (sorted.length === 0) return 0\n const idx = Math.ceil((p / 100) * sorted.length) - 1\n return sorted[Math.max(0, idx)]\n}\n","/**\n * @module react-dev-profiler\n * @description Environment detection — works with Vite, webpack, Next.js, and any bundler.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\n/**\n * True when running in a development environment.\n * Relies on `process.env.NODE_ENV` which all major bundlers replace at build time,\n * enabling dead-code elimination in production.\n */\nexport const __DEV__: boolean =\n typeof process !== 'undefined'\n ? process.env.NODE_ENV !== 'production'\n : true\n","/**\n * @module react-dev-profiler\n * @description Custom hooks that power the profiler's data collection.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\nimport { useState, useEffect, useCallback, useRef } from 'react'\nimport { FLASH_OUTLINE } from './styles'\nimport type { PanelPosition } from './types'\n\n/**\n * Tracks a corner position of a referenced element using ResizeObserver.\n * Used to anchor the panel and toggle button near the profiled component.\n */\nexport function useAnchorPosition(\n ref: React.RefObject<HTMLDivElement | null>,\n position: PanelPosition = 'bottom-left'\n) {\n const [pos, setPos] = useState({ top: 0, left: 0 })\n\n useEffect(() => {\n if (!ref.current) return\n const update = () => {\n if (!ref.current) return\n const rect = ref.current.getBoundingClientRect()\n const margin = 8\n switch (position) {\n case 'top-left':\n setPos({ top: rect.top + margin, left: rect.left + margin }); break\n case 'top-right':\n setPos({ top: rect.top + margin, left: rect.right - margin }); break\n case 'bottom-right':\n setPos({ top: rect.bottom - margin, left: rect.right - margin }); break\n case 'bottom-left':\n default:\n setPos({ top: rect.bottom - margin, left: rect.left + margin }); break\n }\n }\n const observer = new ResizeObserver(update)\n observer.observe(ref.current)\n observer.observe(document.documentElement)\n return () => observer.disconnect()\n }, [ref, position])\n\n return pos\n}\n\n/**\n * Makes an element draggable via Pointer Events.\n * Returns an offset to apply as CSS transform and event handlers for the drag handle.\n */\nexport function useDraggable() {\n const [offset, setOffset] = useState({ x: 0, y: 0 })\n const dragging = useRef(false)\n const start = useRef({ x: 0, y: 0 })\n\n const onPointerDown = useCallback((e: React.PointerEvent) => {\n dragging.current = true\n start.current = { x: e.clientX - offset.x, y: e.clientY - offset.y }\n ;(e.target as HTMLElement).setPointerCapture(e.pointerId)\n }, [offset])\n\n const onPointerMove = useCallback((e: React.PointerEvent) => {\n if (!dragging.current) return\n setOffset({\n x: e.clientX - start.current.x,\n y: e.clientY - start.current.y,\n })\n }, [])\n\n const onPointerUp = useCallback(() => {\n dragging.current = false\n }, [])\n\n return { offset, handlers: { onPointerDown, onPointerMove, onPointerUp } }\n}\n\n/**\n * Counts real DOM mutations via MutationObserver (ignoring class-only changes).\n * The node count is cached and only recalculated when the DOM actually changes,\n * so we don't pay the cost of querySelectorAll('*') every frame.\n */\nexport function useDomTracker(wrapperRef: React.RefObject<HTMLDivElement | null>, enabled: boolean) {\n const mutations = useRef(0)\n const nodeCount = useRef(0)\n const dirty = useRef(true)\n\n useEffect(() => {\n if (!enabled || !wrapperRef.current) return\n const observer = new MutationObserver((records) => {\n let realMutation = false\n for (const record of records) {\n if (record.type === 'attributes' && record.attributeName === 'class') continue\n realMutation = true\n }\n if (realMutation) {\n mutations.current++\n dirty.current = true\n }\n })\n observer.observe(wrapperRef.current, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['style'],\n })\n return () => observer.disconnect()\n }, [wrapperRef, enabled])\n\n const getNodeCount = useCallback(() => {\n if (dirty.current && wrapperRef.current) {\n nodeCount.current = wrapperRef.current.querySelectorAll('*').length\n dirty.current = false\n }\n return nodeCount.current\n }, [wrapperRef])\n\n const reset = useCallback(() => {\n mutations.current = 0\n dirty.current = true\n }, [])\n\n return { mutations, getNodeCount, reset }\n}\n\n/**\n * Measures how many React renders happen per second.\n * Call `tick()` from the <Profiler> onRender callback; the hook\n * snapshots the count every second and resets it.\n */\nexport function useRenderRate() {\n const renderCount = useRef(0)\n const rendersPerSecond = useRef(0)\n\n const tick = useCallback(() => {\n renderCount.current++\n }, [])\n\n useEffect(() => {\n const id = setInterval(() => {\n rendersPerSecond.current = renderCount.current\n renderCount.current = 0\n }, 1000)\n return () => clearInterval(id)\n }, [])\n\n const reset = useCallback(() => {\n renderCount.current = 0\n rendersPerSecond.current = 0\n }, [])\n\n return { rendersPerSecond, tick, reset }\n}\n\n/**\n * Flashes a subtle outline on the profiled element whenever the DOM mutates.\n * Skips the very first mutation (the initial mount) to avoid a flash on load.\n */\nexport function useRenderFlash(wrapperRef: React.RefObject<HTMLDivElement | null>, open: boolean) {\n const mutationCount = useRef(0)\n\n useEffect(() => {\n if (!open || !wrapperRef.current) return\n const observer = new MutationObserver(() => {\n mutationCount.current++\n if (!wrapperRef.current || mutationCount.current <= 1) return\n const el = wrapperRef.current\n el.style.outline = FLASH_OUTLINE\n el.style.outlineOffset = '-2px'\n setTimeout(() => {\n el.style.outline = ''\n el.style.outlineOffset = ''\n }, 150)\n })\n observer.observe(wrapperRef.current, { childList: true, subtree: true })\n return () => observer.disconnect()\n }, [wrapperRef, open])\n}\n\n/**\n * Detects browser \"long tasks\" (>50 ms) using PerformanceObserver.\n * Falls back silently in browsers that don't support the longtask entry type.\n */\nexport function useLongTasks(enabled: boolean) {\n const count = useRef(0)\n\n useEffect(() => {\n if (!enabled || typeof PerformanceObserver === 'undefined') return\n try {\n const observer = new PerformanceObserver((list) => {\n count.current += list.getEntries().length\n })\n observer.observe({ entryTypes: ['longtask'] })\n return () => observer.disconnect()\n } catch {\n // longtask not supported in this browser\n }\n }, [enabled])\n\n const reset = useCallback(() => { count.current = 0 }, [])\n\n return { count, reset }\n}\n","/**\n * @module react-dev-profiler\n * @description Inline styles for the profiler UI — no external CSS needed.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\nimport type { CSSProperties } from 'react'\n\nexport const s = {\n wrapper: {\n display: 'contents',\n } satisfies CSSProperties,\n\n panel: {\n position: 'fixed',\n zIndex: 99999,\n background: 'rgba(8, 8, 8, 0.95)',\n border: '1px solid #222',\n borderRadius: 10,\n padding: '10px 14px',\n minWidth: 220,\n boxShadow: '0 8px 32px rgba(0, 0, 0, 0.7)',\n fontFamily: \"'SF Mono', 'Fira Code', monospace\",\n backdropFilter: 'blur(12px)',\n userSelect: 'none',\n color: '#ccc',\n fontSize: 11,\n } satisfies CSSProperties,\n\n panelHeader: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n marginBottom: 8,\n cursor: 'grab',\n touchAction: 'none',\n } satisfies CSSProperties,\n\n panelTitle: {\n color: '#666',\n fontSize: 9,\n fontWeight: 700,\n letterSpacing: 1.5,\n textTransform: 'uppercase',\n display: 'flex',\n alignItems: 'center',\n gap: 6,\n } satisfies CSSProperties,\n\n instanceBadge: {\n background: '#222',\n color: '#888',\n fontSize: 8,\n padding: '1px 5px',\n borderRadius: 4,\n letterSpacing: 0.5,\n textTransform: 'none',\n } satisfies CSSProperties,\n\n headerActions: {\n display: 'flex',\n alignItems: 'center',\n gap: 8,\n } satisfies CSSProperties,\n\n iconBtn: {\n background: 'none',\n border: 'none',\n color: '#444',\n cursor: 'pointer',\n padding: 0,\n lineHeight: 1,\n display: 'flex',\n alignItems: 'center',\n transition: 'color 0.15s',\n } satisfies CSSProperties,\n\n iconBtnActive: {\n color: '#4ade80',\n } satisfies CSSProperties,\n\n closeBtn: {\n background: 'none',\n border: 'none',\n color: '#444',\n cursor: 'pointer',\n fontSize: 13,\n padding: 0,\n lineHeight: 1,\n } satisfies CSSProperties,\n\n body: {\n display: 'flex',\n flexDirection: 'column',\n gap: 5,\n } satisfies CSSProperties,\n\n section: {\n color: '#444',\n fontSize: 8,\n fontWeight: 600,\n letterSpacing: 1,\n textTransform: 'uppercase',\n marginTop: 2,\n } satisfies CSSProperties,\n\n separator: {\n height: 1,\n background: '#1a1a1a',\n margin: '2px 0',\n } satisfies CSSProperties,\n\n row: {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n padding: '1px 0',\n } satisfies CSSProperties,\n\n rowLabel: {\n color: '#555',\n fontSize: 10,\n } satisfies CSSProperties,\n\n rowValue: {\n fontSize: 11,\n fontWeight: 600,\n } satisfies CSSProperties,\n\n miniRow: {\n display: 'flex',\n justifyContent: 'space-between',\n color: '#444',\n fontSize: 9,\n marginTop: -2,\n marginBottom: 2,\n } satisfies CSSProperties,\n\n graphWrap: {\n marginTop: 4,\n } satisfies CSSProperties,\n\n toggleBtn: {\n position: 'fixed',\n zIndex: 99998,\n minWidth: 28,\n height: 24,\n borderRadius: 7,\n border: '1px solid #2a2a2a',\n background: 'rgba(20, 20, 20, 0.9)',\n cursor: 'pointer',\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n padding: '0 6px',\n backdropFilter: 'blur(8px)',\n } satisfies CSSProperties,\n\n toggleFps: {\n fontFamily: \"'SF Mono', 'Fira Code', monospace\",\n fontSize: 10,\n fontWeight: 700,\n letterSpacing: -0.5,\n } satisfies CSSProperties,\n\n footer: {\n marginTop: 8,\n color: '#333',\n fontSize: 8,\n textAlign: 'center',\n } satisfies CSSProperties,\n}\n\n/** Flash outline class name applied directly via classList. */\nexport const FLASH_OUTLINE = '2px solid rgba(99, 102, 241, 0.8)'\n","/**\n * @module react-dev-profiler\n * @description The main stats panel — renders all performance metrics in a floating overlay.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\nimport { useState, useEffect, useCallback, useRef, type CSSProperties } from 'react'\nimport { createPortal } from 'react-dom'\nimport { s } from './styles'\nimport { useAnchorPosition, useDraggable, useDomTracker, useRenderRate, useLongTasks } from './hooks'\nimport { type ReactProfilerData, type PanelPosition, type DevStats, HISTORY_SIZE, INITIAL_STATS, percentile } from './types'\n\n/** Rolling bar chart of frame times (last 60 samples). */\nfunction FrameTimeGraph({ history }: { history: number[] }) {\n const max = Math.max(33, ...history)\n const w = 140\n const h = 32\n const barW = Math.max(1, w / HISTORY_SIZE - 0.5)\n\n return (\n <div style={s.graphWrap}>\n <svg width={w} height={h} style={{ display: 'block' }}>\n <rect width={w} height={h} rx={3} fill=\"#111\" />\n {/* 60 fps guideline */}\n <line x1={0} y1={h - (16.67 / max) * h} x2={w} y2={h - (16.67 / max) * h}\n stroke=\"#1a3a1a\" strokeWidth={1} />\n {/* 30 fps guideline */}\n <line x1={0} y1={h - (33 / max) * h} x2={w} y2={h - (33 / max) * h}\n stroke=\"#3a1a1a\" strokeWidth={1} />\n {history.map((ms, i) => {\n const x = (i / HISTORY_SIZE) * w\n const barH = Math.min((ms / max) * h, h)\n const color = ms > 33 ? '#ef4444' : ms > 16.67 ? '#f59e0b' : '#4ade80'\n return <rect key={i} x={x} y={h - barH} width={barW} height={barH} fill={color} opacity={0.8} rx={0.5} />\n })}\n </svg>\n </div>\n )\n}\n\n/** Single label → value row used throughout the panel. */\nfunction StatRow({ label, value, sub, color = '#4ade80' }: { label: string, value: string, sub?: string, color?: string }) {\n return (\n <div style={s.row}>\n <span style={s.rowLabel}>{label}</span>\n <span>\n <span style={{ ...s.rowValue, color }}>{value}</span>\n {sub && <span style={{ color: '#444', fontSize: 9, marginLeft: 4 }}>{sub}</span>}\n </span>\n </div>\n )\n}\n\n/** Computes fixed-position styles based on the chosen panel position + drag offset. */\nfunction getPanelStyle(\n pos: { top: number; left: number },\n offset: { x: number; y: number },\n position: PanelPosition,\n): CSSProperties {\n const style: CSSProperties = {\n ...s.panel,\n transform: `translate(${offset.x}px, ${offset.y}px)`,\n }\n if (position.startsWith('bottom')) {\n style.bottom = window.innerHeight - pos.top\n } else {\n style.top = pos.top\n }\n if (position.endsWith('right')) {\n style.right = window.innerWidth - pos.left\n } else {\n style.left = pos.left\n }\n return style\n}\n\n/** Floating stats panel portaled to document.body. */\nexport function DevStatsPanel({\n targetRef,\n domTracker,\n renderRate,\n longTasks,\n profilerData,\n onClose,\n onReset,\n position = 'bottom-left',\n instanceId,\n instanceCount = 1,\n}: {\n targetRef: React.RefObject<HTMLDivElement | null>\n domTracker: ReturnType<typeof useDomTracker>\n renderRate: ReturnType<typeof useRenderRate>\n longTasks: ReturnType<typeof useLongTasks>\n profilerData: React.RefObject<ReactProfilerData>\n onClose: () => void\n onReset: () => void\n position?: PanelPosition\n instanceId?: string\n instanceCount?: number\n}) {\n const [stats, setStats] = useState<DevStats>(INITIAL_STATS)\n const [exported, setExported] = useState(false)\n const lastFrame = useRef(performance.now())\n const frameTimeHistory = useRef<number[]>([])\n const allFrameTimes = useRef<number[]>([])\n const pos = useAnchorPosition(targetRef, position)\n const { offset, handlers: dragHandlers } = useDraggable()\n\n // Collects frame timing data every rAF, then snapshots stats once per second.\n useEffect(() => {\n let animId: number\n let frameCount = 0\n let frameTotalMs = 0\n let lastSecond = performance.now()\n\n const tick = () => {\n const now = performance.now()\n const delta = now - lastFrame.current\n lastFrame.current = now\n frameCount++\n frameTotalMs += delta\n\n if (now - lastSecond >= 1000) {\n const avgFrameTime = frameTotalMs / frameCount\n\n const hist = frameTimeHistory.current\n if (hist.length >= HISTORY_SIZE) hist.shift()\n hist.push(avgFrameTime)\n\n allFrameTimes.current.push(avgFrameTime)\n const sorted = [...allFrameTimes.current].sort((a, b) => a - b)\n\n const el = targetRef.current\n const dims = el ? `${el.offsetWidth} x ${el.offsetHeight}` : '–'\n\n // Chrome-only: performance.memory exposes JS heap usage\n const perf = performance as any\n const mem = perf.memory ? Math.round(perf.memory.usedJSHeapSize / 1024 / 1024) : 0\n\n setStats({\n domMutations: domTracker.mutations.current,\n domNodes: domTracker.getNodeCount(),\n frameTime: avgFrameTime,\n frameTimeMin: sorted[0] ?? 0,\n frameTimeMax: sorted[sorted.length - 1] ?? 0,\n frameTimeP99: percentile(sorted, 99),\n frameTimeHistory: [...hist],\n longTasks: longTasks.count.current,\n rendersPerSecond: renderRate.rendersPerSecond.current,\n memory: mem,\n dimensions: dims,\n profiler: { ...profilerData.current },\n })\n\n frameCount = 0\n frameTotalMs = 0\n lastSecond = now\n }\n animId = requestAnimationFrame(tick)\n }\n animId = requestAnimationFrame(tick)\n return () => cancelAnimationFrame(animId)\n }, [targetRef, domTracker, renderRate, longTasks])\n\n const handleReset = useCallback(() => {\n frameTimeHistory.current = []\n allFrameTimes.current = []\n setStats(INITIAL_STATS)\n onReset()\n }, [onReset])\n\n // Copy current stats as JSON to clipboard.\n const handleExport = useCallback(() => {\n const payload = { timestamp: new Date().toISOString(), ...stats }\n const json = JSON.stringify(payload, null, 2)\n try {\n navigator.clipboard.writeText(json).then(() => {\n setExported(true)\n setTimeout(() => setExported(false), 1200)\n })\n } catch {\n // Fallback for non-secure contexts\n const ta = document.createElement('textarea')\n ta.value = json\n ta.style.position = 'fixed'\n ta.style.opacity = '0'\n document.body.appendChild(ta)\n ta.select()\n document.execCommand('copy')\n document.body.removeChild(ta)\n setExported(true)\n setTimeout(() => setExported(false), 1200)\n }\n }, [stats])\n\n // Color thresholds: green = good, amber = warning, red = bad\n const ftColor = stats.frameTime > 33 ? '#ef4444' : stats.frameTime > 16.67 ? '#f59e0b' : '#4ade80'\n const rpsColor = stats.rendersPerSecond > 30 ? '#ef4444' : stats.rendersPerSecond > 10 ? '#f59e0b' : '#4ade80'\n const actualColor = stats.profiler.actualDuration > 16 ? '#ef4444' : stats.profiler.actualDuration > 8 ? '#f59e0b' : '#4ade80'\n const fps = stats.frameTime > 0 ? Math.round(1000 / stats.frameTime) : 0\n const memoGain = stats.profiler.baseDuration > 0\n ? Math.round((1 - stats.profiler.actualDuration / stats.profiler.baseDuration) * 100)\n : 0\n const p99Color = stats.frameTimeP99 > 33 ? '#ef4444' : stats.frameTimeP99 > 16.67 ? '#f59e0b' : '#4ade80'\n\n const exportStyle: CSSProperties = exported\n ? { ...s.iconBtn, ...s.iconBtnActive }\n : s.iconBtn\n\n return createPortal(\n <div style={getPanelStyle(pos, offset, position)}>\n <div\n style={s.panelHeader}\n {...dragHandlers}\n >\n <span style={s.panelTitle}>\n Dev Profiler\n {instanceCount > 1 && instanceId && (\n <span style={s.instanceBadge}>{instanceId}</span>\n )}\n </span>\n <div style={s.headerActions}>\n <button\n style={exportStyle}\n onClick={handleExport}\n title={exported ? 'Copied!' : 'Copy stats to clipboard'}\n >\n {exported ? (\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 16 16\" fill=\"currentColor\">\n <path d=\"M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0z\"/>\n </svg>\n ) : (\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 16 16\" fill=\"currentColor\">\n <path d=\"M0 6.75C0 5.784.784 5 1.75 5h1.5a.75.75 0 0 1 0 1.5h-1.5a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-1.5a.75.75 0 0 1 1.5 0v1.5A1.75 1.75 0 0 1 9.25 16h-7.5A1.75 1.75 0 0 1 0 14.25z\"/>\n <path d=\"M5 1.75C5 .784 5.784 0 6.75 0h7.5C15.216 0 16 .784 16 1.75v7.5A1.75 1.75 0 0 1 14.25 11h-7.5A1.75 1.75 0 0 1 5 9.25zm1.75-.25a.25.25 0 0 0-.25.25v7.5c0 .138.112.25.25.25h7.5a.25.25 0 0 0 .25-.25v-7.5a.25.25 0 0 0-.25-.25z\"/>\n </svg>\n )}\n </button>\n <button style={s.iconBtn} onClick={handleReset} title=\"Reset counters\">\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 16 16\" fill=\"currentColor\">\n <path d=\"M14 1a1 1 0 0 1 1 1v4a1 1 0 0 1-1 1h-4a1 1 0 0 1 0-2h1.6A6 6 0 0 0 2.07 7.5a1 1 0 1 1-1.97-.36A8 8 0 0 1 13 3.35V2a1 1 0 0 1 1-1zM2 15a1 1 0 0 1-1-1v-4a1 1 0 0 1 1-1h4a1 1 0 0 1 0 2H4.4A6 6 0 0 0 13.93 8.5a1 1 0 1 1 1.97.36A8 8 0 0 1 3 12.65V14a1 1 0 0 1-1 1z\"/>\n </svg>\n </button>\n <button style={s.closeBtn} onClick={onClose}>✕</button>\n </div>\n </div>\n\n <div style={s.body}>\n <span style={s.section}>Rendering</span>\n <StatRow label=\"Frame time\" value={`${stats.frameTime.toFixed(1)}ms`} sub={`${fps} fps`} color={ftColor} />\n <FrameTimeGraph history={stats.frameTimeHistory} />\n <div style={s.miniRow}>\n <span>min {stats.frameTimeMin.toFixed(1)}</span>\n <span>max {stats.frameTimeMax.toFixed(1)}</span>\n <span style={{ color: p99Color }}>p99 {stats.frameTimeP99.toFixed(1)}</span>\n </div>\n <StatRow label=\"Renders/s\" value={String(stats.rendersPerSecond)} color={rpsColor} />\n <StatRow label=\"Long tasks\" value={String(stats.longTasks)} color={stats.longTasks > 0 ? '#f59e0b' : '#4ade80'} />\n\n <div style={s.separator} />\n <span style={s.section}>React Profiler</span>\n <StatRow label=\"Phase\" value={stats.profiler.phase} color=\"#888\" />\n <StatRow label=\"Render\" value={`${stats.profiler.actualDuration.toFixed(2)}ms`} color={actualColor} />\n <StatRow label=\"Base (no memo)\" value={`${stats.profiler.baseDuration.toFixed(2)}ms`} color=\"#888\" />\n <StatRow label=\"Memo gain\" value={`${memoGain}%`} color={memoGain > 50 ? '#4ade80' : memoGain > 20 ? '#f59e0b' : '#ef4444'} />\n <StatRow label=\"Commits\" value={String(stats.profiler.commitCount)} />\n\n <div style={s.separator} />\n <span style={s.section}>DOM</span>\n <StatRow label=\"Nodes\" value={stats.domNodes.toLocaleString()} />\n <StatRow label=\"Mutations\" value={String(stats.domMutations)} />\n <StatRow label=\"Size\" value={stats.dimensions} color=\"#888\" />\n\n <div style={s.separator} />\n <span style={s.section}>Memory</span>\n <StatRow label=\"JS Heap\" value={stats.memory > 0 ? `${stats.memory} MB` : 'N/A'} />\n </div>\n\n <div style={s.footer}>Ctrl+I to toggle</div>\n </div>,\n document.body\n )\n}\n","/**\n * @module react-dev-profiler\n * @description Minimal floating button that shows the current FPS at a glance.\n * @author Frederic Denis (billywild87) — https://github.com/billywild87\n * @license MIT\n */\n\nimport { useState, useEffect, useRef, type CSSProperties } from 'react'\nimport { createPortal } from 'react-dom'\nimport { s } from './styles'\nimport { useAnchorPosition } from './hooks'\nimport type { PanelPosition } from './types'\n\n/** Computes fixed-position styles based on the chosen panel position. */\nfunction getButtonStyle(pos: { top: number; left: number }, position: PanelPosition): CSSProperties {\n const style: CSSProperties = { ...s.toggleBtn }\n if (position.startsWith('bottom')) {\n style.bottom = window.innerHeight - pos.top + 8\n } else {\n style.top = pos.top + 8\n }\n if (position.endsWith('right')) {\n style.right = window.innerWidth - pos.left\n } else {\n style.left = pos.left\n }\n return style\n}\n\n/** Small floating pill showing live FPS — click to open the full panel. */\nexport function ToggleButton({\n targetRef,\n onClick,\n position = 'bottom-left',\n}: {\n targetRef: React.RefObject<HTMLDivElement | null>\n onClick: () => void\n position?: PanelPosition\n}) {\n const pos = useAnchorPosition(targetRef, position)\n const [fps, setFps] = useState(0)\n const lastFrame = useRef(performance.now())\n\n useEffect(() => {\n let animId: number\n let count = 0\n let lastSecond = performance.now()\n\n const tick = () => {\n const now = performance.now()\n lastFrame.current = now\n count++\n if (now - lastSecond >= 1000) {\n setFps(count)\n count = 0\n lastSecond = now\n }\n animId = requestAnimationFrame(tick)\n }\n animId = requestAnimationFrame(tick)\n return () => cancelAnimationFrame(animId)\n }, [])\n\n const fpsColor = fps < 30 ? '#ef4444' : fps < 55 ? '#f59e0b' : '#4ade80'\n\n return createPortal(\n <button\n onClick={onClick}\n title=\"Dev Profiler (Ctrl+I)\"\n style={getButtonStyle(pos, position)}\n >\n <span style={{ ...s.toggleFps, color: fpsColor }}>{fps}</span>\n </button>,\n document.body\n )\n}\n"],"mappings":";AAOA,SAAS,UAAU,UAAAA,SAAQ,YAAAC,WAAU,aAAAC,YAAW,eAAAC,oBAAmC;;;AC4B5E,IAAM,eAAe;AAErB,IAAM,mBAAsC;AAAA,EAC/C,OAAO;AAAA,EACP,gBAAgB;AAAA,EAChB,cAAc;AAAA,EACd,aAAa;AACjB;AAEO,IAAM,gBAA0B;AAAA,EACnC,cAAc;AAAA,EACd,UAAU;AAAA,EACV,WAAW;AAAA,EACX,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AAAA,EACd,kBAAkB,CAAC;AAAA,EACnB,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,QAAQ;AAAA,EACR,YAAY;AAAA,EACZ,UAAU;AACd;AAGO,SAAS,WAAW,QAAkB,GAAmB;AAC5D,MAAI,OAAO,WAAW,EAAG,QAAO;AAChC,QAAM,MAAM,KAAK,KAAM,IAAI,MAAO,OAAO,MAAM,IAAI;AACnD,SAAO,OAAO,KAAK,IAAI,GAAG,GAAG,CAAC;AAClC;;;ACpDO,IAAM,UACT,OAAO,YAAY,cACb,QAAQ,IAAI,aAAa,eACzB;;;ACRV,SAAS,UAAU,WAAW,aAAa,cAAc;;;ACElD,IAAM,IAAI;AAAA,EACb,S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AC;AAEf,QAAM,cAAcA,aAAY,MAAM;AAClC,eAAW,MAAM;AACjB,eAAW,MAAM;AACjB,cAAU,MAAM;AAChB,iBAAa,UAAU,EAAE,GAAG,iBAAiB;AAAA,EACjD,GAAG,CAAC,YAAY,YAAY,SAAS,CAAC;AAEtC,EAAAC,WAAU,MAAM;AACZ,UAAM,UAAU,MAAM,QAAQ,UAAQ,CAAC,IAAI;AAC3C,WAAO,iBAAiB,cAAc,OAAO;AAC7C,WAAO,MAAM,OAAO,oBAAoB,cAAc,OAAO;AAAA,EACjE,GAAG,CAAC,CAAC;AAEL,MAAI,CAAC,QAAS,QAAO,gBAAAL,KAAA,YAAG,UAAS;AAEjC,SACI,gBAAAC,MAAC,SAAI,KAAK,YAAY,OAAO,EAAE,SAAS,WAAW,GAC/C;AAAA,oBAAAD,KAAC,YAAS,IAAG,eAAc,UACtB,UACL;AAAA,IACC,CAAC,QAAQ,gBAAAA,KAAC,gBAAa,WAAW,YAAY,SAAS,QAAQ,UAAoB;AAAA,IACnF,QACG,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACG,WAAW;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAS;AAAA,QACT,SAAS;AAAA,QACT;AAAA,QACA;AAAA,QACA,eAAe,gBAAgB;AAAA;AAAA,IACnC;AAAA,KAER;AAER;","names":["useRef","useState","useEffect","useCallback","useState","useEffect","useCallback","useRef","useState","useRef","useEffect","useCallback","useState","useEffect","useRef","createPortal","jsx","useState","useRef","useEffect","createPortal","jsx","jsxs","useRef","useState","useCallback","useEffect"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-dev-profiler",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "Real-time React performance monitoring — frame times, FPS, DOM mutations, memory, and more. Zero overhead in production.",
5
5
  "author": "Frederic Denis <billywild87@users.noreply.github.com> (https://github.com/billywild87)",
6
6
  "license": "MIT",