Skip to content

Conversation

@chenjiahan
Copy link
Member

Summary

Adds documentation for SSR-specific plugin development. The changes provide examples and guidance on how to adapt Rsbuild and Rspack configurations, as well as how to transform code for SSR and client environments.

Checklist

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

Copilot AI review requested due to automatic review settings May 28, 2025 14:51
@netlify
Copy link

netlify bot commented May 28, 2025

Deploy Preview for rsbuild ready!

Name Link
🔨 Latest commit c133fef
🔍 Latest deploy log https://app.netlify.com/projects/rsbuild/deploys/6837230a4e7bb800082a8b11
😎 Deploy Preview https://deploy-preview-5330--rsbuild.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: 72 (🔴 down 1 from production)
Accessibility: 97 (no change from production)
Best Practices: 92 (no change from production)
SEO: 100 (no change from production)
PWA: 60 (no change from production)
View the detailed breakdown and full score reports

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

Copy link
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 documentation for SSR-specific plugin development in both English and Chinese guides, showing how to use Rsbuild and Rspack hooks as well as code transforms for SSR versus client builds.

  • Introduces an “SSR-specific plugins” section with examples for modifyEnvironmentConfig, modifyRspackConfig, and transform.
  • Adds parallel content to the Chinese (zh) and English (en) advanced SSR docs.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
website/docs/zh/guide/advanced/ssr.mdx Added SSR 插件适配示例,包括 Rsbuild/Rspack 配置和代码转换。
website/docs/en/guide/advanced/ssr.mdx Added SSR-specific plugin examples for Rsbuild/Rspack and transforms.
Comments suppressed due to low confidence (6)

website/docs/zh/guide/advanced/ssr.mdx:198

  • 请确认 /plugins/dev/hooks#modifyenvironmentconfig 的锚点名称与实际文档中的 Heading ID 一致,以避免链接失效。
- 通过 [modifyEnvironmentConfig](/plugins/dev/hooks#modifyenvironmentconfig) 修改 SSR 场景下的 Rsbuild 配置:

website/docs/zh/guide/advanced/ssr.mdx:213

  • 请验证 /plugins/dev/hooks#modifyrspackconfig 锚点是否与目标文档标题 ID 匹配,确保链接正常跳转。
- 通过 [modifyRspackConfig](/plugins/dev/hooks#modifyrspackconfig) 修改 SSR 场景下的 Rspack 配置:

website/docs/zh/guide/advanced/ssr.mdx:228

  • 请检查 /plugins/dev/core#apitransform 的锚点是否正确(与 transform API 部分的 Heading ID 对应),避免用户点击后出现 404。
- 通过 [transform](/plugins/dev/core#apitransform) 为 SSR 和客户端分别进行代码转换:

website/docs/en/guide/advanced/ssr.mdx:198

  • Please verify that the /plugins/dev/hooks#modifyenvironmentconfig anchor matches the actual Heading ID in the hooks documentation to prevent broken links.
- Modify Rsbuild configuration for SSR via [modifyEnvironmentConfig](/plugins/dev/hooks#modifyenvironmentconfig):

website/docs/en/guide/advanced/ssr.mdx:213

  • Double-check that the /plugins/dev/hooks#modifyrspackconfig anchor exists in the hooks reference; mismatches can lead to incorrect navigation.
- Modify Rspack configuration for SSR via [modifyRspackConfig](/plugins/dev/hooks#modifyrspackconfig):

website/docs/en/guide/advanced/ssr.mdx:228

  • Ensure that /plugins/dev/core#apitransform corresponds exactly to the Heading ID in the core API docs to keep the link functional.
- Transform code for SSR and client separately via [transform](/plugins/dev/core#apitransform):

@chenjiahan chenjiahan merged commit 8238be4 into main May 28, 2025
12 checks passed
@chenjiahan chenjiahan deleted the ssr_plugins_0528 branch May 28, 2025 23:44
@chenjiahan chenjiahan mentioned this pull request Jun 2, 2025
@chenjiahan chenjiahan mentioned this pull request Jun 26, 2025
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.

1 participant