Conversation
✅ Deploy Preview for nuxt3-docs canceled.
|
|
Do you have a benchmark of prod bundle size impact and percentage savings? It is considerably large, I see no reason to even keep backward-compatible code into the final release. |
|
This PR will mean by default this plugin is not included in the bundle. The impact was ~4/92 kB of uncompressed JS (saving approx 4%). Worth mentioning that previously because the components plugin was not wrapped in defineNuxtPlugin, by default the legacy app plugin was always running. |
|
Then let's remove it as soon as possible to avoid misleading behavior. 4.5Kb is considerable (although gzip is probably much less in entry bundle). I initially added it for vue devtool and with intention of supporting Nuxt 2 compatible modules injecting a plugin but today it seems we need to migrate them anyway. It wouldn't worth to continue experimenting... |
|
Sounds good to me! Will update 👍 |
|
Note to self: an example of a plugin that does require this is https://github.com/moritzsternemann/vue-plausible/blob/main/src/nuxt-plugin.ts. |
🔗 Linked issue
resolves nuxt/nuxt#14002
❓ Type of change
📚 Description
We are currently including a legacy plugin that creates a proxy converting the Nuxt 3 app interface to a Nuxt 2 compatible context. This is probably not needed in majority of new apps, but it is still included in bundle.
This PR completely removes the legacy context feature.
👉 Migration
If you are using plugins (perhaps injected by a module) that are relying on the Nuxt 2 format of
(context, inject) => voidthen it needs to be updated to the new Nuxt 3 format of(nuxtApp) => void: https://v3.nuxtjs.org/guide/directory-structure/plugins#creating-pluginsMoreover, if you are relying on the globally available legacy-format
window.$nuxtyou will need to inject it yourself.📝 Checklist