@oxog/react-check 1.2.0 → 1.3.1
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 +129 -0
- package/README.md +177 -62
- package/dist/browser-inject.global.js +13 -13
- package/dist/chain.cjs +8 -531
- package/dist/chain.cjs.map +1 -1
- package/dist/chain.d.cts +2 -2
- package/dist/chain.d.ts +2 -2
- package/dist/chain.js +2 -533
- package/dist/chain.js.map +1 -1
- package/dist/chunk-35I3PLS3.js +751 -0
- package/dist/chunk-35I3PLS3.js.map +1 -0
- package/dist/chunk-7R4KKJTW.cjs +255 -0
- package/dist/chunk-7R4KKJTW.cjs.map +1 -0
- package/dist/chunk-DSXOHC6R.cjs +755 -0
- package/dist/chunk-DSXOHC6R.cjs.map +1 -0
- package/dist/chunk-DWM55ACO.cjs +294 -0
- package/dist/chunk-DWM55ACO.cjs.map +1 -0
- package/dist/chunk-GS7T56RP.cjs +9 -0
- package/dist/chunk-GS7T56RP.cjs.map +1 -0
- package/dist/chunk-LFY7MUHJ.cjs +483 -0
- package/dist/chunk-LFY7MUHJ.cjs.map +1 -0
- package/dist/chunk-NLWGB4IE.cjs +380 -0
- package/dist/chunk-NLWGB4IE.cjs.map +1 -0
- package/dist/chunk-PIXJPQO7.js +481 -0
- package/dist/chunk-PIXJPQO7.js.map +1 -0
- package/dist/chunk-REEPUD73.js +362 -0
- package/dist/chunk-REEPUD73.js.map +1 -0
- package/dist/chunk-RQYHXWUC.js +292 -0
- package/dist/chunk-RQYHXWUC.js.map +1 -0
- package/dist/chunk-WLN7ZVO4.js +253 -0
- package/dist/chunk-WLN7ZVO4.js.map +1 -0
- package/dist/cli.js +1195 -297
- package/dist/cli.js.map +1 -1
- package/dist/detect.cjs +22 -324
- package/dist/detect.cjs.map +1 -1
- package/dist/detect.d.cts +8 -2
- package/dist/detect.d.ts +8 -2
- package/dist/detect.js +1 -324
- package/dist/detect.js.map +1 -1
- package/dist/{event-emitter-CxKUDo9q.d.cts → event-emitter-BVYUPYLd.d.cts} +3 -2
- package/dist/{event-emitter-CxKUDo9q.d.ts → event-emitter-BVYUPYLd.d.ts} +3 -2
- package/dist/fix.cjs +6 -715
- package/dist/fix.cjs.map +1 -1
- package/dist/fix.d.cts +8 -2
- package/dist/fix.d.ts +8 -2
- package/dist/fix.js +2 -719
- package/dist/fix.js.map +1 -1
- package/dist/index.cjs +1400 -3075
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +237 -57
- package/dist/index.d.ts +237 -57
- package/dist/index.js +1222 -2970
- package/dist/index.js.map +1 -1
- package/dist/{scanner-Cc2187fH.d.ts → scanner-BJFA0354.d.ts} +33 -4
- package/dist/{scanner-S7BtVIpW.d.cts → scanner-DZL2rIFv.d.cts} +33 -4
- package/dist/scanner.cjs +8 -1652
- package/dist/scanner.cjs.map +1 -1
- package/dist/scanner.d.cts +3 -3
- package/dist/scanner.d.ts +3 -3
- package/dist/scanner.js +4 -1656
- package/dist/scanner.js.map +1 -1
- package/dist/{types-DuZyBVVV.d.cts → types-BMDemwIs.d.cts} +35 -10
- package/dist/{types-DuZyBVVV.d.ts → types-BMDemwIs.d.ts} +35 -10
- package/package.json +16 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as ComponentStats, f as Severity, l as ThresholdOptions, R as RenderInfo, j as SessionSummary, c as RenderChainInfo, g as FixSuggestion, d as ScannerConfig } from './types-
|
|
2
|
-
import { E as EventEmitter } from './event-emitter-
|
|
1
|
+
import { h as ComponentStats, f as Severity, l as ThresholdOptions, R as RenderInfo, j as SessionSummary, c as RenderChainInfo, g as FixSuggestion, d as ScannerConfig, o as RuleOptions } from './types-BMDemwIs.js';
|
|
2
|
+
import { E as EventEmitter } from './event-emitter-BVYUPYLd.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Statistics collector for component render data
|
|
@@ -208,6 +208,8 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
|
|
|
208
208
|
private chainAnalyzer;
|
|
209
209
|
/** Fix suggester */
|
|
210
210
|
private fixSuggester;
|
|
211
|
+
/** Components whose stats changed since their suggestions were last generated */
|
|
212
|
+
private staleSuggestions;
|
|
211
213
|
/** Scanner configuration */
|
|
212
214
|
private config;
|
|
213
215
|
/** Whether scanner is currently running */
|
|
@@ -230,6 +232,8 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
|
|
|
230
232
|
constructor(options?: {
|
|
231
233
|
config?: Partial<ScannerConfig>;
|
|
232
234
|
thresholds?: Partial<ThresholdOptions>;
|
|
235
|
+
/** Fix-suggestion rule levels by rule id (`off` disables a rule) */
|
|
236
|
+
rules?: RuleOptions;
|
|
233
237
|
});
|
|
234
238
|
/**
|
|
235
239
|
* Set up event forwarding from sub-modules
|
|
@@ -250,13 +254,32 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
|
|
|
250
254
|
/**
|
|
251
255
|
* Process a render event
|
|
252
256
|
* @param render - Render information
|
|
253
|
-
* @param parent - Optional parent component name
|
|
257
|
+
* @param parent - Optional parent component name (defaults to `render.parent`,
|
|
258
|
+
* which the injected browser script fills in from the fiber tree)
|
|
254
259
|
*/
|
|
255
260
|
addRender(render: RenderInfo, parent?: string): void;
|
|
256
261
|
/**
|
|
257
|
-
*
|
|
262
|
+
* Check a component name against the configured include/exclude patterns
|
|
263
|
+
* @param name - Component name
|
|
264
|
+
* @returns true if renders of this component should be tracked
|
|
265
|
+
*/
|
|
266
|
+
isComponentIncluded(name: string): boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Record a painted frame for FPS calculation (the scanner derives FPS from
|
|
269
|
+
* frames recorded during each one-second window)
|
|
258
270
|
*/
|
|
259
271
|
recordFrame(): void;
|
|
272
|
+
/**
|
|
273
|
+
* Record an FPS sample measured elsewhere (e.g. by requestAnimationFrame in
|
|
274
|
+
* the browser)
|
|
275
|
+
* @param fps - Frames per second
|
|
276
|
+
*/
|
|
277
|
+
recordFps(fps: number): void;
|
|
278
|
+
/**
|
|
279
|
+
* FPS threshold below which `fps-drop` is emitted
|
|
280
|
+
* @returns Threshold
|
|
281
|
+
*/
|
|
282
|
+
private getFpsThreshold;
|
|
260
283
|
/**
|
|
261
284
|
* Schedule batch processing
|
|
262
285
|
*/
|
|
@@ -335,6 +358,12 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
|
|
|
335
358
|
* @returns All suggestions
|
|
336
359
|
*/
|
|
337
360
|
getSuggestions(): FixSuggestion[];
|
|
361
|
+
/**
|
|
362
|
+
* Re-generate cached suggestions whose component received renders since they
|
|
363
|
+
* were created, so their text, numbers and severity match the current stats
|
|
364
|
+
* @param componentName - Only refresh this component (all when omitted)
|
|
365
|
+
*/
|
|
366
|
+
private refreshSuggestions;
|
|
338
367
|
/**
|
|
339
368
|
* Get suggestions for a specific component
|
|
340
369
|
* @param componentName - Component name
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { h as ComponentStats, f as Severity, l as ThresholdOptions, R as RenderInfo, j as SessionSummary, c as RenderChainInfo, g as FixSuggestion, d as ScannerConfig } from './types-
|
|
2
|
-
import { E as EventEmitter } from './event-emitter-
|
|
1
|
+
import { h as ComponentStats, f as Severity, l as ThresholdOptions, R as RenderInfo, j as SessionSummary, c as RenderChainInfo, g as FixSuggestion, d as ScannerConfig, o as RuleOptions } from './types-BMDemwIs.cjs';
|
|
2
|
+
import { E as EventEmitter } from './event-emitter-BVYUPYLd.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Statistics collector for component render data
|
|
@@ -208,6 +208,8 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
|
|
|
208
208
|
private chainAnalyzer;
|
|
209
209
|
/** Fix suggester */
|
|
210
210
|
private fixSuggester;
|
|
211
|
+
/** Components whose stats changed since their suggestions were last generated */
|
|
212
|
+
private staleSuggestions;
|
|
211
213
|
/** Scanner configuration */
|
|
212
214
|
private config;
|
|
213
215
|
/** Whether scanner is currently running */
|
|
@@ -230,6 +232,8 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
|
|
|
230
232
|
constructor(options?: {
|
|
231
233
|
config?: Partial<ScannerConfig>;
|
|
232
234
|
thresholds?: Partial<ThresholdOptions>;
|
|
235
|
+
/** Fix-suggestion rule levels by rule id (`off` disables a rule) */
|
|
236
|
+
rules?: RuleOptions;
|
|
233
237
|
});
|
|
234
238
|
/**
|
|
235
239
|
* Set up event forwarding from sub-modules
|
|
@@ -250,13 +254,32 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
|
|
|
250
254
|
/**
|
|
251
255
|
* Process a render event
|
|
252
256
|
* @param render - Render information
|
|
253
|
-
* @param parent - Optional parent component name
|
|
257
|
+
* @param parent - Optional parent component name (defaults to `render.parent`,
|
|
258
|
+
* which the injected browser script fills in from the fiber tree)
|
|
254
259
|
*/
|
|
255
260
|
addRender(render: RenderInfo, parent?: string): void;
|
|
256
261
|
/**
|
|
257
|
-
*
|
|
262
|
+
* Check a component name against the configured include/exclude patterns
|
|
263
|
+
* @param name - Component name
|
|
264
|
+
* @returns true if renders of this component should be tracked
|
|
265
|
+
*/
|
|
266
|
+
isComponentIncluded(name: string): boolean;
|
|
267
|
+
/**
|
|
268
|
+
* Record a painted frame for FPS calculation (the scanner derives FPS from
|
|
269
|
+
* frames recorded during each one-second window)
|
|
258
270
|
*/
|
|
259
271
|
recordFrame(): void;
|
|
272
|
+
/**
|
|
273
|
+
* Record an FPS sample measured elsewhere (e.g. by requestAnimationFrame in
|
|
274
|
+
* the browser)
|
|
275
|
+
* @param fps - Frames per second
|
|
276
|
+
*/
|
|
277
|
+
recordFps(fps: number): void;
|
|
278
|
+
/**
|
|
279
|
+
* FPS threshold below which `fps-drop` is emitted
|
|
280
|
+
* @returns Threshold
|
|
281
|
+
*/
|
|
282
|
+
private getFpsThreshold;
|
|
260
283
|
/**
|
|
261
284
|
* Schedule batch processing
|
|
262
285
|
*/
|
|
@@ -335,6 +358,12 @@ declare class Scanner extends EventEmitter<ScannerEvents> {
|
|
|
335
358
|
* @returns All suggestions
|
|
336
359
|
*/
|
|
337
360
|
getSuggestions(): FixSuggestion[];
|
|
361
|
+
/**
|
|
362
|
+
* Re-generate cached suggestions whose component received renders since they
|
|
363
|
+
* were created, so their text, numbers and severity match the current stats
|
|
364
|
+
* @param componentName - Only refresh this component (all when omitted)
|
|
365
|
+
*/
|
|
366
|
+
private refreshSuggestions;
|
|
338
367
|
/**
|
|
339
368
|
* Get suggestions for a specific component
|
|
340
369
|
* @param componentName - Component name
|