Repository navigation
[Website] Add standalone playground block demo page - #3071
Merged
Merged
Conversation
This extracts the playground_demo_maybe_render_full_page_block functionality from the WordPress Playground Block plugin into a standalone HTML page that can be shipped on playground.wordpress.net. The page provides an interactive code editor with live WordPress Playground preview, supporting multi-file editing with syntax highlighting, JSX transpilation, and real-time preview updates. Key features: - Multi-file code editor with syntax highlighting (PHP, JS, CSS, HTML, JSON) - File tabs for switching between files - Download code as ZIP - Live WordPress Playground preview - URL parameter support for sharing configurations - Full-page and embedded view modes The page reads configuration from URL query parameters: - ?playground-full-page&playground-attributes=<base64> for full page mode - ?playground-attributes=<base64> for embedded mode - No parameters shows a default demo New dependencies: @uiw/react-codemirror, esbuild-wasm, sass
Add Playwright E2E tests covering the three main use-cases: 1. Simple Code Editor (PHP Plugin) - tests code editor visibility, plugin output rendering, and side-by-side layout 2. JSX Transpilation - tests multi-file tabs, JSX rendering in WordPress, and JSX syntax in the editor 3. Full Page Playground Only - tests no-editor mode with full-width WordPress Playground display The tests verify that the standalone playground block frame page works correctly with URL-based configurations for code editing and WordPress Playground preview.
adamziel
added a commit
to WordPress/playground-tools
that referenced
this pull request
Dec 22, 2025
Rewires the "Open in a new tab" link in the Playground block to go directly to playground.wordpress.net/, see the [related Playground handler logic](WordPress/wordpress-playground#3071). This commit simplifies the plugin and shifts work from the local site to the Playground. ## Testing instructions 1. Start a local dev server via `nx dev wordpress-playground-block` 2. Create a new post 3. Add the Playground block 4. Create a few files in that block 5. Publish the page 6. View the published page 7. Click the "Open in a new tab" link 8. Confirm it opens at playground.wordpress.net
adamziel
added a commit
to WordPress/playground-tools
that referenced
this pull request
Dec 22, 2025
…#397) Rewires the "Open in a new tab" link in the Playground block to go directly to playground.wordpress.net/, see the [related Playground handler logic](WordPress/wordpress-playground#3071). This commit simplifies the plugin and shifts work from the local site to the Playground. ## Testing instructions 1. Start a local dev server via `nx dev wordpress-playground-block` 2. Create a new post 3. Add the Playground block 4. Create a few files in that block 5. Publish the page 6. View the published page 7. Click the "Open in a new tab" link 8. Confirm it opens at playground.wordpress.net
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extracts the
playground_demo_maybe_render_full_page_blockfunctionality from the WordPress Playground Block plugin into a standalone HTML page that can be shipped on playground.wordpress.net.The page provides an interactive code editor with live WordPress Playground preview, supporting:
URL Parameters
The page reads configuration from URL query parameters:
?playground-full-page&playground-attributes=<base64>for full page mode?playground-attributes=<base64>for embedded modeTesting instructions
First, CI should be green – this PR ships the relevant E2E tests.
Then, follow these steps:
/playground-block-demo.htmland verify the default demo loadsTest these on the deployed preview or local dev server (
http://localhost:5400/website-extras/playground-block-demo.html):1. Simple Code Editor (PHP Plugin)
Shows a basic PHP plugin with code editor and live preview side-by-side.
2. JSX Transpilation (Interactive React Counter)
Demonstrates JSX transpilation with a multi-file plugin containing a React component.
3. Full Page Playground Only (No Editor)
Shows WordPress Playground without the code editor - just the live WordPress instance.