Skip to content

Commit

Permalink
migration: remove @vue/compat and switch to Vue 3 proper
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 6, 2021
1 parent 758961e commit 9beb454
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 27 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"dependencies": {
"firebase": "4.6.2",
"vue": "^3.1.0",
"@vue/compat": "^3.1.0",
"vue-router": "^4.0.0",
"vuex": "^4.0.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<router-link to="/show">Show</router-link>
<router-link to="/ask">Ask</router-link>
<router-link to="/job">Jobs</router-link>
<a class="github" href="https://github.com/vuejs/vue-hackernews-2.0" target="_blank" rel="noopener">
<a class="github" href="https://github.com/vuejs/vue-hackernews-2.0/tree/migration" target="_blank" rel="noopener">
Built with Vue.js
</a>
</nav>
Expand Down
6 changes: 1 addition & 5 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
import { createApp, configureCompat } from 'vue'
import { createApp } from 'vue'
import { createStore } from './store'
import { createRouter } from './router'
import titleMixin from './util/title'
import App from './App.vue'
import ProgressBar from './components/ProgressBar.vue'

configureCompat({
MODE: 3
})

const router = createRouter()
const store = createStore(router)

Expand Down
4 changes: 0 additions & 4 deletions src/views/CreateListView.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ const camelize = str => str.charAt(0).toUpperCase() + str.slice(1)
// They are essentially higher order components wrapping ItemList.vue.
export default function createListView (type) {
return {
compatConfig: {
MODE: 3
},

name: `${type}-stories-view`,

asyncData ({ store }) {
Expand Down
17 changes: 1 addition & 16 deletions vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,5 @@ import createVuePlugin from '@vitejs/plugin-vue'

// https://vitejs.dev/config/
export default defineConfig({
resolve: {
alias: {
vue: '@vue/compat'
}
},
plugins: [
createVuePlugin({
template: {
compilerOptions: {
compatConfig: {
MODE: 3
}
}
}
})
]
plugins: [createVuePlugin()]
})

1 comment on commit 9beb454

@yyx990803
Copy link
Member Author

@yyx990803 yyx990803 commented on 9beb454 May 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The migration is complete! The app is now fully running on Vue 3, Vuex 4 and Vue Router 4.

Note we can remove @vue/compat and all compat configs because we only have Vue Router and Vuex as dependencies. If you have a dependency that relies on the compat behavior to function properly and it does not yet offer a Vue 3 compatible version, you will have to keep using the compat build.

Please sign in to comment.