Compiler parity: add the current Script Setup TypeScript differential cases and keep the…
- User
Compiler parity: add the current Script Setup TypeScript differential cases and keep the known-failure budget accurate
Use the existing Vue differential-parity oracle for the current SFC fixture additions. Add and match the upstream Vue output for Script Setup TypeScript cases covering
defineOptionsoptions such asinheritAttrs, component name/custom options, and<script setup generic>type parameters.Normalization must treat
required: trueas the default representation expected by the fixture comparison. Regenerate the affected expected snapshots from the real Vue compiler and update the tracked known-failure budget so the coverage command reports exactly the remaining known divergences rather than hiding new failures.Evaluation contract
The required differential corpus for this task is the current Script Setup TypeScript snapshot set, including
defineOptionscases and script-setup generic type parameters. Normalizerequired: trueas the default representation expected by the oracle, regenerate those snapshots from the real Vue compiler, and update the tracked known-failure count to exactly the remaining known divergences. Passing a different parity-fixture subset does not satisfy this task.Interface
No new interfaces are introduced.
- Assistant
Let me check whether the insta snapshot set matches the fixture cases, and whether the insta tests currently pass.
- Assistant
Network is available but Node isn't installed. I'll install Node locally to run the Vue-compiler generator:
- Assistant
The freshly generated output differs from the checked-in snap (hoisting/cache differences) — likely a Vue version mismatch. Let me check the lockfile:
- Assistant
Now I'll add the new differential cases. First the
defineOptionsvariants: - Assistant
Now a generic type-parameter case that exercises
<script setup generic>beyond props: - Assistant
Now find where Vize emits the
Object.assignmerge fordefineOptions: - Assistant
Let me check what upstream Vue emits for the original plain-JS
defineOptionscase in the regenerated snap: - Assistant
Now fix the TS-mode
defineOptionsoutput to match upstream (_defineComponent({ ...options, ... })). First check what other code/tests rely on the current pattern: - Assistant
Now update the coverage budget in
coverage.rs: - Assistant
Normalization is exercised by many now-passing cases. Now check which crates depend on
vize_atelier_sfcand run their tests: - Assistant
All green. Clean up the temporary symlink and review the final state:
- Assistant
Final verification pass:
- Assistant
All done. Summary of the changes:
What was done
1. New differential cases (
tests/fixtures/sfc/script-setup.toml) — 4 Script Setup TypeScript cases added to the parity corpus:defineOptions with inheritAttrs onlydefineOptions with component name onlydefineOptions with custom options(name +inheritAttrs+ arbitrary custom option)generic component with type parameter in emits(<script setup lang="ts" generic="T">withTflowing intodefineEmits)
2. Compiler parity fix (
crates/vize_atelier_sfc/src/compile_script/inline/compiler/component_output.rs:43) — in TypeScript mode,defineOptionsoutput now matches upstream@vue/compiler-sfc: the options object is spread inside_defineComponent({ ...opts, __name, setup }). Previously Vize emitted the JS-modeObject.assign(opts, {...})shape (upstream only usesObject.assignwhen it can't rely on spread, i.e. non-TS). JS and Vapor paths are unchanged. This makes all three newdefineOptionscases (and the generic-emits case) match real Vue output.3. Expected snapshots regenerated from the real Vue compiler (
tests/expected/sfc/script-setup.snap) — regenerated via the repo's owntests/tooling/support/generate-expected.tsagainst the repo-pinned@vue/compiler-sfc@3.6.0-beta.10(catalogvue-beta), producing authentic upstream output for all 73 cases. The regenerated corpus now containsrequired: truein 17 cases' type-based runtime props; the oracle's existingnormalize_default_required_truetreats it as the default representation, and its unit test passes.4. Known-failure budget made accurate (
tests/vize_test_runner/src/coverage.rs) — regeneration surfaced 14 real divergences (mostly Vue hoisting constant prop objects likeconst _hoisted_1 = { key: 0 }to module scope where Vize inlines them, plus cache-handler/patch-flag and union-type-resolution gaps). These are now tracked as exact(path, name)entries inKNOWN_FAILURESinstead of being hidden;MIN_SFC_PASSED159→149,MIN_TOTAL_PASSED685→675; thetracks_the_current_known_failure_budgettest asserts the count of 14 and membership (e.g.generic component with extendsis now known-failing, the new cases are not).5. Insta snapshots — 4 new
tests/snapshots/sfc/ts/script_setup__*.snapfiles added andscript_setup__defineoptions.snapupdated for the new TS output shape.Verification
cargo run -p vize_test_runner --bin coverageexits 0: 675/689 total, sfc/script-setup 59/73, "14 known failure(s) tracked", no unexpected failures or budget regressionscargo test -p vize_atelier_sfc(405 tests),-p vize_test_runner, and all dependent crates (vize_canon,vize_croquis,vize_maestro,vize_patina,vize_glyph,vize_musea,vize_vitrine,vize) pass- clippy clean on changed crates;
git diff --checkclean; changes left uncommitted
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Identical first prompt
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- composer-2.5Compare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- gpt-5.6-solCompare side by side →
- fable-5Compare side by side →
- fable-5Compare side by side →