rerender-lens 0.4.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.
Files changed (68) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/README.md +208 -359
  3. package/dist/{budget-LkNjGtRc.d.ts → budget-CA1MS7lB.d.cts} +20 -10
  4. package/dist/{budget-COBu7jBU.d.cts → budget-ok1VDJ4t.d.ts} +20 -10
  5. package/dist/cli.cjs +322 -53
  6. package/dist/cli.cjs.map +1 -1
  7. package/dist/cli.js +322 -53
  8. package/dist/cli.js.map +1 -1
  9. package/dist/{devtools-BkCct3cJ.d.cts → devtools-Cl5n_52v.d.ts} +17 -2
  10. package/dist/{devtools-CZebzpF6.d.ts → devtools-UwQx2VYS.d.cts} +17 -2
  11. package/dist/index.cjs +537 -49
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +137 -8
  14. package/dist/index.d.ts +137 -8
  15. package/dist/index.js +521 -50
  16. package/dist/index.js.map +1 -1
  17. package/dist/jest-setup.cjs +1690 -0
  18. package/dist/jest-setup.cjs.map +1 -0
  19. package/dist/jest-setup.d.cts +8 -0
  20. package/dist/jest-setup.d.ts +8 -0
  21. package/dist/jest-setup.js +1688 -0
  22. package/dist/jest-setup.js.map +1 -0
  23. package/dist/jest.cjs +1777 -0
  24. package/dist/jest.cjs.map +1 -0
  25. package/dist/jest.d.cts +23 -0
  26. package/dist/jest.d.ts +23 -0
  27. package/dist/jest.js +1768 -0
  28. package/dist/jest.js.map +1 -0
  29. package/dist/{notifiers-BjjGSHpp.d.ts → notifiers-B5poAEvE.d.cts} +8 -4
  30. package/dist/{notifiers-BGQtWKfX.d.cts → notifiers-CqQW0Eum.d.ts} +8 -4
  31. package/dist/playwright.cjs +230 -28
  32. package/dist/playwright.cjs.map +1 -1
  33. package/dist/playwright.d.cts +4 -4
  34. package/dist/playwright.d.ts +4 -4
  35. package/dist/playwright.js +230 -28
  36. package/dist/playwright.js.map +1 -1
  37. package/dist/relay.cjs +71 -19
  38. package/dist/relay.cjs.map +1 -1
  39. package/dist/relay.d.cts +25 -3
  40. package/dist/relay.d.ts +25 -3
  41. package/dist/relay.js +71 -19
  42. package/dist/relay.js.map +1 -1
  43. package/dist/rerender-lens.iife.js +457 -62
  44. package/dist/runner-report-Bvqoe89M.d.ts +46 -0
  45. package/dist/runner-report-CvpDg2zt.d.cts +46 -0
  46. package/dist/setup.cjs +209 -35
  47. package/dist/setup.cjs.map +1 -1
  48. package/dist/setup.js +209 -35
  49. package/dist/setup.js.map +1 -1
  50. package/dist/{types-BzUEVkxJ.d.cts → types-DwNN5cWe.d.cts} +82 -2
  51. package/dist/{types-BzUEVkxJ.d.ts → types-DwNN5cWe.d.ts} +82 -2
  52. package/dist/vite.d.cts +1 -1
  53. package/dist/vite.d.ts +1 -1
  54. package/dist/vitest-setup.cjs +357 -44
  55. package/dist/vitest-setup.cjs.map +1 -1
  56. package/dist/vitest-setup.d.cts +4 -4
  57. package/dist/vitest-setup.d.ts +4 -4
  58. package/dist/vitest-setup.js +357 -44
  59. package/dist/vitest-setup.js.map +1 -1
  60. package/dist/vitest.cjs +420 -80
  61. package/dist/vitest.cjs.map +1 -1
  62. package/dist/vitest.d.cts +21 -39
  63. package/dist/vitest.d.ts +21 -39
  64. package/dist/vitest.js +421 -81
  65. package/dist/vitest.js.map +1 -1
  66. package/package.json +41 -4
  67. package/panel/panel.css +49 -0
  68. package/panel/panel.js +871 -353
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rerender-lens",
3
- "version": "0.4.0",
3
+ "version": "0.7.0",
4
4
  "description": "Find avoidable React re-renders and what caused them. Reads the fiber tree like React DevTools, so nothing is patched: works with Fast Refresh, memo, forwardRef and classes. Structured reports, test assertions, and a DevTools bridge.",
5
5
  "keywords": [
6
6
  "react",
@@ -19,7 +19,9 @@
19
19
  "./dist/setup.js",
20
20
  "./dist/setup.cjs",
21
21
  "./dist/vitest-setup.js",
22
- "./dist/vitest-setup.cjs"
22
+ "./dist/vitest-setup.cjs",
23
+ "./dist/jest-setup.js",
24
+ "./dist/jest-setup.cjs"
23
25
  ],
24
26
  "main": "./dist/index.cjs",
25
27
  "module": "./dist/index.js",
@@ -85,6 +87,26 @@
85
87
  "default": "./dist/vitest-setup.cjs"
86
88
  }
87
89
  },
90
+ "./jest": {
91
+ "import": {
92
+ "types": "./dist/jest.d.ts",
93
+ "default": "./dist/jest.js"
94
+ },
95
+ "require": {
96
+ "types": "./dist/jest.d.cts",
97
+ "default": "./dist/jest.cjs"
98
+ }
99
+ },
100
+ "./jest/setup": {
101
+ "import": {
102
+ "types": "./dist/jest-setup.d.ts",
103
+ "default": "./dist/jest-setup.js"
104
+ },
105
+ "require": {
106
+ "types": "./dist/jest-setup.d.cts",
107
+ "default": "./dist/jest-setup.cjs"
108
+ }
109
+ },
88
110
  "./setup": {
89
111
  "import": {
90
112
  "types": "./dist/setup.d.ts",
@@ -119,9 +141,16 @@
119
141
  "docs:media": "node scripts/docs-media.mjs",
120
142
  "lint:ext": "npx --yes web-ext lint --source-dir dist-extension/firefox --warnings-as-errors=false",
121
143
  "version": "node scripts/sync-version.mjs && git add extension/manifest.json",
122
- "check": "npm run typecheck && npm test && npm run build && npm run lint:pkg && npm run build:ext",
144
+ "check": "npm run typecheck && npm test && npm run build && npm run test:built && npm run lint:pkg && npm run build:ext",
123
145
  "prepublishOnly": "npm run check",
124
- "dev:example": "npm run build && npm --prefix examples/vite-react run dev"
146
+ "dev:example": "npm run build && npm --prefix examples/vite-react run dev",
147
+ "test:built": "vitest run test/vendor.test.ts",
148
+ "e2e:next": "playwright test -c e2e/next.config.ts",
149
+ "test:jest": "node scripts/jest-check.mjs",
150
+ "test:react18": "npm install --prefix .react18 --no-save --no-package-lock --no-audit --no-fund react@18 react-dom@18 && vitest run --config test/react-compat.config.ts",
151
+ "store:media": "node scripts/store-media.mjs",
152
+ "test:react17": "npm install --prefix .react17 --no-save --no-package-lock --no-audit --no-fund react@17 react-dom@17 && REACT_COMPAT_DIR=.react17/node_modules vitest run --config test/react-compat.config.ts",
153
+ "e2e:perf": "playwright test -c e2e/perf.config.ts"
125
154
  },
126
155
  "peerDependencies": {
127
156
  "react": ">=16.8.0",
@@ -129,11 +158,19 @@
129
158
  },
130
159
  "devDependencies": {
131
160
  "@arethetypeswrong/cli": "^0.18.5",
161
+ "@babel/core": "^8.0.1",
162
+ "@babel/preset-env": "^8.0.2",
163
+ "@babel/preset-react": "^8.0.1",
164
+ "@babel/preset-typescript": "^8.0.1",
165
+ "@jest/globals": "^30.5.1",
132
166
  "@playwright/test": "^1.63.0",
133
167
  "@types/chrome": "^0.2.9",
134
168
  "@types/node": "^26.4.1",
135
169
  "@types/react": "^19.2.18",
136
170
  "@types/react-dom": "^19.2.7",
171
+ "babel-jest": "^30.5.1",
172
+ "jest": "^30.5.1",
173
+ "jest-environment-jsdom": "^30.5.1",
137
174
  "jsdom": "^29.1.1",
138
175
  "marked": "^9.1.6",
139
176
  "publint": "^0.3.24",
package/panel/panel.css CHANGED
@@ -105,6 +105,11 @@ button.ib.active .glyph { color: var(--accent); }
105
105
  .status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent); }
106
106
  .status.connected .dot { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent); }
107
107
  .status.partial .dot { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 18%, transparent); }
108
+ .app-picker {
109
+ height: 22px; max-width: 200px; padding: 0 4px; font-size: 11px; color: var(--text-dim);
110
+ background: var(--bg-inset); border: 1px solid var(--border); border-radius: 10px;
111
+ }
112
+ .app-picker:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
108
113
  .tab-chip {
109
114
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
110
115
  padding: 2px 8px; border-radius: 10px; background: var(--bg-inset); color: var(--text-dim); font-size: 11px;
@@ -123,6 +128,43 @@ button.ib.active .glyph { color: var(--accent); }
123
128
  .summary button.stat { height: 22px; padding: 0 6px; margin: 0 -6px; }
124
129
  .summary button.stat:hover { background: var(--hover); }
125
130
 
131
+ /* ---------- commit timeline strip ---------- */
132
+ .timeline { flex: none; background: var(--bg-alt); border-bottom: 1px solid var(--border); }
133
+ .timeline-header {
134
+ display: flex; align-items: center; gap: 6px; padding: 1px 12px; height: 17px;
135
+ color: var(--text-dim); cursor: pointer; user-select: none; font-size: 10px;
136
+ }
137
+ .timeline-header:hover { color: var(--text); }
138
+ .timeline-header .chevron { width: 9px; flex: none; }
139
+ .timeline-header .count { margin-left: auto; font-variant-numeric: tabular-nums; }
140
+ .timeline-header .chip {
141
+ height: 15px; padding: 0 7px; font-size: 10px; border-radius: 8px;
142
+ border: 1px solid var(--accent); background: var(--accent-bg); color: var(--accent);
143
+ }
144
+ .timeline-header .chip:hover { background: var(--accent); color: var(--bg); }
145
+ .timeline-body { padding: 0 12px 2px; }
146
+ .timeline.collapsed .timeline-body { display: none; }
147
+ .timeline .bars {
148
+ display: flex; align-items: flex-end; gap: 1px; height: 26px; padding: 0 2px;
149
+ background: var(--bg-inset); border-radius: 3px; overflow: hidden; cursor: crosshair;
150
+ }
151
+ .timeline .bar {
152
+ flex: 1 1 0; min-width: 2px; height: 100%; padding: 0; margin: 0; display: block;
153
+ position: relative; align-self: flex-end; border: 0; border-radius: 1px 1px 0 0;
154
+ background: var(--ok); opacity: 0.65; cursor: pointer;
155
+ }
156
+ .timeline .bar:hover { background: var(--ok); opacity: 1; }
157
+ .timeline .bar .avoid { position: absolute; left: 0; right: 0; bottom: 0; background: var(--danger); }
158
+ .timeline .bar.in-window, .timeline .bar.brushing { opacity: 1; }
159
+ .timeline .bar.selected { opacity: 1; outline: 1px solid var(--accent); outline-offset: -1px; }
160
+ .timeline .bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; opacity: 1; }
161
+ .timeline-axis {
162
+ display: flex; justify-content: space-between; height: 10px; line-height: 10px;
163
+ pointer-events: none; font-size: 9px; color: var(--text-faint); font-variant-numeric: tabular-nums;
164
+ }
165
+ .compact .timeline-header, .compact .timeline-body { padding-left: 8px; padding-right: 8px; }
166
+ .compact .timeline .bars { height: 22px; }
167
+
126
168
  /* ---------- banner, toast ---------- */
127
169
  .banner { padding: 6px 12px; background: var(--warn-bg); color: var(--text); border-bottom: 1px solid var(--border); font-size: 11px; flex: none; }
128
170
  .banner div { padding-left: 16px; position: relative; }
@@ -175,6 +217,12 @@ button.ib.active .glyph { color: var(--accent); }
175
217
  @keyframes flash { from { box-shadow: inset 3px 0 0 var(--warn); background: var(--warn-bg); } to { box-shadow: none; background: transparent; } }
176
218
  .empty { padding: 28px 18px; color: var(--text-dim); text-align: center; line-height: 1.6; }
177
219
  .empty code { font-family: var(--mono); font-size: 11px; background: var(--bg-inset); padding: 1px 5px; border-radius: 4px; }
220
+ .empty .empty-head { color: var(--text); font-weight: 600; margin-bottom: 6px; }
221
+ .empty .empty-tracking { color: var(--text); background: var(--bg-inset); border-radius: 6px; padding: 6px 10px; margin: 0 auto 8px; display: inline-block; max-width: 46em; }
222
+ .empty-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
223
+ .empty-actions button { border: 1px solid var(--border); }
224
+ .empty-actions button.primary { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
225
+ .empty-actions input.empty-match { border: 1px solid var(--border); border-radius: 4px; padding: 0 6px; height: 24px; background: var(--bg-inset); width: 12em; }
178
226
 
179
227
  /* ---------- details ---------- */
180
228
  .details { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
@@ -324,6 +372,7 @@ details.obj pre { margin: 4px 0 0 12px; font: 11px/1.4 var(--mono); white-space:
324
372
  .opt input[type="text"], .opt input[type="number"] { height: 24px; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg); color: inherit; font: inherit; }
325
373
  .opt input[type="text"]:focus, .opt input[type="number"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-bg); }
326
374
  .drawer .meta { color: var(--text-dim); margin-top: 4px; }
375
+ .drawer .report-link { display: inline-block; margin-top: 8px; font-weight: 600; }
327
376
 
328
377
  /* ---------- sessions, compare, commit priority ---------- */
329
378
  button.ib.rec .glyph { color: var(--danger); animation: blink 1.2s ease-in-out infinite; }