Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vue): transpile vue template #289

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Teages
Copy link
Contributor

@Teages Teages commented Jan 18, 2025

resolves #281

Transpile vue template if the file have a typescript script block

Copy link

codecov bot commented Jan 18, 2025

Codecov Report

Attention: Patch coverage is 89.41176% with 18 lines in your changes missing coverage. Please review.

Project coverage is 84.29%. Comparing base (9000888) to head (bdd83dd).
Report is 90 commits behind head on main.

Files with missing lines Patch % Lines
src/loaders/vue.ts 66.66% 10 Missing ⚠️
src/utils/vue.ts 94.28% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #289      +/-   ##
==========================================
+ Coverage   82.86%   84.29%   +1.42%     
==========================================
  Files          12       13       +1     
  Lines         852     1076     +224     
  Branches      133      231      +98     
==========================================
+ Hits          706      907     +201     
- Misses        144      167      +23     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Teages Teages changed the title fix: transpile vue template fix(vue): transpile vue template Jan 18, 2025
@Teages Teages marked this pull request as ready for review January 18, 2025 12:58
@danielroe
Copy link
Member

i wonder if this will also fix a bug i haven't yet had time to report here

(can be reproduced in nuxt/image repo)

it was compiling nuxtimg component to reference properties in the template that were not exposed from setup

@Teages
Copy link
Contributor Author

Teages commented Jan 18, 2025

i wonder if this will also fix a bug i haven't yet had time to report here

(can be reproduced in nuxt/image repo)

I built it with @nuxt/[email protected] and I don't see any unusual.

The pr just remove ts syntax from vue template so it should has no effect to this.

it was compiling nuxtimg component to reference properties in the template that were not exposed from setup

Vue expose all props and variables defined in <script setup> to template by default, so it should be fine, or maybe I misunderstood what you meant.

Copy link
Member

you can replicate by running pnpm i -Dw @nuxt/[email protected] && pnpm dev:prepare && pnpm build && pnpm vitest run image

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.

vue template is not transpiled
2 participants