Skip to content

Conversation

SoonIter
Copy link
Member

Summary

feat: md-ssg

Related Issue

Checklist

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

@Copilot Copilot AI review requested due to automatic review settings October 19, 2025 10:16
Copy link

netlify bot commented Oct 19, 2025

Deploy Preview for rspress-v2 ready!

Name Link
🔨 Latest commit 1a2891e
🔍 Latest deploy log https://app.netlify.com/projects/rspress-v2/deploys/68f8bfbaa6040300079490c0
😎 Deploy Preview https://deploy-preview-2666--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.

Copy link
Contributor

@Copilot 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 implements a new "md-ssg" (Markdown Static Site Generation) feature that enables rendering React components to Markdown format during the build process. The implementation includes a custom React reconciler that converts React elements to Markdown strings, along with associated build configuration and remark plugins.

Key Changes:

  • Added custom React reconciler for rendering React components to Markdown
  • Implemented remark plugin for wrapping/filtering Markdown content with JSX
  • Created new build environment (node_md) for SSG-MD compilation

Reviewed Changes

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

Show a summary per file
File Description
website/rspress.config.ts Commented out pluginLlms
vitest.workspace.ts Extended test file pattern to include .tsx files
scripts/dictionary.txt Added MDSSG and SSGMD to dictionary, alphabetized entries
packages/theme-default/src/logic/sideEffects.ts Added window existence check for SSR compatibility
packages/theme-default/src/components/Toc/useDynamicToc.ts Added window existence check for SSR compatibility
packages/theme-default/src/components/Toc/useActiveAnchor.ts Added window existence check and prefixed getComputedStyle with window
packages/theme-default/src/components/SidebarMenu/useClickOutside.ts Added document existence check and simplified null check
packages/theme-default/src/components/Sidebar/SidebarItem.tsx Added optional chaining for scrollIntoView
packages/theme-default/src/components/ReadPercent/useReadPercent.ts Added window existence check for SSR compatibility
packages/theme-default/src/components/NavHamburger/useNavScreen.ts Added window existence checks in open/close functions
packages/runtime/src/hooks/useWindowSize.ts Added window existence check in useLayoutEffect
packages/core/static/MediumZoom.tsx Added document check and prefixed setTimeout with window
packages/core/src/runtime/ssrMdServerEntry.tsx New SSR entry point for MD rendering
packages/core/src/runtime/App.tsx Added Content import and SSR_MD condition to render only Content
packages/core/src/node/ssg-md/rsbuildPluginSSGMD.ts New Rsbuild plugin for SSG-MD build process
packages/core/src/node/ssg-md/renderPages.ts Renders all pages to Markdown files
packages/core/src/node/ssg-md/renderPage.ts Renders individual page to Markdown
packages/core/src/node/ssg-md/remarkWrapMarkdown.ts Remark plugin for wrapping/filtering Markdown with JSX
packages/core/src/node/ssg-md/remarkWrapMarkdown.test.ts Test suite for remarkWrapMarkdown plugin
packages/core/src/node/ssg-md/react/render.ts Renders React elements to Markdown strings
packages/core/src/node/ssg-md/react/render.test.tsx Tests for React-to-Markdown rendering
packages/core/src/node/ssg-md/react/reconciler.ts Custom React reconciler for Markdown output
packages/core/src/node/ssg-md/react/index.ts Exports renderToMarkdownString function
packages/core/src/node/mdx/types.ts Added isSsgMd option to MdxLoaderOptions
packages/core/src/node/mdx/remarkPlugins/link.ts Fixed dead link checking logic for cleanUrls handling
packages/core/src/node/mdx/processor.ts Added isSsgMd parameter support
packages/core/src/node/mdx/options.ts Configured MDX options for SSG-MD mode
packages/core/src/node/mdx/loader.ts Added isSsgMd option and disabled cache for SSG-MD
packages/core/src/node/initRsbuild.ts Configured node_md build environment and SSG-MD plugin
packages/core/src/node/constants.ts Added SSG_MD constants
packages/core/rslib.config.ts Added build config for react module
packages/core/package.json Added dependencies and export path for _private/react
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@SoonIter SoonIter changed the title feat: md-ssg feat: ssg-md Oct 19, 2025
* @default false
* @experimental
*/
llms?:
Copy link
Contributor

Choose a reason for hiding this comment

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

Relationship between llms plugin and core logic should be determined.

"types": "./dist/shiki-transformers.d.ts",
"default": "./dist/shiki-transformers.js"
},
"./_private/react": {
Copy link
Contributor

Choose a reason for hiding this comment

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

TBD

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.

2 participants