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 into
mainfrom
fix/pages-hmr
Nov 15, 2022
Merged

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

Conversation

@antfu

@antfu antfu commented Nov 13, 2022

Copy link
Copy Markdown
Member

🔗 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

codesandbox Bot commented Nov 13, 2022

Copy link
Copy Markdown

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

@netlify

netlify Bot commented Nov 13, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

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

@danielroe danielroe left a comment

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.

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