-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Add support for Vue 3 <script setup> #8045
Conversation
This reverts commit 6899655.
An example test of this would require the 'vue' package, but I'm not sure how to do this, if someone with more experience with writing integration tests could give me pointers. |
There are various existing Vue tests that you can adapt: /~https://github.com/parcel-bundler/parcel/blob/v2/packages/core/integration-tests/test/vue.js |
I've looked through them, but none of the tests import 'vue' in the component. |
Ok, added a basic test that tests for the existence of setup and render for a component that only uses <script setup>. I'd also want to get the actual contents of the bundle tested (I hit some weird bugs.) It would be cool if there were tests for the kinds of things you could do with <script setup> (combine it with <script>, or use it with v-bind for css) and inspecting the actual output of setup would be cool (I know where the |
So it works fine after changing the order (as you've commited now)? Is that how Vue is supposed to work? |
Oh, no, it had nothing to do with the order of the blocks in the file. It was because I was calling setup with no args, but it actually should take 2, and "expose" was supposed to be a member in the second arg. Relevant docs: I just hadn't read these going into this. |
I tried using this today and it says properties are not defined on 2.5.0 |
This is not in 2.5.0 afaik. Nightly, maybe, but this was merged after the release of 2.5.0. |
↪️ Pull Request
This PR is meant to close #6949, and add support for Vue 3's
<script setup>
tags.💻 Examples
A component defined like:
should compile and say "Hello Vue", rather than "Hello ".
🚨 Test instructions
TBH I would want help with adding test cases. Basically, I'd want people to go ham on Vue 3
<script setup>
SFCs and see if anything breaks (or even combine<script>
and<script setup>
as is allowed by Vue).✔️ PR Todo