-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
refactor: migrate default theme to use script-setup #137
Conversation
Niiice! Watch out for the conflicts since I'm planning to adjust more on themes 🔥 I think import type issue is not because of <script setup>, I remember I had the same issue before so I thought it was a limitation for Vite 🤔 I agree it wouldn't be a deal breaker though. |
This is now ready. I would recommend enabling Volar instead of Vetur for now while working on this codebase. |
@yyx990803 Niiice! Let me do the final checks on various example and merge this one 👍 I'll fix the conflicts if we get any. |
Suddenly, |
This is a PR containing my local changes migrating the default them to use
<script setup>
as proposed in vuejs/rfcs#227.Specifically I verified that the inline compile mode works as intended. One quirk discovered is that when using
<script setup lang="ts">
it is necessary to explicitly mark type imports withimport type { X } from '...'
otherwise it will be used as a value in the setup return statement. It should be technically possible to avoid this limitation with more sophisticated analysis but for now I don't think it's a deal breaker.Note this PR isn't "working" yet and is here demonstrating the code simplifications that can be provided by the new RFC. Shipping it depends on the following:
@vue/compiler-sfc
for the new syntax AND inline compile modevite
androllup-plugin-vue
with compatibility updates<script setup>
syntax. In a few cases the binding analysis fails on destructuring declarations (<script setup>
variables declared with destructure language-tools#24)