-
Notifications
You must be signed in to change notification settings - Fork 14
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
Vue #290
Comments
Hi mate. Questions. |
Hey, you're welcome. To add .Vue files to Zwitterion core, we just need to create a new internal plugin and implement all of the fields and functions. Each language supported so far is implemented as an internal plugin here: https://github.com/lastmjs/zwitterion/tree/master/src/languages The hardest thing for .vue will be implementing the transformer, which is the function that takes the source file contents and returns the modified contents to the browser. I'm not yet familiar with exactly how Vue single file components work, but I believe we can use this tool or one similar to do the transformation: https://www.npmjs.com/package/vue-template-compiler As I dig into Vue, I'm afraid I'll start finding out technical complications in this process. It could be pretty simply to get basic support though. In what ways are JSX and Vue similar? Do you mean the actual languages or the Zwitterion implementation? JSX and TSX are very simple, as they use the TypeScript compiler with just one extra flag and are easily compiled to JavaScript, everything being self-contained in one file. Vue might be more complex, as there is the style, template, script, imports and exports to deal with (though the script, imports, and exports might work without much complication). The biggest question I have is whether Vue should be supported natively by Zwitterion, or if Vue support should be put into a separate plugin that is installed separately. I want to come up with criteria for what should and should not be included in Zwitterion. If we don't have good guidelines, Zwitterion could get bloated to install and maintain. Right now I'm thinking languages that have a very high demand and chance of existing in high demand for the next few years should be supported. |
Answering the questions. JSX is like Vue template+style combined. However, what can get things complicated is the Separate note about My recommendation is to look at this chart and decide: |
Good recommendation. I think I will add Vue support to Zwitterion core. If we're supporting React, we might as well support Vue. The popularity of Vue would probably help Zwitterion gain notoriety. Even if adding an extension does end up bloating core, I think it would be relatively simple to split out plugins into third-party packages later on, might as well make it as convenient as possible for a lot of people. Svelte will probably be next after Vue |
Should we include support for
.vue
files in Zwitterion core, or should it be a third-party plugin?The text was updated successfully, but these errors were encountered: