In recent years, we've seen a great evolution from Nuxt, and with evolution, we also have many breaking changes.
But what to expect from Nuxt 4? In recent years, thousands of devs lost a lot of hair migrating entire codebases to the Composition API.
Well, if that's your fear, you can relax. The Nuxt development team now aims to follow semver.
The goal of Nuxt 4 is not to create hype about this version. It is to remain stable and almost completely compatible with version 3. If you already want to prepare for the future, here are some of those changes:
During the last few years, the Nuxt 2 β Nuxt 3 update caused the Nuxt repository to be completely rewritten to present the recent absurd performance changes. However, this year the Nuxt team put on the brakes. And this shows that Nuxt is already a mature Fullstack Framework and ready for various scenarios.
process.client
and process.server
will be soft-deprecated, meaning their use will issue a warning. The correct approach from now on is to use import.meta.client
or import.meta.server
.Thanks to NitroJS, Nuxt has evolved from a "Meta-framework" to a "Fullstack-framework". And to make it a bit more modular, there will be some changes in the directory structure. If the utils is positioned in the path ~/utils, it will be used in both the Backend and Frontend.
And I must say. This will be great for organizing zod schemas!
.output/
.nuxt/
app/
assets/
components/
composables/
layouts/
middleware/
pages/
plugins/
utils/
main.vue
router.options.ts
content/
layers/
modules/
node_modules/
public/
server/
api/
middleware/
plugins/
routes/
utils/
nuxt.config.ts
Now with the house in order, attention turns back to the modules, as in Nuxt 2...
As the Nuxt 2 β Nuxt 3 codebase needed to be completely rewritten, all the old modules are also being rewritten now. So we have in view a very comfortable scenario, as it looked like in the golden age of Nuxt 2. Just as Daniel Roe said, in his talk at CityJS London:
Our focus will be on reassuring people that they will never experience anything as painful as the Nuxt 2 β Nuxt 3 migration again.
And I must say, I'm completely excited about not having to rewrite all the codebases I maintain at the moment π.
Follow in real time the progress of Nuxt 4 updates.