Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7a1991e

Browse files
committed
docs: update migration progress
1 parent4a88873 commit7a1991e

File tree

1 file changed

+50
-51
lines changed

1 file changed

+50
-51
lines changed

‎README.md

Lines changed: 50 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Inspired by [react-codemod](https://github.com/reactjs/react-codemod).
2424
-[x] Basic testing setup and a dummy CLI
2525
-[x] Support applying`jscodeshift` codemods to`.vue` files
2626
-[x] Provide a programmatic interface for usage in`vue-cli-plugin-vue-next`
27-
-[ ] (WIP) Set up tests
27+
-[x] Set up tests
2828
-[ ] (WIP) Implement the transformations described below for migration usage
2929
-[ ] Built-in transformations need to support TypeScript
3030
-[ ] Built-in transformations need to support module systems other than ES module, and those without modules
@@ -44,43 +44,41 @@ The migration path (to be integrated in a new version of [`vue-migration-helper`
4444
5. Make sure to use the compat build of vue@3
4545
6. Serve the app in development mode, fix the runtime deprecation warnings
4646

47-
>Note: even though most of the migration process can be automated, please be aware there might still be subtle differences between Vue 3 and Vue 2 runtime. Please double check before deploying your Vue 3 app into production.
47+
>Note: even though most of the migration process can be automated, please be aware there might still be subtle differences between Vue 3 and Vue 2 runtime, and the codemods may have uncovered edge cases. Please double check before deploying your Vue 3 app into production.
4848
4949
Legend of annotations:
5050

5151
| Mark| Description|
5252
| ----| ----------------------------------------------------|
5353
| 🔴| work not started|
54-
| 🟠| on-going work|
55-
| 🟢| implemented (may have uncovered edge cases)|
5654
| 🔵| needs to or can be implemented in the compat runtime|
5755

5856
####Fixable in ESLint
5957

60-
-🟢[RFC05: Replace`v-bind`'s`.sync` with a`v-model` argument](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0005-replace-v-bind-sync-with-v-model-argument.md)
58+
-[RFC05: Replace`v-bind`'s`.sync` with a`v-model` argument](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0005-replace-v-bind-sync-with-v-model-argument.md)
6159
- Can be detected and fixed by the[`vue/no-deprecated-v-bind-sync`](https://eslint.vuejs.org/rules/no-deprecated-v-bind-sync.html) ESLint rule
62-
-🟢[RFC14: Remove`keyCode` support in`v-on`](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0014-drop-keycode-support.md)
60+
-[RFC14: Remove`keyCode` support in`v-on`](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0014-drop-keycode-support.md)
6361
- Can be detected and fixed by the[`vue/no-deprecated-v-on-number-modifiers`](https://eslint.vuejs.org/rules/no-deprecated-v-on-number-modifiers.html) ESLint rule
6462
-`config.keyCode` can be supported in the compat build. It is also detectable with the[`vue/no-deprecated-vue-config-keycodes`](https://eslint.vuejs.org/rules/no-deprecated-vue-config-keycodes.html) ESLint rule
65-
-🟢[RFC19: Remove`data` object declaration](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0019-remove-data-object-declaration.md)
63+
-[RFC19: Remove`data` object declaration](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0019-remove-data-object-declaration.md)
6664
- Can be detected and fixed by the[`vue/no-shared-component-data`](https://eslint.vuejs.org/rules/no-shared-component-data.html) and the[`vue/no-deprecated-data-object-declaration`](https://eslint.vuejs.org/rules/no-deprecated-data-object-declaration.html) ESLint rules
6765

6866
####Codemods
6967

70-
-🟢[RFC01: New slot syntax](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0001-new-slot-syntax.md) and[RFC06: Slots unification](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0006-slots-unification.md)
71-
-🟢Can be detected and partially fixed by the[`vue/no-deprecated-slot-attribute`](https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html) and[`vue/no-deprecated-slot-scope-attribute`](https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html)
72-
-🟢During the transition period, with the 2 ESLint rules enabled, it will warn users when they use`this.$slots`, recommending`this.$scopedSlots` as a replacement
73-
-🟢When upgrading to Vue 3, replace all`.$scopedSlots` occurrences with`.$slots` (should pass the abovementioned ESLint checks before running this codemod) (implemented as`scoped-slots-to-slots`)
74-
-🟠[RFC04: Global API treeshaking](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0004-global-api-treeshaking.md) &[RFC09: Global mounting/configuration API change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0009-global-api-change.md)
68+
-[RFC01: New slot syntax](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0001-new-slot-syntax.md) and[RFC06: Slots unification](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0006-slots-unification.md)
69+
- Can be detected and partially fixed by the[`vue/no-deprecated-slot-attribute`](https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html) and[`vue/no-deprecated-slot-scope-attribute`](https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html)
70+
- During the transition period, with the 2 ESLint rules enabled, it will warn users when they use`this.$slots`, recommending`this.$scopedSlots` as a replacement
71+
- When upgrading to Vue 3, replace all`.$scopedSlots` occurrences with`.$slots` (should pass the abovementioned ESLint checks before running this codemod) (implemented as`scoped-slots-to-slots`)
72+
-[RFC04: Global API treeshaking](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0004-global-api-treeshaking.md) &[RFC09: Global mounting/configuration API change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0009-global-api-change.md)
7573
-**implemented as`new-global-api`**
76-
-🟢`import Vue from 'vue'` ->`import * as Vue from 'vue'` (implemented as`vue-as-namespace-import`)
77-
-🟢`Vue.extend` ->`defineComponent` (implemented as`define-component`)
78-
-🟢`new Vue()` ->`Vue.createApp()` (implemented as`new-vue-to-create-app`)
79-
-🟢`new Vue({ el })`,`new Vue().$mount` ->`Vue.createApp().mount`
80-
-🟢`new HelloWorld({ el })`,`new HelloWorld().$mount` ->`createApp(HelloWorld).mount`
81-
-🟢`render(h)` ->`render()` and`import { h } from 'vue'` (implemented as`remove-contextual-h-from-render`)
82-
-🟢`Vue.config.productionTip` -> removed (implemented as`remove-production-tip`)
83-
-🔵 Some global APIs now can only be used on the app instances, while it's possible to support the legacy usage in a compat build, we will provide a codemod to help migration. (`global-to-per-app-api`)
74+
-`import Vue from 'vue'` ->`import * as Vue from 'vue'` (implemented as`vue-as-namespace-import`)
75+
-`Vue.extend` ->`defineComponent` (implemented as`define-component`)
76+
-`new Vue()` ->`Vue.createApp()` (implemented as`new-vue-to-create-app`)
77+
-`new Vue({ el })`,`new Vue().$mount` ->`Vue.createApp().mount`
78+
-`new HelloWorld({ el })`,`new HelloWorld().$mount` ->`createApp(HelloWorld).mount`
79+
-`render(h)` ->`render()` and`import { h } from 'vue'` (implemented as`remove-contextual-h-from-render`)
80+
-`Vue.config.productionTip` -> removed (implemented as`remove-production-tip`)
81+
-🔴 Some global APIs now can only be used on the app instances, while it's possible to support the legacy usage in a compat build, we will provide a codemod to help migration. (`global-to-per-app-api`)
8482
-`Vue.config`,`Vue.use`,`Vue.mixin`,`Vue.component`,`Vue.directive`, etc ->`app.**` (It's possible to provide a runtime compatibility layer for single-root apps)
8583
-`Vue.prototype.customProperty` ->`app.config.globalProperties.customProperty`
8684
-`Vue.config.ignoredElements` ->`app.config.isCustomElement`
@@ -91,32 +89,32 @@ Legend of annotations:
9189
2. If there's exactly one entry file and one root instance, but several other files are also using`Vue.*`, then transform the entry file to export the root instance, import it in other files and transform them with the imported root instance;
9290
3. If there are more than one entry file or root instances, then the user needs to manually export the root instances, re-apply this codemod to those non-entry files with an argument designating the root instance.
9391
- 🔵 Detect and warn on`optionMergeStrategies` behavior change
94-
-🟠[RFC07: Functional and async components API change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0007-functional-async-api-change.md)
92+
-[RFC07: Functional and async components API change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0007-functional-async-api-change.md)
9593
- 🔵 a compatibility mode can be provided for functional components for one-at-a-time migration
96-
-🟢Can be detected by the[`vue/no-deprecated-functional-template`](https://eslint.vuejs.org/rules/no-deprecated-functional-template.html) ESLint rule
94+
- Can be detected by the[`vue/no-deprecated-functional-template`](https://eslint.vuejs.org/rules/no-deprecated-functional-template.html) ESLint rule
9795
- 🔴 SFCs using`<template functional>` should be converted to normal SFCs
98-
-🟠[RFC08: Render function API change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0008-render-function-api-change.md)
99-
-🟢Template users won't be affected
100-
-🟠JSX plugin will be rewritten to cover most use cases (work-in-progress, available athttps://github.com/vueComponent/jsx/)
96+
-[RFC08: Render function API change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0008-render-function-api-change.md)
97+
- Template users won't be affected
98+
- JSX plugin will be rewritten to cover most use cases (work-in-progress, available athttps://github.com/vueComponent/jsx/)
10199
- 🔴 For Users who manually write render functions using`h`
102100
- 🔵 It's possible to provide a compat plugin that patches render functions and make them expose a 2.x compatible arguments, and can be turned off in each component for a one-at-a-time migration process.
103101
- 🔴 It's also possible to provide a codemod that auto-converts`h` calls to use the new VNode data format, since the mapping is pretty mechanical.
104102
- 🔴 Functional components using context will likely have to be manually migrated, but a similar adaptor can be provided.
105-
-🟠[RFC12: Custom directive API change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0012-custom-directive-api-change.md)
106-
-🟢`bind` ->`beforeMount`
107-
-🟢`inserted` ->`mounted`
108-
-🟢remove`update` hook and insert a comment to note the user about the change
109-
-🟢`componentUpdated` ->`updated`
110-
-🟢`unbind` ->`unmounted`
103+
-[RFC12: Custom directive API change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0012-custom-directive-api-change.md)
104+
-`bind` ->`beforeMount`
105+
-`inserted` ->`mounted`
106+
- remove`update` hook and insert a comment to note the user about the change
107+
-`componentUpdated` ->`updated`
108+
-`unbind` ->`unmounted`
111109
- 🔴 VNode interface change (a runtime compat plugin is also possible, see the notes for RFC08)
112-
-🟠[RFC13: Composition API](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0013-composition-api.md)
113-
-🟢`import ... from '@vue/composition-api'` ->`import ... from 'vue'` (implemented as`import-composition-api-from-vue`)
114-
-🔴 Othersubtle differences between`@vue/composition-api`andtheVue 3 implementation.
115-
-🟠[RFC16: Remove`inline-template`](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0016-remove-inline-templates.md)
116-
-🟢Can be detected by the[`vue/no-deprecated-inline-template`](https://eslint.vuejs.org/rules/no-deprecated-inline-template.html) ESLint rule
110+
-[RFC13: Composition API](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0013-composition-api.md)
111+
-`import ... from '@vue/composition-api'` ->`import ... from 'vue'` (implemented as`import-composition-api-from-vue`)
112+
-There are somesubtle differences betweenthe pluginand Vue 3 implementation, seehttps://github.com/vuejs/composition-api#limitations for more details.
113+
-[RFC16: Remove`inline-template`](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0016-remove-inline-templates.md)
114+
- Can be detected by the[`vue/no-deprecated-inline-template`](https://eslint.vuejs.org/rules/no-deprecated-inline-template.html) ESLint rule
117115
- 🔴 Possible alternatives are addressed[in the RFC](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0016-remove-inline-templates.md#adoption-strategy)
118-
-🟠[RFC25: Built-in`<Teleport>` component](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0025-teleport.md)
119-
-🟢Can be detected by the[`vue/no-reserved-component-names`](https://eslint.vuejs.org/rules/no-reserved-component-names.html) ESLint rule
116+
-[RFC25: Built-in`<Teleport>` component](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0025-teleport.md)
117+
- Can be detected by the[`vue/no-reserved-component-names`](https://eslint.vuejs.org/rules/no-reserved-component-names.html) ESLint rule
120118
- 🔴 A codemod can be implemented to rename all`<Teleport>` components to some other name like`<TeleportComp>`.
121119
- 🔴[RFC26: New async component API](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0026-async-component-api.md)
122120
- 🔵 In the compat build, it is possible to check the return value of functional components and warn legacy async components usage. This should cover all Promise-based use cases.
@@ -127,15 +125,15 @@ Legend of annotations:
127125
- 🔴[RFC30: Add`emits` component option](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0030-emits-option.md)
128126
- There could be potential naming conflicts with existing component-level`emits` options, so we need to scan and warn on such usages
129127
- To better utilize the new`emits` option, we can provide a codemod that automatically scans all instances of`$emit` calls in a component and generate the`emits` option
130-
-🟢[Vuex 3.x to 4](https://github.com/vuejs/vuex/tree/4.0)
128+
-[Vuex 3.x to 4](https://github.com/vuejs/vuex/tree/4.0)
131129
-**implemented as in combination of`new-global-api` and`vuex-v4`**
132-
-🟢`Vue.use(Vuex)` &`new Vue({ store })` ->`app.use(store)`
133-
-🟢`new Store()` ->`createStore()`
134-
-🟠[Vue Router 3.x to 4](https://github.com/vuejs/vue-router-next)
130+
-`Vue.use(Vuex)` &`new Vue({ store })` ->`app.use(store)`
131+
-`new Store()` ->`createStore()`
132+
-[Vue Router 3.x to 4](https://github.com/vuejs/vue-router-next)
135133
-**implemented as in combination of`new-global-api` and`vue-router-v4`**
136-
-🟢`Vue.use(VueRouter)` &`new Vue({ router })` ->`app.use(router)`
137-
-🟢`new VueRouter()` ->`createRouter()`
138-
-🟢`mode: 'history', base: BASE_URL` etc. ->`history: createWebHistory(BASE_URL)` etc.
134+
-`Vue.use(VueRouter)` &`new Vue({ router })` ->`app.use(router)`
135+
-`new VueRouter()` ->`createRouter()`
136+
-`mode: 'history', base: BASE_URL` etc. ->`history: createWebHistory(BASE_URL)` etc.
139137
- 🔴[RFC21: Scoped slot API for`router-link`](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0021-router-link-scoped-slot.md)
140138
- 🔴[RFC28: Change active and exact-active behavior for`router-link`](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0028-router-active-link.md)
141139
- 🔴[`vue-class-component` 7.x to 8](https://github.com/vuejs/vue-class-component/issues/406)
@@ -151,6 +149,7 @@ Legend of annotations:
151149
- Seems no codemod or ESLint rule is applicable to this breaking change
152150
-[RFC24: Attribute coercion behavior change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0024-attribute-coercion-behavior.md)
153151
- Codemod is not likely to help in this case
152+
- Subtle differences between`@vue/composition-api` and the Vue 3 implementation are listed in the[`@vue/composition-api` README](https://github.com/vuejs/composition-api#limitations)
154153

155154
####RFCs that May Need Amendments to Simplify the Migration
156155

@@ -168,7 +167,7 @@ These features are only deprecated but still supported in the compatiblity build
168167
There will be runtime warnings and ESLint rules to detect their usages.
169168
Some of them can be automatically migrated with the help of codemods.
170169

171-
-🟢[RFC15: Remove filters](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0015-remove-filters.md)
170+
-[RFC15: Remove filters](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0015-remove-filters.md)
172171
- Can be detected by the[`vue/no-deprecated-filter`](https://eslint.vuejs.org/rules/no-deprecated-filter.html) ESLint rule
173172
- 🔴[RFC18: Transition class name adjustments](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0018-transition-class-change.md)
174173
- For`<transition>` components with custom`enter-class` or`leave-class`:
@@ -177,17 +176,17 @@ Some of them can be automatically migrated with the help of codemods.
177176
- Otherwise, there are two possible solutions:
178177
- Change every`.v-enter` and`.v-leave` selector in the stylesheets to`.v-enter-from` and`.v-leave-from`
179178
- Or, attach`enter-from-class="v-enter v-enter-from" leave-from-class="v-leave v-leave-from"` to these`<transition>` components. Users can delete these attributes after they updated the corresponding stylesheets
180-
-🟠[RFC20: Events API Change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0020-events-api-change.md)
181-
-🟢Can be detected by the[`vue/no-deprecated-events-api`](https://eslint.vuejs.org/rules/no-deprecated-events-api.html) ESLint rule
179+
-[RFC20: Events API Change](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0020-events-api-change.md)
180+
- Can be detected by the[`vue/no-deprecated-events-api`](https://eslint.vuejs.org/rules/no-deprecated-events-api.html) ESLint rule
182181
- 🔴 A codemod can be implemented to use other libraries like[tiny-emitter](https://github.com/scottcorgan/tiny-emitter) for the events API
183-
-🟢[RFC23-scoped-styles-changes](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0023-scoped-styles-changes.md)
182+
-[RFC23-scoped-styles-changes](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0023-scoped-styles-changes.md)
184183
- The new behavior should be opt-in
185-
-🟠[RFC27: Custom Elements Interop Improvements](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0027-custom-elements-interop.md)
184+
-[RFC27: Custom Elements Interop Improvements](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0027-custom-elements-interop.md)
186185
- (Covered by the Global API RFCs):`Vue.config.ignoredElements` ->`app.config.isCustomElement`
187186
- 🔴 Vue 2 non-`<component>` tags with`is` usage ->
188187
-`<component is>` (for SFC templates).
189188
-`v-is` (for in-DOM templates).
190-
-🟢The[`vue/no-deprecated-html-element-is`](https://eslint.vuejs.org/rules/no-deprecated-html-element-is.html) ESLint rule can be used to detect usage for`is` usage on built-in HTML tags.
189+
- The[`vue/no-deprecated-html-element-is`](https://eslint.vuejs.org/rules/no-deprecated-html-element-is.html) ESLint rule can be used to detect usage for`is` usage on built-in HTML tags.
191190

192191
###Generic Transformations
193192

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp