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

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

Merged
pi0 merged 5 commits intonuxt:mainfrom
huang-julien:feat/#component_NuxtPage
Oct 14, 2022
Merged

feat(nuxt)!: add NuxtPage to #components#8145
pi0 merged 5 commits intonuxt:mainfrom
huang-julien:feat/#component_NuxtPage

Conversation

@huang-julien
Copy link
Copy Markdown
Member

🔗 Linked issue

resolve nuxt/nuxt#14876

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Hi 🙂 , this PR adds NuxtPage component to #components

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@codesandbox
Copy link
Copy Markdown

codesandbox Bot commented Oct 12, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 12, 2022

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit 6beb099
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/6348979d5769a900092ef0c7

Comment thread packages/nuxt/src/core/nuxt.ts Outdated
Comment on lines +160 to +164
// Add <NuxtPage>
addComponent({
name: 'NuxtPage',
filePath: resolve(distDir, 'pages/runtime/page')
})
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

@danielroe danielroe self-requested a review October 13, 2022 08:46
@danielroe danielroe changed the title feat(nuxt): add NuxtPage to #components feat(nuxt)!: add NuxtPage to #components Oct 13, 2022
Comment thread packages/nuxt/src/pages/runtime/app.vue Outdated
@pi0 pi0 merged commit 23ad303 into nuxt:main Oct 14, 2022
@pi0
Copy link
Copy Markdown
Member

pi0 commented Oct 14, 2022

Thanks!

@pi0 pi0 mentioned this pull request Oct 18, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

components.d.ts file does not contain NuxtPage components

3 participants