Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): name anonymous components in render tree #10011

Merged
merged 1 commit into from
Jan 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/nuxt/src/app/components/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { appLayoutTransition as defaultLayoutTransition } from '#build/nuxt.conf

// TODO: revert back to defineAsyncComponent when https://github.com/vuejs/core/issues/6638 is resolved
const LayoutLoader = defineComponent({
name: 'LayoutLoader',
inheritAttrs: false,
props: {
name: String,
Expand Down Expand Up @@ -42,6 +43,7 @@ const LayoutLoader = defineComponent({
}
})
export default defineComponent({
name: 'NuxtLayout',
inheritAttrs: false,
props: {
name: {
Expand Down
1 change: 1 addition & 0 deletions packages/nuxt/src/app/components/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { defineComponent, h } from 'vue'
import type { Component } from 'vue'

const Fragment = defineComponent({
name: 'FragmentWrapper',
setup (_props, { slots }) {
return () => slots.default?.()
}
Expand Down
5 changes: 3 additions & 2 deletions packages/nuxt/src/pages/runtime/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default defineComponent({
wrapInKeepAlive(props.keepalive ?? routeProps.route.meta.keepalive ?? (defaultKeepaliveConfig as KeepAliveProps), h(Suspense, {
onPending: () => nuxtApp.callHook('page:start', routeProps.Component),
onResolve: () => { nextTick(() => nuxtApp.callHook('page:finish', routeProps.Component).finally(done)) }
}, { default: () => h(Component, { key, routeProps, pageKey: key, hasTransition } as {}) })
}, { default: () => h(RouteProvider, { key, routeProps, pageKey: key, hasTransition } as {}) })
)).default()
}
})
Expand Down Expand Up @@ -84,7 +84,8 @@ function _mergeTransitionProps (routeProps: TransitionProps[]): TransitionProps
return defu(..._props)
}

const Component = defineComponent({
const RouteProvider = defineComponent({
name: 'RouteProvider',
// TODO: Type props
// eslint-disable-next-line vue/require-prop-types
props: ['routeProps', 'pageKey', 'hasTransition'],
Expand Down