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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vue 3 support #617
Comments
Maybe a simple solution would be to make |
I think that wouldn't be enough as vue-template-compiler is used directly in the vue lexer. In case of vue 3 that would need to be updated to use the @vue/compiler-sfc package instead. I would perhaps move out the VueLexer out of this package. Then you can maybe have separate lexers for vue2 and vue3 in another package. |
You are welcome to make a PR to solve the situation! I will review and merge it. |
Hi @karellm, I am open to doing that. So in Vue SFC files you have the template and script sections that can contain localizable messages. Regardless of where the message is defined, template or script, it will still be wrapped in a function $t() or t(). Therefore, it seems to me that the JavaScriptLexer alone is enough to deal with this case. That is how I am using the parser in my project as well - with the same lexer config for js and vue files. There is no need to compile the .vue file as the VueLexer does it, you can just parse it as a normal JS file then. The only case that is not covered with this approach is when one would use a i18next vue wrapper like this one and uses the directives(HTML attributes) to define localizable messages. But this case is not covered with the current VueLexer either. But if you use the HTML lexer in combination with the JS lexer for a case like this, you should be covered. To sum up at this point I actually see no reason for the VueLexer to exist even for vue users. What do you think, @karellm ? |
i agree remove it 馃憤 its causes more problems / peer dependency |
You can use my fork with vue 3 |
I don't recommend using a fork, make a PR and have it merged into the main project. |
馃殌 Feature Proposal
Currently the usage of vue-template-compiler in this package prevents using the parser in a vue 3 project.
Supporting both vue 2 and vue 3 versions would be very beneficial I believe.
Motivation
Example
Please provide an example for how this feature would be used.
The text was updated successfully, but these errors were encountered: