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

Is it possible to parse a .vue file using this project #79

Open
kush96 opened this issue Jun 26, 2020 · 1 comment
Open

Is it possible to parse a .vue file using this project #79

kush96 opened this issue Jun 26, 2020 · 1 comment

Comments

@kush96
Copy link

kush96 commented Jun 26, 2020

Is there a way to parse .vue files? While exploring the project , i noticed there are a lot of parser classes within the project (TemplateParser being one). I wanted to know if it is possible to parse a vue file ,i.e make an AST or go over file token by token?

@adrienbaron
Copy link
Collaborator

Hey @kush96 !

What do you mean by parsing Vue files? Basically Vue files group together the behaviour (script), template and styles.

In Vue GWT the behaviour has to be part of the .java file (because of limitation of the Java compiler/APT), and also to be more compatible with existing Java tooling.

This only leaves the template and style bit. Both of them are supported by Vue GWT in the .html file next to the Java class.

The reason we went with .html extension instead of .vue is to avoid IDE trying to understand Vue GWT templates as Vue JS ones (which wouldn't work as the component context is provided by the Java class, so it would basically keep telling you things are invalid).

If you only keep the template bit, then those are basically regular html file, with an optional style element for scoped CSS.

Does that make sense?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants