-
-
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
Initial vue support #1052
Initial vue support #1052
Conversation
It seems parcel try to install some packages, which makes parcel itself not useable (missing prelude.min.js) on the first run. I need to stop parcel & patch parcel after the first run. And, vue styles are not correctly packaged into css files |
Styles in |
The intended behavior would be: Bundler extract CSS (scoped if needed, with or without preprocessors) and JavaScript (Template & script) from |
Ok here's what I think we should do. I think we don't really want to use the default vue compiler since it inlines everything into the JS (e.g. styles), and has its own compilation pipeline for styles, scripts, and templates. We should use the pipeline already built in parcel to do this as it will allow for correct file watching, css extraction, bundle splitting, etc. What we want to do is parse the In order to do this, we'll need a couple of changes. We need a way to compose asset types together. Currently this is kinda faked in some asset types like stylus by extending from another asset type, and calling |
btw, I'm working on the composition system described above. once implemented, we can use it for vue files. |
Alright i'll change this to generate script, style and template seperately and once Devon's composition system lands I'll update it to use it |
Great. Looking for CSS support. |
Implemented pipelines in #1065. Changed the base of this PR to point to that one, and merged in the changes. Updated VueAsset to use the new architecture. It could probably be a little cleaner still, but that should happen in the next major version when we can break the API. There are still a few things to fix, but things seem to be mostly working now. Compilation happens, including support for preprocessors like Stylus, CoffeeScript, Jade (not implemented yet but theoretically), etc. I was able to successfully run the Still need to fix:
@DeMoorJasper feel free to work on any of those if you like. 😄 |
Something is quite annoying is, Parcel doesn't always output the same when given the same input. I removed I can't really reproduce it. Its output is constantly changing, sometimes I do get the right, sometimes I do not. I also tried to fix my private code by manually analyzing the output code. I'm getting to what I need by changing a lot of expressions, but just one change (and revert) destroyed all my work today. It backs to where I started to fix, with a lot of code already been rewritten. It never recover to work though my exactly same code worked 15 minutes before. I'm thinking there might be some kind of race condition in Parcel, but I'm too tired to go on. I'll just go straight with Webpack and consider Parcel later, maybe few days later. Edit: I just try |
I don't want to clutter this PR with building questions, but I'm not sure whether or not I did the right thing to build Parcel using this PR locally. First, I cloned the repository, then I fetched this PR using
Then I installed all dependencies and built Parcel using Yarn:
After creating an alias I tried to build shawwn's boiler plate, but I (still) only get an empty BTW,
|
Wait, I still had to checkout the branch, in which these commits already are pushed. However, after trying to clone and build Parcel again, I still get the same issue. |
@laosb would be nice if you could provide a test repo for the bugs you encounter so we can test them or add them to the vue test cases. |
@laosb by custom blocks I mean https://vue-loader.vuejs.org/en/configurations/custom-blocks.html |
@DeMoorJasper I understand about the example, but somewhat more complicated code I wrote exhibited the same error. I also tried to use |
@marcelkorpel I tried shawwn's parcel-simple ( I suggest instead of using alias, just use |
Thanks for the tip, @gnijuohz, but I already tried that. But now I see this error that I got earlier, when using Parcel from npm and before I installed parcel-plugin-vue: in Firefox, the console complains
In Chromium, the console is a bit more descriptive:
The code pointed to is function isUnknownElement (tag) {
…
tag = tag.toLowerCase();
/* istanbul ignore if */
if (unknownElementCache[tag] != null) {
return unknownElementCache[tag]
}
var el = document.createElement(tag); But I thought you don't need parcel-plugin-vue anymore when using the vue-v3 branch, am I right? |
@devongovett Ah I see. Hopefully it's not widely used, at least I haven't use it before. We can safely consider it later. @DeMoorJasper I pushed my test app to GitHub, currently it works, if you need, you may add it to tests. It includes several ways to import a component in Vue, and all of them has failed at least once during my test. @marcelkorpel Try to clean |
So now it sounds like we are going to see Vue support released? |
@laosb I'm pretty sure it'll be shipped in the next release (1.7) |
# Conflicts: # yarn.lock
🎉 |
Basic vue support using
vue-compiler-utils
vue-compiler-utils
Closes #5