web-infra-dev / rspress

🦀💨 A fast Rspack-based static site generator.
https://rspress.dev
MIT License
1.46k stars 135 forks source link

[Feature][plugin-comp-preview]: combine plugin-preview and plugin-playground into one #1574

Open SoonIter opened 1 week ago

SoonIter commented 1 week ago

What problem does this feature solve?

https://github.com/web-infra-dev/rspress/discussions/1105#discussioncomment-9516076

closes https://github.com/web-infra-dev/rspress/issues/1452

What does the proposed API look like?

some historical problems need to be solved

  1. support tsx syntax highlight and no type error, closes https://github.com/web-infra-dev/rspress/issues/1113

Image

  1. support ```tsx pure ```tsx playground ```tsx preview can be used together ```tsx default value should be pure

"playground" should be editable "preview" to reduce the learn cost

  1. style isolated (iframe or shadow-dom), closes https://github.com/web-infra-dev/rspress/issues/1394

  2. multiple files support(optional), closes https://github.com/web-infra-dev/rspress/issues/1315

shulaoda commented 1 week ago

Let me briefly understand it, the actual development work may take place next week.

SoonIter commented 1 week ago

any new design can be accepeted, this would be a new plugin called plugin-comp-preview, and it won't has any relation to plugin-preview and plugin-playground (for no breaking)

chenjiahan commented 1 week ago

This is worth writing an RFC to explain the new design and what problems it solves.