Skip to content

[Feature][RuntimeComponent]: <ReactMarkdown /> for mdx parsing and <CodeBlockRuntime /> for code block #2126

@SoonIter

Description

@SoonIter

What problem does this feature solve?

#2122 (comment)

The runtime component will increase the bundle size and will not be recorded in static data such as searchIndex.
it is out of the control of Rspress literally, they are advanced usages
So we can provide a Component with md syntax parsing at runtime just like <ReactMarkdown /> and <CodeBlockRuntime /> and clarify the difference from Rspress compile time
https://fumadocs.dev/docs/ui/components/dynamic-codeblock

What does the proposed API look like?

  1. mdx parsing runtime component

a runtime component like react-markdown integrated with default remark plugins

https://github.com/web-infra-dev/rspress/blob/0a75ac2be9e54ee58a1555a0179e28efefc43f06/packages/plugin-api-docgen/static/global-components/API.tsx

  1. code block parsing runtime component
<CodeBlockRuntime />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions