ISSUE DESCRIPTION Compiler parity: add the current Script Setup TypeScript differential…
- User
ISSUE DESCRIPTION
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.
ADDITIONAL ADVICE
Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use
git checkout <file>to restore the file to its original state. You can also reset all changes in the repository usinggit reset --hardcommand. Additionally, you can usegit stashandgit stash popto temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you callsubmit) usinggit statusorgit diffcommands. However you don't need to usegit addorgit commitbefore submitting your changes. In fact,submitonly submits currently unstaged changes because it usesgit diffto get the changes that need to be submitted.CHECKLIST
Before submitting your solution, please go over the following checklist and make sure you've done everything:
- If an error was reported in the issue description, I have successfully reproduced it.
- If an error was reported in the issue description, I have confirmed that my fix resolves the error.
Assistant
Network access works. Let's install nodejs.
Assistant
Now let's check the generate-expected.ts script works with these packages, by pointing NODE_PATH or symlinking.
Assistant
It works. Let's check the diff before proceeding, and revert since we're not adding cases yet - just testing.
Assistant
Now insert after line 240 (the closing
""").Assistant
Now let's also add a script-setup generic type parameter case that isn't yet covered — combining generic with defineOptions (a common differential scenario). Let's check the generic section end for a good insertion point.
Assistant
Now let's validate the TOML file parses correctly and check case count.
Assistant
Good, 72 cases now (69 + 3 new). Now let's regenerate expected snap only for these new cases using the oracle, without touching existing entries.
Assistant
Now let's print full blocks to see complete output for each.
Assistant
Now insert block1 & block2 after the "defineOptions" block (line 514
===), and block3 after "generic component with default type" block.Assistant
Now let's build & run coverage to see if new cases pass.
Assistant
All 3 new cases fail against the real Vue oracle. Let's see the diffs to understand if Vize's compiler has a genuine gap (spread syntax for defineOptions) or if it's fixable.
Assistant
Good, no other rust unit tests check the emitted
Object.assignformat for defineOptions+TS combos. Let's search for tests incompile_script/inlinemodule too.Assistant
Now let's also check the
import { defineComponent as _defineComponent } from 'vue'import emission — does it get added when has_options && is_ts (previously wasn't needed since it used Object.assign)?Assistant
Now let's use it to accept/review pending snapshots.
Assistant
Good, format matches. Now let's rerun the test to confirm everything passes.
Assistant
All snapshot tests pass. Now let's check the other referenced snapshot from the earlier commit diff (
compile_sfc_with_define_emits.snap) that used similar pattern to make sure nothing else broke. Let's run full workspace test suite.Assistant
All 405 tests pass. Now let's run the full workspace test suite to check for wider ripple effects.
Assistant
Build succeeds across the whole workspace. Now let's run the full test suite (this repo is big, so let's target likely affected crates plus a broader run).
Assistant
Confirmed: this failure is pre-existing/environmental (unrelated to our change), caused by our custom Node install lacking native
.tssupport without the strip-types flag. Let's restore PATH to the apt-installed node (which might not support ts either) and continue running the rest of the workspace tests, excluding this known environment issue.Assistant
Let's check for any failures higher up in the output.
Assistant
All good — no failures elsewhere. Now let's update
coverage.rsthresholds to reflect the new totals (162 SFC / 688 total), since all pass and KNOWN_FAILURES remains empty (accurate).Assistant
Good, both sides normalize the
required: truepattern consistently, confirming that normalization requirement from the issue is already correctly applied and exercised by our new cases. Now let's run the coverage binary once more to get the final report and confirm everything is in order.Assistant
Exit code check to ensure the coverage binary succeeds (returns 0):
Assistant
Now let's run the specific coverage test module and the whole
vize_test_runnercrate tests.Assistant
All good. Let's now clean up the temporary node_modules symlink and other temp artifacts we created that shouldn't be part of the commit.
Assistant
Good, symlink removed (it was a symlink so
rm -fhandled it). Let's do a final review of the full diff before submitting.Assistant
This looks clean. Let's also check the fixture and expected snap diffs once more for sanity.
Assistant
This all looks correct and clean. Let's also verify the
defineOptions(JS, non-TS) snapshot in tests/expected wasn't touched (should remain unchanged since it's before our insertion point).Assistant
Unchanged, as expected. Now let's check the toml diff fully for correctness.
Assistant
Now let's remove the temporary node/npm setup we did (they were outside the repo in /tmp, so nothing to clean in repo). Let's double check
git statusis clean of stray files.Assistant
Now let's do a final full check across the whole workspace one more time to be safe, plus re-confirm coverage report.
Assistant
All passing. Let's do one last coverage run to confirm the final state.
Assistant
Everything works as intended. Let's finalize a summary review of the diff before submission.
Assistant
Now let's go through the checklist.
Assistant
Everything checks out. Let's review the checklist items:
Checklist review:
-
If an error was reported in the issue description, I have successfully reproduced it. — The issue described a gap in the differential-parity oracle coverage for Script Setup TypeScript cases (defineOptions options, script-setup generic). I reproduced the divergence by adding the three new fixture cases and regenerating expected output from the real
@vue/compiler-sfc@3.6.0-beta.10oracle: this exposed 3 concrete failures (Object.assign(...)vs_defineComponent({ ...options, ... })) confirmed viacargo run -p vize_test_runner --bin coverage -- -vv. -
If an error was reported in the issue description, I have confirmed that my fix resolves the error. — I patched
component_output.rsso that when<script setup lang="ts">usesdefineOptions()together with type-based props (forcing_defineComponent), Vize spreads the options object inside the single_defineComponentargument, exactly matching the real Vue compiler's output. Re-running coverage shows and , with the tracked list staying accurately at 0 (no divergence left to hide), and / budgets updated to the new accurate totals (162/688).
-
Assistant
- I have thought about edge cases and made sure my fix handles them as well. — Considered: (1)
is_vaporcombos keep their originalObject.assignpath untouched (not part of oracle cases changed here, and vapor's codegen is a distinct pipeline); (2) plain JS<script setup>(nolang="ts") defineOptions case is preserved unchanged (verified diff shows original snapshot for"defineOptions"intact); (3) generic (<script setup generic="...">) combined withdefineOptionscorrectly routes through theis_tsbranch since generics requirelang="ts"; (4) the closing-paren emission logic inbody.rsneeded no change because it already closes with"})"wheneverhas_options || is_tsis true, which covers both the oldObject.assignshape and the new spread shape identically; (5) verified the self-consistency insta snapshot suite (tests/snapshots/sfc/ts/script_setup__*.snap), which forcesis_ts = trueregardless of the fixture's actuallangattribute, so I regenerated/accepted the affected snapshot for the existing plain-JSdefineOptionscase plus added new snapshots for the 3 new cases.
- I have thought about edge cases and made sure my fix handles them as well. — Considered: (1)
Assistant
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. — Ran
cargo test --workspace --exclude vize_carton(the excluded crate has one pre-existing, environment-only failure about loading.tsconfig files with Node, confirmed present identically on the unmodifiedHEADcommit viagit stash/git stash pop, i.e., unrelated to this change) and all other tests pass. Also specifically rancargo test -p vize_atelier_sfc(405 passed) andcargo test -p vize_test_runner(coverage budget test + normalization test pass), andcargo run -p vize_test_runner --bin coveragereporting688/688 (100.0%)with zero unexpected failures and zero budget regressions.
Let's clean up the temporary node install artifacts (outside repo, so no cleanup needed in repo) and do a final status check.
- I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. — Ran
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.