Skip to content

Conversation

adamziel
Copy link
Collaborator

Motivation for the change, related issues

🚧 Work in progress 🚧

CleanShot 2025-09-29 at 01 55 42@2x (1)

Implementation details

Testing Instructions (or ideally a Blueprint)

…t more CLI commands, compute the current edited file path
@adamziel adamziel closed this Sep 30, 2025
adamziel added a commit that referenced this pull request Oct 1, 2025
## 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`, and `composer` commands available:

<img width="3450" height="1988" alt="CleanShot 2025-09-29 at 01 55 42@2x
(1)"
src="https://github.com/user-attachments/assets/a54c85aa-322c-4025-82b6-44c733c90f3f"
/>

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:

* Accept an asynchronous filesystem 
* Consider asynchronous nature of operations in interactions such as
initial loading, expanding tree nodes, renaming files
* Have contextual menu with delete, rename, create file/dir operations
* Support moving nodes via drag&drop 
* Support "uploading" files from the desktop via drag&drop 

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 the `website`
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, the `website`
package, build the list of assets required for offline mode, prepare the
website deployment, and only then it will merge the `website-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.
adamziel added a commit that referenced this pull request Oct 1, 2025
…mote.html (#2717)

## Motivation for the change, related issues

#2694 is trying to attach to a local remote (127.0.0.1) instead of
https://playground.wordpress.net/remote.html. This PR makes it use a
remote appropriate for a given environment by leveraging the same
`website-config` virtual vite module as the `@wp-playground/website`
package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant