Conversation
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
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.
5d46a69 to
1a2891e
Compare
83aa00e to
53dc3c0
Compare
Timeless0911
approved these changes
Nov 4, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
feat: md-ssg
Related Issue
Checklist