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

fix(nuxt): disable payload extraction for spa generated pages - #7535

Merged
pi0 merged 3 commits into
mainfrom
fix/payload-spa
Sep 15, 2022
Merged

fix(nuxt): disable payload extraction for spa generated pages#7535
pi0 merged 3 commits into
mainfrom
fix/payload-spa

Conversation

@pi0

@pi0 pi0 commented Sep 15, 2022

Copy link
Copy Markdown
Member

🔗 Linked issue

https://github.com/nuxt/framework/discussions/7513#discussioncomment-3649155

❓ 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

SPA pages have no actual payload data (other than initial state).

This also fixes issue for special spa (index.html, 200.html and 404.html) routes.

📝 Checklist

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

@netlify

netlify Bot commented Sep 15, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs canceled.

Name Link
🔨 Latest commit c7df6cb
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/6322d4a8aa6ec60008023253

@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.

Looks good to me. Unless we can imagine a nitro plugin injecting initial info into a payload?

What about checking whether there is content in the payload?

@pi0

pi0 commented Sep 15, 2022

Copy link
Copy Markdown
Member Author

Looks good to me. Unless we can imagine a nitro plugin injecting initial info into a payload?

That is still considered the initial state of the page. What we extract to the _payload.js are data and state keys which are nuxt-app state during SSR.

If Nitro plugins extend anything in the payload, it will be ignored by SPA renderer (following up with another PR to change it). But this is a rare and new usecase for prerendering spa with payload support.

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.

2 participants