This is a playground project built with Astro, supporting Vue, React, Solid, and Svelte.
- Multi-Framework Support: Switch between Vue, React, Solid, and Svelte.
- CDN-based: All framework dependencies are loaded via CDN in the preview iframe, ensuring isolation and lightweight initial load.
- Monaco Editor: Integrated code editor with syntax highlighting.
- Live Preview: Code is compiled (if necessary) and executed in the browser.
- Shell: The main application is built with Astro and React (for the Playground component).
- Editor: Monaco Editor is used for code input.
- Preview: An
iframeis used to render the user's code. - Compilation:
- React: Uses
@babel/standalonein the iframe to compile JSX. - Vue: Uses
vue.global.js(Runtime + Compiler) to compile templates on the fly. - Solid: Uses
solid-js/html(Tagged Template Literals) to avoid complex in-browser JSX compilation for this demo. - Svelte: Uses
svelte/compilerfrom CDN to compile Svelte components in the browser.
- React: Uses
pnpm install
pnpm devPull requests opened against next are deployed to an isolated Zeabur service. The preview is updated when new commits are pushed, its URL is kept in a single pull request comment, and the service is removed when the pull request is closed or merged.
The workflow requires the following GitHub repository configuration:
- Secret:
ZEABUR_TOKEN - Variable:
ZEABUR_PROJECT_ID - Variable:
ZEABUR_ENVIRONMENT_ID
For security, previews run only for branches in this repository. Pull requests from forks are not given access to the Zeabur token.
- SolidJS: Uses
htmltagged templates for simplicity in the CDN environment. - Svelte: Uses the Svelte 4 compiler from CDN.