Vue SFC package (de.h-dv.vue): template like Svelte, <script setup> through embedded-region dispatch (#275) #331
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
h-dv/code-index#331
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This comes from a field report by zammad-dev on #328. A Zammad 7.0.2 fork has 531 Vue single-file components (SFCs), and Vue is the main frontend language there. Today
.vuefiles are indexed as text only, so they have no symbols and no references.Why this is two pieces
Most of a Vue SFC's value is in
<script setup lang="ts">, which is TypeScript or JavaScript. Packages cannot see inside a file that mixes languages: there is one grammar per package and no injection (#275), andEMBEDDED_DISPATCH_SEMANTICS_VERSION = 0(#119). The existing Svelte package (de.h-dv.svelte) covers only the template half for that reason.de.h-dv.svelte.TAG_SYMBOL_BASENAME, #229).<LoginFooter>,v-bind/v-onexpressions, and{{ }}mustaches.<script lang=ts>range is TypeScript".<script>blocks, ERB (.html.erb: Ruby inside HTML, also in Zammad),.eco(CoffeeScript inside markup), and HTML<script>blocks.Order
#275's region dispatch first, because it is the generic piece and unblocks four formats. Then the Vue package uses it for the script half and does the template half itself.
Acceptance
<script setup>.find_callersreaches a composable called from a.vuefile.Released in v0.35.0 (https://git.h-dv.de/h-dv/code-index/releases/tag/v0.35.0) as de.h-dv.vue 0.1.0, via PR #351.
What it indexes:
<script>and<script setup>blocks, through embedded regions.Measured on Zammad 7.0.2: 525
.vuefiles went from 0 to 5,472 symbols, and resolved refs went up by 7,331.Not yet: a template ref binding to a symbol in the same file's script. That needs a cross-language tier.