-
Notifications
You must be signed in to change notification settings - Fork 346
[Website] IDE-like PHP playground #2699
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
Conversation
…t more CLI commands, compute the current edited file path
Introduced sandboxedSpawnHandlerFactory support for `ls` and `pwd` commands. This will help Playground provide a useful terminal. A part of #2699 ## Testing instructions CI – this PR comes with a unit test.
## Motivation for the change, related issues Pre-requisite for #2699. Empowers developers to create terminal-enabled apps by exporting the `splitShellCommand()` utility that was internal before. ```ts import { splitShellCommand } from "@php-wasm/util"; splitShellCommand('wp create post --title="Great post title!"'); ['wp', 'create', 'post', '--title=Great post title!'] ```
export const DEFAULT_WP_REMOTE = 'http://127.0.0.1:5400/remote.html'; | ||
// export const DEFAULT_WP_REMOTE = 'https://playground.wordpress.net/remote.html'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the reason for the error on https://playground.wordpress.net/beta-php-playground.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yup, I'm adjusting this at #2717. We'll need some e2e tests, too, to make sure it keeps working
Motivation for the change, related issues
Introduces a beta version of PHP Playground that has a file explorer and a built-in terminal with
php
,wp
, andcomposer
commands available:It does not replace the existing PHP Playground, only introduces a new beta version. We won't replace the existing one until a few people confirm the new one is useful and stable.
After merging and deploying, it will be available at https://playground.wordpress.net/beta-php-playground.html
This PR supersedes #2694
Implementation details
This PR ships mostly new code and updates code unused anywhere else. The few changes it makes to the shared configuration are non-destructive and mostly don't affect the existing packages.
FilePickerTree component
Ships a substantial update to the FilePickerTree component to:
It seems like it breaks the "type to focus" interaction. That's fine, we'll fix it in a follow-up. That component isn't used anywhere else at the moment so we're not breaking any other page.
It also ships a few e2e tests to be expanded
New package
This PR ships an additional
website-extras
package with the beta version of PHP Playground. Why a new package? Because thewebsite
packages is built offline-first. We have manifest.json automations in place for PWAs so browsers can download and cache most of the built files. Maintaining a clear separation between required and optional files is a substantial burden. Hence, this PR takes another approach entirely and clearly separates the offline-first parts from the parts we don't need to ask the client to download pre-emptively.The nx build pipeline will build the
remote
package, thewebsite
package, build the list of assets required for offline mode, prepare the website deployment, and only then it will merge thewebsite-extras
into that deployment directory.Testing Instructions (or ideally a Blueprint)
Go to http://127.0.0.1:5400/website-extras/beta-php-playground.html and play with the beta PHP Playground.