Skip to content
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

[Bug]: plugin-preview cannot be registered at the same time with plugin-playground #1452

Open
moonsky-all opened this issue Oct 9, 2024 · 4 comments
Labels
🐞 bug Something isn't working

Comments

@moonsky-all
Copy link

版本信息

System:
OS: macOS 15.0.1
CPU: (12) arm64 Apple M2 Max
Memory: 169.23 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Browsers:
Chrome: 129.0.6668.90
Edge: 129.0.2792.79
Safari: 18.0.1
npmPackages:
@rspress/plugin-playground: ^1.32.0 => 1.32.0
@rspress/plugin-preview: ^1.32.0 => 1.32.0
rspress: ^1.32.0 => 1.32.0

问题详情

Image

我同时注册了这俩个插件,使用的时候

// playground 可以运行
```jsx playground
export default function() {
   return (<div>123123</div>);
}
```

// preview 不能运行
```jsx preview
export default function() {
   return (<div>123123</div>);
}
```

Image

复现链接

https://codesandbox.io/p/devbox/pensive-sun-s7qlmt?workspaceId=296743f9-8ac2-49cc-8a7a-a135af41a026

复现步骤

如图,当 playground 和 preview 共存时,preview 用 code 显示了代码,而不是渲染代码

@moonsky-all moonsky-all added the 🐞 bug Something isn't working label Oct 9, 2024
@Timeless0911 Timeless0911 changed the title [Bug]: plugin-preview 不能和 plugin-playground 同时注册 [Bug]: plugin-preview cannot be registered at the same time with plugin-playground Oct 9, 2024
@Timeless0911
Copy link
Collaborator

This is a known issue, and we will refactor the playground and preview plugin in Rspress V2.

@moonsky-all
Copy link
Author

目测 v2 还有段时间才发布吧?大概还有多久呢

@Timeless0911
Copy link
Collaborator

目测 v2 还有段时间才发布吧?大概还有多久呢

The current design does not allow to use of both plugins at the same time. And there is no clear time at the moment for Rspress V2, but at least next year.

@moonsky-all
Copy link
Author

That's too long

我看源码应该可以自己用 Playground 的 Runner 实现一个试试

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants