Repository navigation
Conversation
Converts all 2453 vi.mock/vi.doMock string specifiers to the dynamic
import() form the rule requires. Vitest rewrites vi.mock(import('x'))
back to vi.mock('x') during hoisting, so runtime behaviour is unchanged.
The import() overload types the factory against the real module, which
surfaced 1885 pre-existing mock/module mismatches. Those call sites carry
an explicit <unknown> type argument, preserving the contract the string
overload already gave them; the remaining 580 keep full inferred typing.
Also removes a dead mock of @/composables/graph/useVueNodeLifecycle, a
module deleted in the ECS migration (#14246).
The vitest guidance auto-loads on every *.test.ts edit and pointed at nine examples that now fail lint. Also records what a <unknown> type argument means so it is not copied into new mocks.
|
Important Review skippedToo many files! This PR contains 643 files, which is 343 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (643)
You can disable this status message by setting the Comment |
🎨 Storybook: ✅ Built — View Storybook🎭 Playwright: ✅ 1885 passed, 0 failed📊 Browser Reports
📦 Bundle: 9.61 MB gzip ⚪ 0 BDetailsSummary
Category Glance App Entry Points — 3.78 kB (baseline 3.78 kB) • ⚪ 0 BMain entry bundles and manifests Status: 1 unchanged Graph Workspace — 1.4 MB (baseline 1.4 MB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration Status: 3 unchanged Views & Navigation — 124 kB (baseline 124 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces Status: 17 unchanged Panels & Settings — 622 kB (baseline 622 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens Status: 28 unchanged User & Accounts — 27.5 kB (baseline 27.5 kB) • ⚪ 0 BAuthentication, profile, and account management bundles Status: 11 unchanged Editors & Dialogs — 126 kB (baseline 126 kB) • ⚪ 0 BModals, dialogs, drawers, and in-app editors Status: 8 unchanged UI Components — 115 kB (baseline 115 kB) • ⚪ 0 BReusable component library chunks Status: 15 unchanged Data & Services — 3.56 MB (baseline 3.56 MB) • ⚪ 0 BStores, services, APIs, and repositories Status: 17 unchanged Utilities & Hooks — 555 kB (baseline 555 kB) • ⚪ 0 BHelpers, composables, and utility bundles Status: 37 unchanged Vendor & Third-Party — 18.1 MB (baseline 18.1 MB) • ⚪ 0 BExternal libraries and shared vendor chunks Status: 18 unchanged Other — 16.2 MB (baseline 16.2 MB) • ⚪ 0 BBundles that do not match a named category Status: 296 unchanged ⚡ Performance Report
Show regressions
All metrics
Historical variance (last 15 runs)
Trend (last 15 commits on main)
Raw data{
"timestamp": "2026-08-28T07:49:29.394Z",
"gitSha": "14495b768ebafa462da39d6f42510956b2c85387",
"branch": "glary/enable-vitest-prefer-import-in-mock",
"measurements": [
{
"name": "canvas-idle",
"durationMs": 2087.4500000000467,
"styleRecalcs": 11,
"styleRecalcDurationMs": 11.683,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 606.37,
"heapDeltaBytes": 11814392,
"heapUsedBytes": 79849300,
"domNodes": -278,
"jsHeapTotalBytes": 4972544,
"scriptDurationMs": 12.443,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-idle",
"durationMs": 2050.982999999974,
"styleRecalcs": 7,
"styleRecalcDurationMs": 7.4959999999999996,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 568.612,
"heapDeltaBytes": -7103160,
"heapUsedBytes": 56107540,
"domNodes": -284,
"jsHeapTotalBytes": 4186112,
"scriptDurationMs": 12.046999999999999,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-mouse-sweep",
"durationMs": 2081.7260000000033,
"styleRecalcs": 77,
"styleRecalcDurationMs": 41.465,
"layouts": 12,
"layoutDurationMs": 3.62,
"taskDurationMs": 1016.8660000000001,
"heapDeltaBytes": -8513292,
"heapUsedBytes": 59431948,
"domNodes": -281,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 180.35999999999999,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "canvas-mouse-sweep",
"durationMs": 1906.1189999999897,
"styleRecalcs": 76,
"styleRecalcDurationMs": 40.058,
"layouts": 12,
"layoutDurationMs": 3.358,
"taskDurationMs": 982.93,
"heapDeltaBytes": -7401036,
"heapUsedBytes": 61189268,
"domNodes": -279,
"jsHeapTotalBytes": 6283264,
"scriptDurationMs": 176.069,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1709.9329999999782,
"styleRecalcs": 31,
"styleRecalcDurationMs": 17.3,
"layouts": 6,
"layoutDurationMs": 0.5499999999999999,
"taskDurationMs": 387.32099999999997,
"heapDeltaBytes": 3525612,
"heapUsedBytes": 67483528,
"domNodes": 73,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 12.25,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "canvas-zoom-sweep",
"durationMs": 1688.085000000001,
"styleRecalcs": 31,
"styleRecalcDurationMs": 17.991,
"layouts": 6,
"layoutDurationMs": 0.625,
"taskDurationMs": 400.268,
"heapDeltaBytes": 3774676,
"heapUsedBytes": 67561792,
"domNodes": 78,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 13.547999999999998,
"eventListeners": 19,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "dom-widget-clipping",
"durationMs": 676.3429999999744,
"styleRecalcs": 11,
"styleRecalcDurationMs": 7.4990000000000006,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 472.30800000000005,
"heapDeltaBytes": 18506408,
"heapUsedBytes": 82235616,
"domNodes": 18,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 167.166,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "dom-widget-clipping",
"durationMs": 726.0660000000598,
"styleRecalcs": 11,
"styleRecalcDurationMs": 8.244,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 507.37999999999994,
"heapDeltaBytes": 19201196,
"heapUsedBytes": 87294836,
"domNodes": 18,
"jsHeapTotalBytes": 4718592,
"scriptDurationMs": 181.404,
"eventListeners": 2,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-idle",
"durationMs": 2043.5090000000287,
"styleRecalcs": 6,
"styleRecalcDurationMs": 5.815999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 705.7979999999999,
"heapDeltaBytes": -9321844,
"heapUsedBytes": 87919036,
"domNodes": -267,
"jsHeapTotalBytes": -1576960,
"scriptDurationMs": 40.28000000000001,
"eventListeners": -155,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-idle",
"durationMs": 2062.7889999999525,
"styleRecalcs": 4,
"styleRecalcDurationMs": 4.3969999999999985,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 666.562,
"heapDeltaBytes": 12388340,
"heapUsedBytes": 87129724,
"domNodes": -275,
"jsHeapTotalBytes": -1875968,
"scriptDurationMs": 41.376999999999995,
"eventListeners": -183,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-pan",
"durationMs": 2637.426000000005,
"styleRecalcs": 64,
"styleRecalcDurationMs": 9.623000000000003,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1745.995,
"heapDeltaBytes": 19064108,
"heapUsedBytes": 84653468,
"domNodes": -274,
"jsHeapTotalBytes": 1536000,
"scriptDurationMs": 895.359,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "large-graph-pan",
"durationMs": 2508.267000000046,
"styleRecalcs": 63,
"styleRecalcDurationMs": 8.888999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 1729.809,
"heapDeltaBytes": 19361832,
"heapUsedBytes": 85131880,
"domNodes": 2,
"jsHeapTotalBytes": 487424,
"scriptDurationMs": 886.4499999999999,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.800000000000182
},
{
"name": "large-graph-zoom",
"durationMs": 3751.137999999969,
"styleRecalcs": 60,
"styleRecalcDurationMs": 9.946999999999997,
"layouts": 60,
"layoutDurationMs": 7.558000000000001,
"taskDurationMs": 1834.241,
"heapDeltaBytes": 13530684,
"heapUsedBytes": 81018428,
"domNodes": 0,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 868.167,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "large-graph-zoom",
"durationMs": 3708.904000000075,
"styleRecalcs": 60,
"styleRecalcDurationMs": 10.245000000000001,
"layouts": 60,
"layoutDurationMs": 7.4079999999999995,
"taskDurationMs": 1827.853,
"heapDeltaBytes": 14807740,
"heapUsedBytes": 81010140,
"domNodes": 0,
"jsHeapTotalBytes": 0,
"scriptDurationMs": 860.241,
"eventListeners": 10,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "legacy-node-drag",
"durationMs": 3254.613000000006,
"styleRecalcs": 40,
"styleRecalcDurationMs": 5.139999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2147.3970000000004,
"heapDeltaBytes": 24003056,
"heapUsedBytes": 91280576,
"domNodes": 0,
"jsHeapTotalBytes": 417792,
"scriptDurationMs": 1099.905,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "legacy-node-drag",
"durationMs": 3245.9139999999707,
"styleRecalcs": 40,
"styleRecalcDurationMs": 4.866000000000002,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 2097.738,
"heapDeltaBytes": 23652448,
"heapUsedBytes": 90842296,
"domNodes": 0,
"jsHeapTotalBytes": 679936,
"scriptDurationMs": 1060.052,
"eventListeners": 188,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2057.976999999994,
"styleRecalcs": 4,
"styleRecalcDurationMs": 3.724999999999999,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 692.4010000000001,
"heapDeltaBytes": -14143156,
"heapUsedBytes": 88157692,
"domNodes": -270,
"jsHeapTotalBytes": -1052672,
"scriptDurationMs": 44.885999999999996,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "minimap-idle",
"durationMs": 2042.3540000000457,
"styleRecalcs": 4,
"styleRecalcDurationMs": 4.930000000000001,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 668.1669999999999,
"heapDeltaBytes": -14108500,
"heapUsedBytes": 88436960,
"domNodes": -273,
"jsHeapTotalBytes": -1052672,
"scriptDurationMs": 44.437000000000005,
"eventListeners": -153,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 587.6569999999788,
"styleRecalcs": 48,
"styleRecalcDurationMs": 10.764,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 400.866,
"heapDeltaBytes": 14360204,
"heapUsedBytes": 85548644,
"domNodes": 22,
"jsHeapTotalBytes": 5505024,
"scriptDurationMs": 140.898,
"eventListeners": 8,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-dom-widget-clipping",
"durationMs": 591.2019999999529,
"styleRecalcs": 46,
"styleRecalcDurationMs": 9.467999999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 405.974,
"heapDeltaBytes": 14565404,
"heapUsedBytes": 78675852,
"domNodes": 18,
"jsHeapTotalBytes": 5242880,
"scriptDurationMs": 141.666,
"eventListeners": 6,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-idle",
"durationMs": 2006.9489999999632,
"styleRecalcs": 11,
"styleRecalcDurationMs": 9.849,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 489.8370000000001,
"heapDeltaBytes": -5709844,
"heapUsedBytes": 59166016,
"domNodes": -295,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 7.532000000000001,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "subgraph-idle",
"durationMs": 2013.7230000000272,
"styleRecalcs": 9,
"styleRecalcDurationMs": 8.147,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 525.0989999999999,
"heapDeltaBytes": -11356260,
"heapUsedBytes": 59671844,
"domNodes": -298,
"jsHeapTotalBytes": 5496832,
"scriptDurationMs": 8.648,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.670000000000012,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1775.6640000000061,
"styleRecalcs": 79,
"styleRecalcDurationMs": 42.333000000000006,
"layouts": 16,
"layoutDurationMs": 4.5440000000000005,
"taskDurationMs": 895.811,
"heapDeltaBytes": -6253580,
"heapUsedBytes": 58811868,
"domNodes": -297,
"jsHeapTotalBytes": 4710400,
"scriptDurationMs": 118.859,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "subgraph-mouse-sweep",
"durationMs": 1752.6639999999816,
"styleRecalcs": 75,
"styleRecalcDurationMs": 34.03,
"layouts": 16,
"layoutDurationMs": 3.922,
"taskDurationMs": 799.7080000000001,
"heapDeltaBytes": -11757192,
"heapUsedBytes": 59203744,
"domNodes": -297,
"jsHeapTotalBytes": 6283264,
"scriptDurationMs": 106.743,
"eventListeners": -201,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "subgraph-transition-enter",
"durationMs": 1434.44199999999,
"styleRecalcs": 19,
"styleRecalcDurationMs": 34.03500000000001,
"layouts": 14,
"layoutDurationMs": 15.084,
"taskDurationMs": 1023.7559999999999,
"heapDeltaBytes": 21924320,
"heapUsedBytes": 104571836,
"domNodes": 13671,
"jsHeapTotalBytes": 11010048,
"scriptDurationMs": 34.194,
"eventListeners": 2381,
"totalBlockingTimeMs": 149,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.80000000000109
},
{
"name": "viewport-pan-sweep",
"durationMs": 8710.331999999995,
"styleRecalcs": 247,
"styleRecalcDurationMs": 34.302,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6155.144,
"heapDeltaBytes": -18857016,
"heapUsedBytes": 81533360,
"domNodes": -268,
"jsHeapTotalBytes": -1875968,
"scriptDurationMs": 2946.733,
"eventListeners": -137,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "viewport-pan-sweep",
"durationMs": 9151.918000000023,
"styleRecalcs": 248,
"styleRecalcDurationMs": 36.249,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 6428.811,
"heapDeltaBytes": -4468528,
"heapUsedBytes": 96281884,
"domNodes": -266,
"jsHeapTotalBytes": -1384448,
"scriptDurationMs": 3038.4849999999997,
"eventListeners": -167,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.666666666666668,
"p95FrameDurationMs": 16.700000000000728
},
{
"name": "vue-large-graph-idle",
"durationMs": 17241.026999999973,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 16767.713999999996,
"heapDeltaBytes": -33470608,
"heapUsedBytes": 175885820,
"domNodes": -6548,
"jsHeapTotalBytes": -2514944,
"scriptDurationMs": 314.026,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.780000000000047,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-idle",
"durationMs": 17866.57500000001,
"styleRecalcs": 0,
"styleRecalcDurationMs": 0,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 17260.761,
"heapDeltaBytes": -34024196,
"heapUsedBytes": 175500376,
"domNodes": -6548,
"jsHeapTotalBytes": -4612096,
"scriptDurationMs": 343.292,
"eventListeners": -7473,
"totalBlockingTimeMs": 0,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 21152.708000000017,
"styleRecalcs": 161,
"styleRecalcDurationMs": 26.62199999999998,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 20924.158,
"heapDeltaBytes": -37453996,
"heapUsedBytes": 165120996,
"domNodes": -6548,
"jsHeapTotalBytes": -2326528,
"scriptDurationMs": 1076.5200000000002,
"eventListeners": -7469,
"totalBlockingTimeMs": 167,
"frameDurationMs": 17.776666666666642,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "vue-large-graph-pan",
"durationMs": 22085.064999999988,
"styleRecalcs": 168,
"styleRecalcDurationMs": 22.740000000000038,
"layouts": 0,
"layoutDurationMs": 0,
"taskDurationMs": 21932.011,
"heapDeltaBytes": -22434752,
"heapUsedBytes": 187372544,
"domNodes": -6548,
"jsHeapTotalBytes": -6254592,
"scriptDurationMs": 1064.615,
"eventListeners": -7471,
"totalBlockingTimeMs": 206,
"frameDurationMs": 17.776666666666763,
"p95FrameDurationMs": 16.799999999999272
},
{
"name": "workflow-execution",
"durationMs": 122.48999999997068,
"styleRecalcs": 8,
"styleRecalcDurationMs": 17.511,
"layouts": 3,
"layoutDurationMs": 1.189,
"taskDurationMs": 92.92799999999998,
"heapDeltaBytes": 3314920,
"heapUsedBytes": 66223076,
"domNodes": 117,
"jsHeapTotalBytes": 524288,
"scriptDurationMs": 8.343,
"eventListeners": 49,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333335,
"p95FrameDurationMs": 16.699999999999818
},
{
"name": "workflow-execution",
"durationMs": 114.9679999999762,
"styleRecalcs": 8,
"styleRecalcDurationMs": 15.786000000000001,
"layouts": 3,
"layoutDurationMs": 1.1769999999999998,
"taskDurationMs": 83.94699999999999,
"heapDeltaBytes": 3127024,
"heapUsedBytes": 69384348,
"domNodes": 128,
"jsHeapTotalBytes": 262144,
"scriptDurationMs": 8.401999999999997,
"eventListeners": 25,
"totalBlockingTimeMs": 0,
"frameDurationMs": 16.66333333333332,
"p95FrameDurationMs": 16.700000000000728
}
]
} |
|
Nothing actionable in the review itself — CodeRabbit skipped it at 643 files against a 300-file plan limit. But I don't think that should just be waved through, because # Without this, a review that never happened (rate limit, internal error)
# still reports green, so an unreviewed PR is indistinguishable from a
# cleanly reviewed one.
fail_commit_status: trueThis is exactly the case that setting exists to catch, so expect a red status here — working as designed, not a flake. The file count isn't reducible while still enabling the rule: turning it on requires every violating call converted in the same commit, or lint is red on whatever is left behind. So it's either merge knowingly unreviewed, or split. A stack splits cleanly if you want the CodeRabbit pass — each part is independently green because the conversion is runtime-neutral and the
Each based on the previous so the diffs stay incremental. Parts 1 and 2 don't enable the rule, so they're no-ops that pass every gate on their own; part 3 is where it starts being enforced. My read is that the split buys little: the review value in this PR is the So I've left it as one PR. Say the word and I'll cut the stack above — the boundaries are already computed and it's mechanical from here. |
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #16174 +/- ##
==========================================
+ Coverage 80.62% 82.65% +2.03%
==========================================
Files 2315 1943 -372
Lines 118462 112187 -6275
Branches 33757 32839 -918
==========================================
- Hits 95507 92727 -2780
+ Misses 22387 19117 -3270
+ Partials 568 343 -225
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 383 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Superseded by independent domain PRs targeting
The lint rule and documentation will follow after these migrations merge. |
|
Agreed — closing in favour of the per-domain PRs is the right call, and I verified the split is lossless. One finding below that affects the "lint rule follows after these merge" step. Supersession is completeAll eight are open, non-draft, and target Diffing #16174's full file list against the union of the eight:
The 8 files not carried over break down cleanly:
So nothing was dropped. Heads-up: the rule won't go green after the eight mergeI ran oxlint 1.77.0 with
This isn't a gap in the original migration — I confirmed #16174's head ( Grouped roughly along your domain lines:
The agent tree dominates because it landed almost entirely after the split. Practical upshot: a ninth drift-catch pass is needed before flipping the rule to |
## Summary Migrates legacy `vi.mock` calls in core, service, store, and utility tests to the dynamic `import()` form as an independent slice of Comfy-Org#16174. ## Changes - **What**: Converts mocks across 81 files; legacy partial mocks use `<unknown>` to preserve the string overload's existing type contract. - **Breaking**: None. ## Review Focus This is a mechanical syntax migration. The lint rule and documentation are intentionally deferred until every domain slice has merged. Verified with the full pre-commit lint/typecheck gates, `pnpm knip`, and the combined unit suite (1,506 files; 20,337 passed). Co-authored-by: Amp <amp@ampcode.com>
## Summary Migrates legacy `vi.mock` calls in asset and workflow tests to the dynamic `import()` form as an independent slice of Comfy-Org#16174. ## Changes - **What**: Converts mocks across 55 files; legacy partial mocks use `<unknown>` to preserve the string overload's existing type contract. - **Breaking**: None. ## Review Focus This is a mechanical syntax migration. The lint rule and documentation are intentionally deferred until every domain slice has merged. Verified with the full pre-commit lint/typecheck gates, `pnpm knip`, and the combined unit suite (1,506 files; 20,337 passed). Co-authored-by: Amp <amp@ampcode.com>
## Summary Migrates legacy `vi.mock` calls in the remaining platform tests to the dynamic `import()` form as an independent slice of Comfy-Org#16174. ## Changes - **What**: Converts mocks across 79 files; legacy partial mocks use `<unknown>` to preserve the string overload's existing type contract. - **Breaking**: None. ## Review Focus This is a mechanical syntax migration. The lint rule and documentation are intentionally deferred until every domain slice has merged. Verified with the full pre-commit lint/typecheck gates, `pnpm knip`, and the combined unit suite (1,506 files; 20,337 passed). Co-authored-by: Amp <amp@ampcode.com>
…#17177) ## Summary Migrates legacy `vi.mock` calls in canvas, 3D, mask editor, and manager tests to the dynamic `import()` form as an independent slice of Comfy-Org#16174. ## Changes - **What**: Converts mocks across 61 files; legacy partial mocks use `<unknown>` to preserve the string overload's existing type contract. - **Breaking**: None. ## Review Focus This is a mechanical syntax migration. The lint rule and documentation are intentionally deferred until every domain slice has merged. Verified with the full pre-commit lint/typecheck gates, `pnpm knip`, and the combined unit suite (1,506 files; 20,337 passed). --------- Co-authored-by: Amp <amp@ampcode.com>
## Summary Migrates legacy `vi.mock` calls in renderer tests to the dynamic `import()` form as an independent slice of Comfy-Org#16174. ## Changes - **What**: Converts mocks across 95 files; legacy partial mocks use `<unknown>` to preserve the string overload's existing type contract. - **Breaking**: None. ## Review Focus This is a mechanical syntax migration. The lint rule and documentation are intentionally deferred until every domain slice has merged. The image-preview Knip exception remains string-form so custom-node-only exports stay visible to unused-export analysis. Verified with the full pre-commit lint/typecheck gates, `pnpm knip`, and the combined unit suite (1,506 files; 20,337 passed). --------- Co-authored-by: Amp <amp@ampcode.com>
## Summary Migrates legacy `vi.mock` calls in the remaining component tests to the dynamic `import()` form as an independent slice of Comfy-Org#16174. ## Changes - **What**: Converts mocks across 95 files; legacy partial mocks use `<unknown>` to preserve the string overload's existing type contract. - **Breaking**: None. ## Review Focus This is a mechanical syntax migration. The lint rule and documentation are intentionally deferred until every domain slice has merged. Verified with the full pre-commit lint/typecheck gates, `pnpm knip`, and the combined unit suite (1,506 files; 20,337 passed). --------- Co-authored-by: Amp <amp@ampcode.com>
## Summary Migrates legacy `vi.mock` calls in shared composable tests to the dynamic `import()` form as an independent slice of Comfy-Org#16174. ## Changes - **What**: Converts mocks across 85 files; legacy partial mocks use `<unknown>` to preserve the string overload's existing type contract. - **Breaking**: None. ## Review Focus This is a mechanical syntax migration. The lint rule and documentation are intentionally deferred until every domain slice has merged. Verified with the full pre-commit lint/typecheck gates, `pnpm knip`, and the combined unit suite (1,506 files; 20,337 passed). Co-authored-by: Amp <amp@ampcode.com>
## Summary Migrates legacy `vi.mock` calls in cloud and workspace tests to the dynamic `import()` form as an independent slice of Comfy-Org#16174. ## Changes - **What**: Converts mocks across 84 files; legacy partial mocks use `<unknown>` to preserve the string overload's existing type contract. - **Breaking**: None. ## Review Focus This is a mechanical syntax migration. The lint rule and documentation are intentionally deferred until every domain slice has merged. Verified with the full pre-commit lint/typecheck gates, `pnpm knip`, and the combined unit suite (1,506 files; 20,337 passed). Co-authored-by: Amp <amp@ampcode.com>
PR Created by the Glary-Bot Agent
Summary
Turns on
vitest/prefer-import-in-mockand converts the 2,452vi.mockcall sites it flagged to the dynamic-import form.Changes
"vitest/prefer-import-in-mock": "error"in.oxlintrc.json;vi.mock('x', factory)→vi.mock(import('x'), factory)across 637 test files (applied withoxlint --fix, thenoxfmt). Docs updated so the guidance that auto-loads on every test edit teaches the new form.vi.mock(import('x'))back tovi.mock('x')before anything else sees it, so this is a compile-time-only change.Review Focus
The
<unknown>type arguments are the thing to weigh in on. Theimport()overload ismock<T>(module: Promise<T>, factory?: ModuleMockFactoryWithHelper<T>), which types the factory's return againstPartial<RealModule>. The string overload leftT = unknown, soPartial<unknown>={}and any factory passed. Flipping the form therefore turned on factory type-checking everywhere at once: 1,873 of 2,452 sites failedpnpm typecheck(0 errors onmain).Those failures are not fixable mechanically. The dominant pattern here — documented in
docs/testing/vitest-patterns.md— mocks a composable by returning a subset of its return value, andPartial<Module>only relaxes the module's top-level keys, so that shape cannot satisfy the typed overload at all. Making them conform means redesigning the mocks case by case, which is a test-architecture project, not a lint change (and the alternative,as unknown ascasts at ~1,800 sites, is barred by AGENTS.md).So those 1,873 sites carry an explicit
vi.mock<unknown>(import('…'), …), which reproduces exactly the contract the string overload already gave them. 579 sites keep full inferred typing — those are the mocks that were already faithful to their module.<unknown>is a legacy marker, not a pattern to copy;docs/guidance/vitest.mdnow says so. Worth notingvitest/require-mock-type-parametersisoff, so nothing yet stops it being pasted into new mocks — a follow-upcomfy/*guard would be reasonable.Two things the rule caught that are worth a look:
GraphCanvas.firstRunEntry.test.tsmocked@/composables/graph/useVueNodeLifecycle, a module deleted in the ECS migration (Still Draft Feature: ECS Migration #14246). The string form accepted the dead path silently;import()does not. Removed — the only behavioural change in the diff.useImagePreviewWidget.test.tskeeps the string form behind anoxlint-disable-next-line. Converting it makes knip treat every export of@/scripts/ui/imagePreviewas used, which retires the@knipIgnoreUnusedButUsedByCustomNodestag oncreateImageHost— a function with no in-repo consumer that exists for custom nodes. Deleting that tag to satisfytreatTagHintsAsErrorsseemed worse than one documented exception; happy to flip it if you disagree.Enforcement gap to be aware of: 225 string-form calls remain in 71 files under
src/extensions(143),src/scripts(42),apps/website(24),tools/test-recorder(14) andvitest.setup.ts. All sit outsideoxlint:main's scope viaignorePatternsor its path list, so the rule never sees them.tools/oxlint-plugins/vitestCleanup.config.jsonalready targets those exact zones if you want them covered.Side effect on knip: every dynamically imported mocked module now counts as fully used, which weakens unused-export detection for the ~690 mocked modules. Only one tag hint surfaced today (above), but it is a real trade-off.
Verification
pnpm typecheck0 errors ·pnpm lint0 errors (79 pre-existing warnings) ·pnpm format:checkclean ·pnpm knipclean ·pnpm buildclean. Both commits went through the real pre-commit hooks, no--no-verify.pnpm test:unit: 18,273 passed. The 2 failing files fail onmaintoo —useFirstRunTourControlleractually fails more onmain(3 vs 2), and its post-hoist output is byte-identical tomain's.hoistMockstransform was run over both revisions of all 639 changed files — 638 produce identical post-transform code, the 639th being the dead-mock removal.oxlint --fixconverts it, re-lint exits 0.