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

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

Merged
merged 4 commits into from
Nov 15, 2022
Merged

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

merged 4 commits into from
Nov 15, 2022

Conversation

antfu
Copy link
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

codesandbox bot commented Nov 13, 2022

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

@netlify
Copy link

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
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 ❀️

packages/nuxt/src/pages/page-meta.ts Outdated Show resolved Hide resolved
@pi0 pi0 mentioned this pull request Nov 15, 2022
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
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