-
-
Notifications
You must be signed in to change notification settings - Fork 594
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
Refactor support for Vetur #871
Comments
Is this still planned? Would be really useful to have. |
Except for |
Just Necroing an issue that really needs to be solved in a large project that requires refactoring. I really want to know from someone who is handling big projects in VueJS and how do they refactor their components/variables/functions via |
I switched to writing all code into their own file and load it in the .vue file using
With plain Javascript you should of course drop the lang="ts" and use file.js |
@arenddeboer does this work if it's in the template tags? (or lives in the template tag?). like changing from |
@Ram231 nope, you are correct in that this does not refactor anything inside the template. But in my experience, there is still a lot to gain by moving it out into a .ts file. vscode seems to also perform much better. |
Pretty much I can relate to that(your way of separating JS/TS related code is somewhat similar to Mixins in vue). But handling the template tag is much more of a need here. It even affects my css class because it has a matching name. |
It is almost impossible to work on a larger codebase without any support for refactoring. Is this still in the works? |
Follow #2016 |
Hello here 👋 I think I can help with this specific question. If you're looking for automated refactoring for You can find more context around the decision here: nicoespeon/abracadabra#133 I don't do much Vue myself, but I'm using automated refactorings every day. With a little tweak, I was able to support Vue files for some users who needed it. I guess others can find it helpful too, while Vetur implements them 👍 |
Thank you, We have not had enough time to develop this part. If anyone interested, you can study this comment and this code. |
Thanks! I stopped writing vue files because of rename symbol. might come back and try this extension to see the magic. |
Per the discussion in nicoespeon/abracadabra#243, Nicolas has decided that the functionality to refactor components to a new file should live in Vetur rather than abracadabra. Adding that context to this issue, since this would be a MAJOR feature for Vue developers. |
Currently, TypeScript has a range of refactor support, such as
extract to function
. We should bring those in for<script>
region.Moreover, there are also Vue specific refactors that we could explore, for example: #820 (comment)
Being able to put a part of the current component's
<template>
into a new .vue file, with name and props auto populated seem very useful.The text was updated successfully, but these errors were encountered: