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

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

Copy link
Copy Markdown
Member

🔗 Linked issue

closenuxt/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 logoCodeSandbox logo Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@netlify

netlifyBot commented Nov 13, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

NameLink
🔨 Latest commit152cfe4
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/63736cb3603d2800086149b1

@danielroedanielroe 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 threadpackages/nuxt/src/pages/page-meta.ts
@pi0pi0 mentioned this pull request Nov 15, 2022
Comment threadpackages/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 pi0November 15, 2022 13:26
@pi0pi0 changed the title fix(pages): improve HMR for macrosfix(nuxt): improve hmr for pages macrosNov 15, 2022
pi0
pi0 approved these changes Nov 15, 2022
@pi0
pi0 merged commit f1ae40f into mainNov 15, 2022
@pi0
pi0 deleted the fix/pages-hmr branch November 15, 2022 17:15
danielroe added a commit that referenced this pull request Jan 21, 2023
Co-authored-by: Daniel Roe <daniel@roe.dev>
Sign up for freeto 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

@antfu@pi0@danielroe