Skip to content

feat(ssg): add ssg.experimentalExcludeRoutePaths#2405

Merged
SoonIter merged 5 commits intomainfrom
syt/ssg-experimenta
Jul 22, 2025
Merged

feat(ssg): add ssg.experimentalExcludeRoutePaths#2405
SoonIter merged 5 commits intomainfrom
syt/ssg-experimenta

Conversation

@SoonIter
Copy link
Copy Markdown
Member

@SoonIter SoonIter commented Jul 22, 2025

Summary

feat(ssg): add ssg.experimentalExcludeRoutePaths

experimentalExcludeRoutePaths

  • Type: (string | RegExp)[]
  • Default: []

After enabled, some pages will not be rendered by SSG, and they will directly use html under CSR. This is suitable for SSG errors in large document sites bypassing a small number of pages. It is not recommended to enable this option actively.

Related Issue

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings July 22, 2025 06:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new experimental configuration option ssg.experimentalIgnoreRoutePaths to allow selective exclusion of routes from SSG rendering, replacing the previous experimentalLoose option. The feature enables large document sites to bypass SSG errors for specific pages by falling back to CSR rendering.

  • Replaces experimentalLoose boolean option with experimentalIgnoreRoutePaths array that accepts strings and RegExp patterns
  • Implements logic to filter routes and render ignored paths as CSR pages during the SSG process
  • Updates documentation in both English and Chinese to reflect the API changes

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/shared/src/types/index.ts Updates SSG configuration interface, replacing experimentalLoose with experimentalIgnoreRoutePaths
packages/shared/src/types/defaultTheme.ts Adds missing @default false documentation for enableAppearanceAnimation
packages/document/rspress.config.ts Updates theme configuration, replacing enableAppearanceAnimation with lastUpdated
packages/document/docs/zh/api/config/config-basic.mdx Updates Chinese documentation for the new experimentalIgnoreRoutePaths option
packages/document/docs/en/api/config/config-basic.mdx Updates English documentation for the new experimentalIgnoreRoutePaths option
packages/core/src/runtime/ssrServerEntry.tsx Removes error handling logic related to deprecated experimentalLoose option
packages/core/src/node/ssg/renderPages.ts Implements core logic for filtering routes and rendering CSR pages for ignored paths
packages/core/src/node/runtimeModule/runtimeConfig.ts Removes SSG configuration from runtime exports

Comment thread packages/shared/src/types/index.ts Outdated
Comment thread packages/core/src/node/ssg/renderPages.ts Outdated
Comment thread packages/core/src/node/ssg/renderPages.ts
@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 22, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit d0b24b6
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/687f3c7f988658000930b570
😎 Deploy Preview https://deploy-preview-2405--rspress-v2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Jul 22, 2025

Deploy Preview for rspress ready!

Name Link
🔨 Latest commit d0b24b6
🔍 Latest deploy log https://app.netlify.com/projects/rspress/deploys/687f3c7f7888d30008da6e95
😎 Deploy Preview https://deploy-preview-2405--rspress.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 90 (🟢 up 13 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (🟢 up 9 from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Timeless0911
Timeless0911 previously approved these changes Jul 22, 2025
@SoonIter SoonIter requested a review from Timeless0911 July 22, 2025 07:01
@SoonIter SoonIter changed the title feat(ssg): add ssg.experimentalIgnoreRoutePaths feat(ssg): add ssg.experimentalExcludeRoutePaths Jul 22, 2025
Timeless0911
Timeless0911 previously approved these changes Jul 22, 2025
@SoonIter SoonIter requested a review from Timeless0911 July 22, 2025 08:06
@SoonIter SoonIter merged commit 6cac176 into main Jul 22, 2025
11 checks passed
@SoonIter SoonIter deleted the syt/ssg-experimenta branch July 22, 2025 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants