Nuxt & Universal SSR (50 Qs)•Part 3: Advanced Internals, Performance & Production (Senior / Staff)
What is the migration roadmap from Nuxt 2 to Nuxt 3?
senior LevelFormsPerformanceVue & Nuxt
In Simple Words: Migrating from Nuxt 2 to Nuxt 3 requires bridging the generational gap between Vue 2 and Vue 3:
- Bridge First (
@nuxt/bridge): An interim tool enabling Nuxt 3 features (Composition API, Nitro, Vite) inside an existing Nuxt 2 codebase without breaking legacy modules. - Convert Options API to Composition API: Replace
asyncData({ $axios })withuseAsyncData()anduseFetch(). - Adopt Native Script Setup: Refactor component methods, computed properties, and props to
<script setup lang="ts">. - Replace Vuex with Pinia: Replace Vuex stores with Pinia composables or Nuxt's native
useState(). - Update Server Middleware: Migrate Express/Connect middleware to
h3event handlers.