fix(canon): preserve Vue 2 event arity#2540
Conversation
vize
@vizejs/fresco
@vizejs/musea-mcp-server
oxlint-plugin-vize
@vizejs/rspack-plugin
@vizejs/unplugin
@vizejs/vite-plugin
@vizejs/vite-plugin-musea
@vizejs/musea-nuxt
@vizejs/nuxt
commit: |
PR BenchmarkBase:
Raw run timesCompile SFC
Lint
Format
Type check (1T)
Type check (max)
|
Detailed Test ReportCommit: Area Summary
Test InventoryTotal tracked cases: 8288 across 1143 files.
Files
Comment truncated at 64000 characters. Open the workflow run for the full job log. |
Tool BenchmarkMeasured: 2026-07-03T13:31:36.581Z
Fairness notes:
Commands: gh workflow run tool-benchmark.yml --ref <branch> -f file_count=3000 -f check_file_count=500 -f vite_file_count=1000 -f nuxt_file_count=250 -f large_blocks=300 -f runs=3 -f warmups=1 -f commit_results=true
node bench/generate.mjs 3000
node bench/compare-tools.mjs --input bench/__in__ --vize-bin target/release/vize --runs 3 --warmups 1 --check-file-count 500 --vite-file-count 1000 --nuxt-file-count 250 --large-blocks 300 --runner-label "blacksmith-32vcpu-ubuntu-2404" --out tool-benchmark-summary.md --json tool-benchmark-results.json --doc performance-blacksmith.mdVariant details and raw run timesSFC compile
Large SFC compile
Large SFC type check
Lint
Format
Type check
Vite build (end-to-end)
Nuxt SPA build (end-to-end)
|
Summary
$event.any[], preserving Vue 2 custom event handler arity.Root cause
When component emit args stayed unresolved or looked empty, the generated listener type could become
($event: any) => unknownor() => unknown. Vue 2 custom events often carry payloads without complete type metadata, so valid handlers with one or more required parameters were rejected with TS2345.Validation
cargo test -p vize_canon legacy_vue2_unresolved_component_event_payloads_stay_variadic --lib -- --nocapturecargo test -p vize_canon test_component_event_listener_uses_full_emit_arg_tuple --lib -- --nocapturecargo test -p vize_canon test_component_event_fallback_uses_dom_event_type_when_args_stay_unknown --lib -- --nocapturecargo test -p vize --test check_legacy_vue2_event_payload_cli --features legacy -- --nocapturecargo test -p vize --test check_legacy_vue2_event_alias_cli --features legacy -- --nocapturecargo clippy -p vize_canon --lib -- -D warnings -D clippy::wildcard_importscargo clippy -p vize --test check_legacy_vue2_event_payload_cli --features legacy -- -D warnings -D clippy::wildcard_importscargo fmt --all -- --checkgit diff --checknode --test tests/tooling/source-file-lengths.test.tsFixes #2516
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.