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
Parcel 2: Vue transformer #3364
Comments
I'm not sure if this is the right place to put this, but vue-cli automatically split vendors into another bundle chunk to reduce app load time:
Is this something we should be able to do with the transformer or with a plugin? |
I assume this isn't completed, which is why I can't get a basic vue project working on it? |
@mekhami Your assumption is correct. It's still a todo, for now you can try to use parcel v1 instead |
I've started on this, and so far have the basics working well. I'm hoping to have a PR up by next week. I'll also try to incorporate #1333 but may do so as a follow up PR. |
It doesn't look like much, but it may be the first vue component build with Parcel 2. src: <template>
<div>
<header>
<h1>I'm a template!</h1>
</header>
<p v-if="helloWorld">{{ helloWorld }}</p>
<p v-else>No message.</p>
</div>
</template>
<script>
export default {
data: () => ({
helloWorld: 'Hello World'
})
}
</script> Next I'll be implementing HMR, external blocks, and custom blocks. |
Just an update, I'm still working away. I've been delayed a bit as work has been demanding and thus haven't had a lot of time. I should have more done soon. |
@RobertWHurst, it’ll break if you add a child component. |
@maximal My transform isn't part of parcel 2 yet. It doesn't support vue at all at the moment. If you mean on my branch, I haven't pushed for a bit. |
I am new to Parcel and GitHub projects with multiple collaborators, I will load a simple vue SFC transformer (probably butchered because I have not grasped the full plugin mechanics). I couldn't find @RobertWHurst branch in main or https://github.com/RobertWHurst/parcel/branches, but I would like to help in development. DarioDaF@cfedc87 |
Has anyone been able to get Vue 3 beta working using Parcel (either v1 or v2)? I see something similar was asked in #4016, but it was directed here, where I personally can't find anything that can get me up and running. Am I missing something or is this just not possible yet? |
@mismith that issue is about Parcel 2 specifically. This issue is to track progress on implementing Vue in Parcel. Unfortunately we do not have anyone in the core team who uses vue on a daily basis so it would be ideal to get someone with a wide understanding of Vue to implement this. |
@yyx990803 @LinusBorg I know your guys' plates are surely full already, but do you have any tips on where to start here? Or where—or to who—I could look in order to get acquainted with a Parcel 2 + Vue 3 integration? Is it on the roadmap already maybe? Parcel is, as I'm sure you're both aware, a really nice compliment to the low-config/get-started-quickly philosophy of Vue/vue-cli, so I figured even if it's outside of the vue project scope, technically speaking, it likely still benefits the Vue community overall :) |
I have to highly 👍 @mismith here. Parcel and vue are a match made in heaven, but the integration needs a little more work. This combination has saved me a tremendous amount of time and energy in the past. |
I'm happy to answer any questions (unfortunately the plugin docs aren't ready yet), |
@mischnic awesome. I will try to throw together some repros tonight, but the basic issue I was having the other day was that it looks like Vue v3 no longer uses |
Parcel 2 doesn't handle Vue SFC's at all at the moment, you would get an error that If the Parcel 1 implementation is outdated, Webpack's vue-loader might be a good source of inspiration (they are using |
Some pointers for whoever interested in working on it: Vue 3 SFC transform should be using https://github.com/vuejs/vue-next/tree/master/packages/compiler-sfc The docs are non-existent yet, but the types in the source code are pretty self-explanatory. I would also recommend using https://github.com/vuejs/rollup-plugin-vue/tree/next and https://github.com/vuejs/vue-loader/tree/next as references. The general idea is that the base transform will parse the SFC and rewrite it into JavaScript code that make additional "virtual requests" to the same |
I've made a PR (#4892) for a Vue transformer. If any Vue users could test it, it would be much appreciated. |
on:
|
It's point to this string:
|
Could you open a new issue @bubnenkoff? Also, please provide more context (i.e. a reproduction repo or at least the entire file). |
@101arrowz done #4982 |
Does parcel 2 still not support .vue file extension + single file components? |
It does, the transformer was completed months ago, you should be able to use Vue with zero config. There are still plenty of bugs, but they're quite hard to fix as of right now. Check #4935 for an example. If you're having problems with it, please file a new issue. For more info on how to use them, check the docs |
Create the
@parcel/transformer-vue
package inpackages/transforms/vue
. This package is a Parcel 2 transform plugin for Vue. It should be based on theVueAsset
from Parcel 1.The
@parcel/transformer-vue
package is responsible for the following things:@vue/component-compiler-utils
Additional features above what Parcel 1 offers to consider:
supplemental
is minified independently fromjs
which sometimes leads to weird shadowing. #1183The text was updated successfully, but these errors were encountered: