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

feat(nuxt): add ssr route rule to enable SPA mode #7938

Merged
merged 5 commits into from
Oct 11, 2022
Merged

Conversation

danielroe
Copy link
Member

πŸ”— Linked issue

https://github.com/nuxt/framework/discussions/560

❓ 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 change adds a ssr route rule to easily enable SPA mode for a route or group of routes:

Usage

export default defineNuxtConfig({
  nitro: {
    routes: {
      '/test': { ssr: false }
    }
  }
})

When nitrojs/nitro#538 merges (or in another PR implementing something like nitrojs/nitro@da12900), we can also refactor this to depend on event.context.routeOptions rather than having to construct a fresh matcher within the nuxt renderer.

πŸ“ Checklist

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

@danielroe danielroe added enhancement New feature or request nitro 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Sep 30, 2022
@danielroe danielroe requested a review from pi0 September 30, 2022 20:39
@danielroe danielroe self-assigned this Sep 30, 2022
@codesandbox
Copy link

codesandbox bot commented Sep 30, 2022

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

@netlify
Copy link

netlify bot commented Sep 30, 2022

βœ… Deploy Preview for nuxt3-docs canceled.

Name Link
πŸ”¨ Latest commit 3373ba3
πŸ” Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/63457b69bdac260009c71fd5

@danielroe danielroe requested a review from atinux October 11, 2022 15:33
@danielroe danielroe merged commit 5f003a9 into main Oct 11, 2022
@danielroe danielroe deleted the feat/spa-route-rule branch October 11, 2022 16:03
@danielroe danielroe mentioned this pull request Oct 25, 2022
7 tasks
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3.x enhancement New feature or request nitro 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants