SFC: complete defineModel type-argument resolution in compileScript Follow-up to #762…
- User
SFC: complete defineModel type-argument resolution in compileScript Follow-up to #762 (which merged
defineModelviamergeModels). Remaining: resolve the type argument ofdefineModel<T>()/defineModel<T>(options)into the generated runtime + type output so the model prop's resolved type matches@vue/compiler-sfc.Work
In
crates/vize_atelier_sfc/src/compile_script/.../model.rs(build_model_props_emits), compute the resolved type frominfo.type_argusing the script context instead of leaving it unresolved. Add fixtures undertests/fixtures/sfc/coveringdefineModel<string>(),defineModel<T>(options), nameddefineModel('foo'), multiple models, modifiers; regenerate expected viagenerate-expected.ts sfc/<file>and verify with the coverage oracle.Interface
No new interfaces are introduced.
- Assistant
I’ll inspect the compile-script model pipeline and fixture conventions, then implement the type resolution and run the targeted fixture/oracle tests.
- Assistant
The requested path has moved in this checkout, so I’m locating the current module and its test harness before editing.
- Assistant
The fixture generator is present but
nodeis not installed in this environment. I’ll use the repository’s available JavaScript runtime if one exists; meanwhile I’m deriving the implementation from the local compiler’s existing type resolver. - Assistant
The core change now carries each model’s type arguments through collection, resolves the first argument against local aliases/interfaces for runtime props, and preserves the full generic list on
_useModel(including modifier keys). I’m compiling now and will tighten any parser/output edge cases exposed by tests. - Assistant
All five new oracle cases now pass, including alias-backed options and two generic parameters for modifiers. I’m doing a final diff review and full crate test to ensure the internal model-info change didn’t disturb non-fixture paths.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.