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

refactor: replace jscodeshift with vue-codemod #5629

Merged
merged 2 commits into from
Jul 1, 2020

Conversation

haoqunjiang
Copy link
Member

By removing the dependency on vue-jscodeshift-adapter, the global vue-template-compiler peer dependency error should be fully fixed.

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Underlying tools
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

Other information:

@haoqunjiang
Copy link
Member Author

haoqunjiang commented Jun 28, 2020

  • TODO: vue-codemod needs to support Node.js v8.9+

Seems the hoisting of vue@3 failed in Yarn. Maybe we can try to fix it
with PNPM later.
@haoqunjiang haoqunjiang merged commit 7f56846 into vuejs:dev Jul 1, 2020
@haoqunjiang haoqunjiang deleted the feat-vue-codemod branch July 1, 2020 07:06
@screetBloom
Copy link
Contributor

When is V3 expected to be supported?

@sodatea

@haoqunjiang
Copy link
Member Author

What do you mean? Vue 3 is already supported

@screetBloom
Copy link
Contributor

screetBloom commented Aug 25, 2020

What do you mean? Vue 3 is already supported

@vue/cli 3.x still relies on the vue-jscodeshift-adapter.
When will this package be replaced with @vue/codemod?

@haoqunjiang
Copy link
Member Author

I don't plan to add new features to 3.x. So it won't.

@screetBloom
Copy link
Contributor

I don't plan to add new features to 3.x. So it won't.

Brother, why(大哥,不是吧)? 😂

I created a tool that relies on both 3.x and 4.x. And the vue-jscodeshift-adapter may cause a mismatch between the vue and vue-template-compiler.
So would it be possible to support that in version 3,please

@sodatea

@haoqunjiang
Copy link
Member Author

But vue-template-compiler is required in a Vue 2.x project. How does it become a problem?

@screetBloom
Copy link
Contributor

screetBloom commented Aug 26, 2020

Okay, let me describe the problem we're having.

  • Generally, we will select a fixed vue/vue-template-compiler version number. For example, our team chose 2.6.11
  • @vue/cli 3.x still relies on the vue-jscodeshift-adapter. And vue-jscodeshift-adapter has a vue-template-compiler@^2.5.13 installed by itself.
  • That means vue-jscodeshift-adapter will try to install the latest version of vue-template-compiler when it is available. Such as 2.6.12
  • This may cause a mismatch between the vue and vue-template-compiler

Personally, I wish @vue/cli would get rid of the third-party dependency on the vue-template-compiler@^2.5.13

@haoqunjiang
Copy link
Member Author

  1. Please use the resolutions field. As far as I tested, npm can correctly dedupe 2.6.11 and ^2.5.13, so only Yarn has this issue, and Yarn supports selective version resolutions.
  2. Please consider update Vue to 2.6.12, it's basically the same as 2.6.11

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

Successfully merging this pull request may close these issues.

2 participants