-
-
Notifications
You must be signed in to change notification settings - Fork 199
feat: ssg-md #2666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: ssg-md #2666
Conversation
✅ Deploy Preview for rspress-v2 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this 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.
* @default false | ||
* @experimental | ||
*/ | ||
llms?: |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBD
Summary
feat: md-ssg
Related Issue
Checklist