Skip to content

fix(nuxt): only fetch payloads for prerendered routes - #18419

Closed
danielroe wants to merge 2 commits into
mainfrom
feat/route-manifest
Closed

danielroe wants to merge 2 commits into
mainfrom
feat/route-manifest

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

#14507

resolves #15024

❓ 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

This PR adds support for an app manifest (at /manifest.json) which contains, at the moment, simply a list of routes for which there are corresponding payloads. With the implementation of route rules this manifest can be extended/modified. In addition, it can be extended with a build hash to allow version change detection.

With this PR:

  • we will not fetch payloads for pages that were not prerendered (they would give a 404)
  • will will fetch all payloads if there is an SSR/hybrid app
  • we can fetch payloads in development mode if experimental.payloadExtraction is set by the user to true (there are more edge cases, such as CORS, with client-side fetching, so I felt it was better to set default to false in dev mode so user handles them properly, in case they are not prerendering all their pages).
  • support for hybrid payload extraction (e.g. some but not all routes have SSR payloads) is deferred to implementation of route rules

(Note, @pi0, I'm also happy to go ahead and implement route rules, but thought we could adopt this approach for now and modify it at that point.)

📝 Checklist

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

@danielroe danielroe self-assigned this Jan 21, 2023
@codesandbox

codesandbox Bot commented Jan 21, 2023

Copy link
Copy Markdown

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

@vercel
vercel Bot temporarily deployed to Preview January 21, 2023 14:47 Inactive
@danielroe danielroe added 3.x ✨ enhancement New feature or improvement to existing functionality 🐛 bug Something isn't working as expected 🔨 p3-minor Minor issue, should be fixed labels Jan 21, 2023
@TheAlexLichter TheAlexLichter mentioned this pull request Jun 5, 2023
3 of 4 tasks
@danielroe danielroe closed this Jul 30, 2023
@danielroe
danielroe deleted the feat/route-manifest branch October 24, 2023 01:04

This branch was successfully deployed

1 active deployment
Preview — 109922ed Deployed Jan 21, 2023 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x 🐛 bug Something isn't working as expected ✨ enhancement New feature or improvement to existing functionality 🔨 p3-minor Minor issue, should be fixed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Page with redirect not generated, causing "Cannot load payload ..._payload.js TypeError: Failed to fetch dynamically imported module"

1 participant