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

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

Merged
merged 3 commits into from Sep 15, 2022

Conversation

pi0
Copy link
Member

@pi0 pi0 commented Sep 15, 2022

πŸ”— 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
Copy link

netlify bot commented Sep 15, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit c7df6cb
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/6322d4a8aa6ec60008023253

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.

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
Copy link
Member Author

pi0 commented Sep 15, 2022

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.

None yet

2 participants