Docs (bridge): clarify migration of defineNuxtPlugin #12824
Description
On one hand, the docs https://github.com/nuxt/framework/blob/main/docs/content/1.getting-started/4.bridge-composition-api.md#definenuxtplugin recommend to simply replace defineNuxtPlugin by a function export. On the other hand, https://github.com/nuxt/framework/blob/main/docs/content/3.docs/2.directory-structure/10.plugins.md and https://github.com/nuxt/framework/blob/7cc526ce69a541782f16023deb5104dc51068615/packages/bridge/src/runtime/capi.legacy.mjs#L82 advocate to still use defineNuxtPlugin
imported from #app
.
Moreover, I'm not sure if the advised typing information (import type { Plugin } from '@nuxt/types'
) makes sense; at least I cannot get a nuxtApp
from the context: The context from @nuxt/types
doesn't have a $_nuxtApp
variable; but maybe one is supposed to use useNuxtApp
anyway?