Skip to content

typescript, javascript: index Vue single-file components - #1738

Merged
swapnilpaliwal-sd merged 1 commit into
0.1.8from
loop/ty-vue-sfc
Sep 29, 2026
Merged

swapnilpaliwal-sd merged 1 commit into
0.1.8from
loop/ty-vue-sfc

Conversation

@swapnilpaliwal-sd

Copy link
Copy Markdown
Contributor

.vue files were never read, so a helper called only from a template had no caller, and a component rendered only by a template had no use.

  • Each .vue component is read as a virtual script that keeps every line: the <script>/<script setup> bodies verbatim, plus one statement per template reference (<Child/>/<my-child> → call, @evt="fn" → fn(), inline handlers, :x/v-if/{{ }} expressions).
  • lang="ts"|"tsx" goes to the TS analyzer, JS (or no lang) to the JS analyzer. A .vue with no inline script adds nothing.
  • tsconfig include claims .vue files; relative ./X.vue imports resolve to the component.
  • Golden cases: TS 80-vue-sfc, JS 69-vue-sfc. Controls: a template-only .vue, and a .vue in the other language.

Checked: TS suite 90/90, JS suite 79/79, parser TS 49/49, JS 48/48. Repro impact sfcHelper: nothing → [resolved] src/Comp.vue:5. Real Vue 3 app: call edges 144 → 477, index 8.0s → 8.6s.

A .vue file was never read, so a helper called only from a template had no
caller and a component rendered only by a template had no use. Each .vue
component is now read as a virtual script that keeps every line: its inline
<script>/<script setup> bodies verbatim, plus one top-level statement per
template reference (<Child/> and <my-child> as calls, @event handlers as
calls or statements, bound expressions and {{ }} as expressions). lang=ts/tsx
goes to the TypeScript analyzer, a JavaScript script to the JavaScript one;
a component with no inline script is not analysed. tsconfig include globs
claim .vue files and relative ./X.vue imports resolve to the component.

Co-authored-by: axiomcode-bot[bot] <334110751+axiomcode-bot[bot]@users.noreply.github.com>
@swapnilpaliwal-sd
swapnilpaliwal-sd merged commit 1434a23 into 0.1.8 Sep 29, 2026
12 checks passed
@swapnilpaliwal-sd
swapnilpaliwal-sd deleted the loop/ty-vue-sfc branch September 29, 2026 03:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant