🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@ygj6
Copy link
Member

@ygj6 ygj6 commented Jun 2, 2021

  • The destroyed lifecycle option has been renamed to unmounted
  • The beforeDestroy lifecycle option has been renamed to beforeUnmount

referenced at : https://v3.vuejs.org/guide/migration/introduction.html#other-minor-changes

Alanscut pushed a commit to Alanscut/vue-codemod that referenced this pull request Jun 25, 2021
@haoqunjiang
Copy link
Member

It's covered by https://eslint.vuejs.org/rules/no-deprecated-destroyed-lifecycle.html so I think we can skip this in vue-codemod.

@ygj6
Copy link
Member Author

ygj6 commented Jul 21, 2021

Hi @sodatea , it is true that some rules can be fixed by eslint-plugin-vue, but vue-codemod is a code transform tool, these fixes of eslint should also be the responsibility of vue-codemod. In addition, users do not need to configure eslint (if eslint has not been configured in the project).

In my fork repo originjs/vue-codemod, we use vue-eslint-parser to parse the template and rewrite a set of utils for modifying the template block based on the idea of modifying the source code of eslint, which makes vue-codemod more powerful. We veried some open-source projects and found that the average transformation rate reached nearly 80%. With some manually modification, Vue 2 project may upgrade to Vue 3 successfully.

For details, please see user guide. We also provided a typical upgrade case.

I wonder if above implementation meets your expectations? if so, I'm happy to contribute the code to vuejs/codemod.

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

Successfully merging this pull request may close these issues.

2 participants