Vue Migrating From V2

Posted on  by admin

I recently converted a second app from Vue 2 to Vue 3, added TypeScript, and swapped from options api to composition api.

Here are my notes from the experience. My 3 main target areas for this migration were:. JavaScript to TypeScript. Options API to Composition API. Almost every resource I used was from the official docs for Vue, the Vue CLI, the Vue Router, and Vuex. Some of these docs have sections in migrating, adding (like vue add typescript), or upgrading. All of these have docs. Some have migration guides, some do not. Some of the migration guides tell you the differences, but don't do it from an existing app. The steps I followed may not be the most optimal path. I would be shocked if they were. Your mileage may vary (YMMV). After digging through the docs and the Vue CLI API (to check out the add/migration commands) this is where I landed.