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

refactor: migrate default theme to use script-setup #137

Merged
merged 9 commits into from
Nov 26, 2020
Merged

Conversation

yyx990803
Copy link
Member

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 with import 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:

@kiaking
Copy link
Member

kiaking commented Nov 20, 2020

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.

@yyx990803 yyx990803 marked this pull request as ready for review November 25, 2020 17:43
@yyx990803
Copy link
Member Author

This is now ready. I would recommend enabling Volar instead of Vetur for now while working on this codebase.

@yyx990803
Copy link
Member Author

/cc @kiaking @posva let's start using <script setup> for VitePress now since this is a good place to dogfood the new syntax and spot potential bugs without too much worry of breaking people's stuff. May want to refactor some existing PRs based on this after it's merged.

@kiaking
Copy link
Member

kiaking commented Nov 26, 2020

@yyx990803 Niiice! Let me do the final checks on various example and merge this one 👍 I'll fix the conflicts if we get any.

@kiaking kiaking added the enhancement New feature or request label Nov 26, 2020
@tarkhil
Copy link

tarkhil commented Feb 10, 2022

Suddenly, <script setup=""> satisfies BOTH vue-mode and sfc-compiler.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants