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

feat(nuxt)!: add NuxtPage to #components #8145

Merged
merged 5 commits into from Oct 14, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/nuxt/src/core/nuxt.ts
Expand Up @@ -157,6 +157,12 @@ async function initNuxt (nuxt: Nuxt) {
filePath: resolve(nuxt.options.appDir, 'components/nuxt-loading-indicator')
})

// Add <NuxtPage>
addComponent({
name: 'NuxtPage',
filePath: resolve(distDir, 'pages/runtime/page')
})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably only be done in the pages module instead (packages/nuxt/src/pages/module.ts) - this should not be added if the pages module isn't enabled.

note that we manually register the component here:

nuxtApp.vueApp.component('NuxtPage', NuxtPage)
// TODO: remove before release - present for backwards compatibility & intentionally undocumented
nuxtApp.vueApp.component('NuxtNestedPage', NuxtPage)
nuxtApp.vueApp.component('NuxtChild', NuxtPage)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes of course πŸ˜… .
With the components loader, is the manual register still needed ? πŸ€”

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's try removing it 🀯 But let's manually import in the default app.vue file...

We've just done a very similar thing in #8167 (review).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the release should happens soon (i hope so πŸ˜„), what do you think about removing NuxtChild and NuxtChild too ?

Do you mean this one

with a manual import from #components ?

Copy link
Member

@danielroe danielroe Oct 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed about removing deprecated components. I would do a manual relative import.


// Deprecate hooks
nuxt.hooks.deprecateHooks({
'autoImports:sources': {
Expand Down