rerender-lens 0.3.0 → 0.5.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/CHANGELOG.md +118 -0
- package/README.md +192 -353
- package/dist/{budget-COBu7jBU.d.cts → budget-BnJlYwrV.d.ts} +20 -10
- package/dist/{budget-LkNjGtRc.d.ts → budget-CRswn-nC.d.cts} +20 -10
- package/dist/cli.cjs +248 -31
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +248 -31
- package/dist/cli.js.map +1 -1
- package/dist/{devtools-BHGUUo-p.d.ts → devtools-BYWat7nQ.d.ts} +17 -3
- package/dist/{devtools-DmhWiWcN.d.cts → devtools-DJi_6AfJ.d.cts} +17 -3
- package/dist/index.cjs +635 -109
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +131 -8
- package/dist/index.d.ts +131 -8
- package/dist/index.js +620 -110
- package/dist/index.js.map +1 -1
- package/dist/jest-setup.cjs +1673 -0
- package/dist/jest-setup.cjs.map +1 -0
- package/dist/jest-setup.d.cts +8 -0
- package/dist/jest-setup.d.ts +8 -0
- package/dist/jest-setup.js +1671 -0
- package/dist/jest-setup.js.map +1 -0
- package/dist/jest.cjs +1760 -0
- package/dist/jest.cjs.map +1 -0
- package/dist/jest.d.cts +23 -0
- package/dist/jest.d.ts +23 -0
- package/dist/jest.js +1751 -0
- package/dist/jest.js.map +1 -0
- package/dist/{notifiers-BjjGSHpp.d.ts → notifiers-DwKlvv4H.d.cts} +8 -4
- package/dist/{notifiers-BGQtWKfX.d.cts → notifiers-FNzKHs0a.d.ts} +8 -4
- package/dist/playwright.cjs +235 -30
- package/dist/playwright.cjs.map +1 -1
- package/dist/playwright.d.cts +8 -6
- package/dist/playwright.d.ts +8 -6
- package/dist/playwright.js +235 -31
- package/dist/playwright.js.map +1 -1
- package/dist/relay.cjs +10 -2
- package/dist/relay.cjs.map +1 -1
- package/dist/relay.js +10 -2
- package/dist/relay.js.map +1 -1
- package/dist/rerender-lens.iife.js +1100 -337
- package/dist/runner-report-B8Sc3FZO.d.cts +46 -0
- package/dist/runner-report-CW8X5RwK.d.ts +46 -0
- package/dist/setup.cjs +308 -95
- package/dist/setup.cjs.map +1 -1
- package/dist/setup.js +308 -95
- package/dist/setup.js.map +1 -1
- package/dist/{types-BzUEVkxJ.d.cts → types-DW5-N2XH.d.cts} +55 -2
- package/dist/{types-BzUEVkxJ.d.ts → types-DW5-N2XH.d.ts} +55 -2
- package/dist/vite.d.cts +1 -1
- package/dist/vite.d.ts +1 -1
- package/dist/vitest-setup.cjs +452 -87
- package/dist/vitest-setup.cjs.map +1 -1
- package/dist/vitest-setup.d.cts +4 -4
- package/dist/vitest-setup.d.ts +4 -4
- package/dist/vitest-setup.js +452 -87
- package/dist/vitest-setup.js.map +1 -1
- package/dist/vitest.cjs +515 -123
- package/dist/vitest.cjs.map +1 -1
- package/dist/vitest.d.cts +21 -39
- package/dist/vitest.d.ts +21 -39
- package/dist/vitest.js +516 -124
- package/dist/vitest.js.map +1 -1
- package/package.json +41 -5
- package/panel/panel.css +1 -34
- package/panel/panel.js +865 -713
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { R as RenderReport, O as Options } from './types-DW5-N2XH.cjs';
|
|
2
|
+
import { C as Collector } from './notifiers-DwKlvv4H.cjs';
|
|
3
|
+
|
|
4
|
+
/** Environment variable carrying the path of the run's JSONL file from the reporter to the workers. */
|
|
5
|
+
declare const OUT_ENV = "RERENDER_LENS_OUT";
|
|
6
|
+
interface SetupOptions extends Omit<Options, 'notifier'> {
|
|
7
|
+
/** Also fail each test file that recorded avoidable re-renders (default false: the reporter decides). */
|
|
8
|
+
failFast?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** How the setup ties into the test runner (`{ afterAll }` from the runner's globals). */
|
|
11
|
+
interface SetupHooks {
|
|
12
|
+
afterAll?: (fn: () => void) => void;
|
|
13
|
+
/** Path of the current test file, for the reporter's output. */
|
|
14
|
+
testPath?: () => string | undefined;
|
|
15
|
+
}
|
|
16
|
+
interface LensSetup {
|
|
17
|
+
collector: Collector;
|
|
18
|
+
/** Append this file's reports to the shared output and clear the collector; registered with `afterAll` when given. */
|
|
19
|
+
flush(): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Call from a setup file. Creates the DevTools hook before react-dom loads, starts the library with
|
|
23
|
+
* a collector, and appends this file's reports to the shared output when it ends. The collector is
|
|
24
|
+
* returned for per-test assertions (`assertNoAvoidable`, `assertWithinBudget`).
|
|
25
|
+
*/
|
|
26
|
+
declare function setupRerenderLens(options?: SetupOptions, hooks?: SetupHooks): LensSetup;
|
|
27
|
+
interface ReporterOptions {
|
|
28
|
+
/** Path to a budget JSON (`{ "*": 0, "Row": 2 }`). When set, the run fails on violations. */
|
|
29
|
+
budget?: string;
|
|
30
|
+
/** Print at most this many fixes. Default 10. */
|
|
31
|
+
limit?: number;
|
|
32
|
+
/** Also write the collected reports here as a panel-compatible export (`Sessions > Import`). */
|
|
33
|
+
exportTo?: string;
|
|
34
|
+
/** Where the lines go. Default `process.stdout`. */
|
|
35
|
+
write?: (line: string) => void;
|
|
36
|
+
}
|
|
37
|
+
interface RunResult {
|
|
38
|
+
/** Every report of the run, from every worker. */
|
|
39
|
+
reports: RenderReport[];
|
|
40
|
+
/** Set when a budget file was given and exceeded; the run must fail. */
|
|
41
|
+
error: Error | null;
|
|
42
|
+
}
|
|
43
|
+
/** Reports from every worker of a run. */
|
|
44
|
+
declare function readRun(file: string): RenderReport[];
|
|
45
|
+
|
|
46
|
+
export { type LensSetup as L, OUT_ENV as O, type ReporterOptions as R, type SetupHooks as S, type RunResult as a, type SetupOptions as b, readRun as r, setupRerenderLens as s };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { R as RenderReport, O as Options } from './types-DW5-N2XH.js';
|
|
2
|
+
import { C as Collector } from './notifiers-FNzKHs0a.js';
|
|
3
|
+
|
|
4
|
+
/** Environment variable carrying the path of the run's JSONL file from the reporter to the workers. */
|
|
5
|
+
declare const OUT_ENV = "RERENDER_LENS_OUT";
|
|
6
|
+
interface SetupOptions extends Omit<Options, 'notifier'> {
|
|
7
|
+
/** Also fail each test file that recorded avoidable re-renders (default false: the reporter decides). */
|
|
8
|
+
failFast?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** How the setup ties into the test runner (`{ afterAll }` from the runner's globals). */
|
|
11
|
+
interface SetupHooks {
|
|
12
|
+
afterAll?: (fn: () => void) => void;
|
|
13
|
+
/** Path of the current test file, for the reporter's output. */
|
|
14
|
+
testPath?: () => string | undefined;
|
|
15
|
+
}
|
|
16
|
+
interface LensSetup {
|
|
17
|
+
collector: Collector;
|
|
18
|
+
/** Append this file's reports to the shared output and clear the collector; registered with `afterAll` when given. */
|
|
19
|
+
flush(): void;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Call from a setup file. Creates the DevTools hook before react-dom loads, starts the library with
|
|
23
|
+
* a collector, and appends this file's reports to the shared output when it ends. The collector is
|
|
24
|
+
* returned for per-test assertions (`assertNoAvoidable`, `assertWithinBudget`).
|
|
25
|
+
*/
|
|
26
|
+
declare function setupRerenderLens(options?: SetupOptions, hooks?: SetupHooks): LensSetup;
|
|
27
|
+
interface ReporterOptions {
|
|
28
|
+
/** Path to a budget JSON (`{ "*": 0, "Row": 2 }`). When set, the run fails on violations. */
|
|
29
|
+
budget?: string;
|
|
30
|
+
/** Print at most this many fixes. Default 10. */
|
|
31
|
+
limit?: number;
|
|
32
|
+
/** Also write the collected reports here as a panel-compatible export (`Sessions > Import`). */
|
|
33
|
+
exportTo?: string;
|
|
34
|
+
/** Where the lines go. Default `process.stdout`. */
|
|
35
|
+
write?: (line: string) => void;
|
|
36
|
+
}
|
|
37
|
+
interface RunResult {
|
|
38
|
+
/** Every report of the run, from every worker. */
|
|
39
|
+
reports: RenderReport[];
|
|
40
|
+
/** Set when a budget file was given and exceeded; the run must fail. */
|
|
41
|
+
error: Error | null;
|
|
42
|
+
}
|
|
43
|
+
/** Reports from every worker of a run. */
|
|
44
|
+
declare function readRun(file: string): RenderReport[];
|
|
45
|
+
|
|
46
|
+
export { type LensSetup as L, OUT_ENV as O, type ReporterOptions as R, type SetupHooks as S, type RunResult as a, type SetupOptions as b, readRun as r, setupRerenderLens as s };
|