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

fix(nuxt): improve hmr for pages macros#8940

Merged
pi0 merged 4 commits intomainfrom
fix/pages-hmr
Nov 15, 2022
Merged

fix(nuxt): improve hmr for pages macros#8940
pi0 merged 4 commits intomainfrom
fix/pages-hmr

Conversation

@antfu
Copy link
Copy Markdown
Member

@antfu antfu commented Nov 13, 2022

🔗 Linked issue

close nuxt/nuxt#15410

❓ 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

📝 Checklist

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

@codesandbox
Copy link
Copy Markdown

codesandbox Bot commented Nov 13, 2022

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

@netlify
Copy link
Copy Markdown

netlify Bot commented Nov 13, 2022

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit 152cfe4
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/63736cb3603d2800086149b1

Copy link
Copy Markdown
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

thank you so much for looking at this ❤️

Comment thread packages/nuxt/src/pages/page-meta.ts
@pi0 pi0 mentioned this pull request Nov 15, 2022
Comment thread packages/nuxt/src/pages/page-meta.ts Outdated
Comment on lines +22 to +35
if (process.dev) {
// Vite
if (import.meta.hot) {
import.meta.hot.accept(mod => {
Object.assign(__nuxt_page_meta, mod)
})
}
// Webpack
if (import.meta.webpackHot) {
import.meta.webpackHot.accept((err) => {
if (err) { window.location = window.location.href }
})
}
}`
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.

updated to add webpack equivalent, but I was not able to test this as it seems that no HMR updates are triggered for page meta - am I doing something wrong @antfu?

@danielroe danielroe requested a review from pi0 November 15, 2022 13:26
@pi0 pi0 changed the title fix(pages): improve HMR for macros fix(nuxt): improve hmr for pages macros Nov 15, 2022
@pi0 pi0 merged commit f1ae40f into main Nov 15, 2022
@pi0 pi0 deleted the fix/pages-hmr branch November 15, 2022 17:15
@danielroe danielroe added the 3.x label Jan 19, 2023
danielroe added a commit that referenced this pull request Jan 21, 2023
Co-authored-by: Daniel Roe <daniel@roe.dev>
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.

HMR doesn't work for pages (3.0.0-rc.13)

3 participants