Skip to content

Commit

Permalink
[Remote] Remove the "light" PHP.wasm bundle and only ship the "kitche…
Browse files Browse the repository at this point in the history
…n-sink" build (#1861)

Maintaining the "light" PHP.wasm bundle is a burden (#1848), especially
with the JSPI support on the horizon (#1339). Only 1.3% of Playgrounds
are loaded with the `light` extension bundle (see #1848).

Let's thus simplify the project maintenance and remove the "light"
bundle. After this PR, every Playground will be loaded with the
"kitchen-sink" extension bundle. This PR also drops the name
"kitchen-sink". From now on, it's just "php",

 ## Developer notes

The web version of Playground at playground.wordpress.net no longer
ships the `light` build of PHP.wasm. Instead, it only ships the
`kitchen-sink` build where popular PHP extensions are available (e.g.
libxml, libopenssl). Note that the `kitchen-sink` build was already used
by 98.7% of Playgrounds and most users are not affected by this.

This change will help Playground maintainers focus on a single version
and enable solving a lot of PHP.wasm stability issues by [migrating to
JSPI](#1339).

The CLI version of Playground is unaffected by this change.

The following APIs are now deprecated. Playground will accept them
without crashing, but they will no longer have any effect:

* `phpExtensionBundles` Blueprint setting
* `php-extension-bundle` Query API parameter

## Follow up work

- [ ] Publish the developer notes on
https://make.wordpress.org/playground/
- [x] Share this in the WP.org Slack channel
([done](https://wordpress.slack.com/archives/C04EWKGDJ0K/p1728405828152549))

 ## Testing instructions

* Confirm Playground continues to work in the local dev env
* Confirm the CI is green – it would perform a thorough test run of many
user flows.

Closes #1848
  • Loading branch information
adamziel authored Oct 9, 2024
1 parent 41bb913 commit bacc516
Show file tree
Hide file tree
Showing 71 changed files with 1,398 additions and 2,778 deletions.
3 changes: 1 addition & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ packages/php-wasm/compile/*/dist linguist-vendored
packages/php-wasm/compile/libz/zlib-src linguist-vendored
packages/php-wasm/node/public/ linguist-generated=true
packages/php-wasm/node/src/test/test-data/ linguist-generated=true
packages/php-wasm/web/public/kitchen-sink/ linguist-generated=true -diff
packages/php-wasm/web/public/light/ linguist-generated=true -diff
packages/php-wasm/web/public/php/ linguist-generated=true -diff
packages/playground/sync/src/test/wp-* linguist-generated=true
packages/playground/remote/public/wp-* linguist-generated=true -diff
packages/playground/remote/src/wordpress linguist-generated=true -diff
Expand Down
31 changes: 10 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,16 @@
"prepublishOnly": "npm run build",
"mindmap": "cd packages/meta/src/mindmap/v2 && php -S 127.0.0.1:5269",
"preview": "nx preview playground-website",
"recompile:php:web": "nx recompile-php:light:all php-wasm-web && nx recompile-php:kitchen-sink:all php-wasm-web ",
"recompile:php:web:light": "nx recompile-php:light:all php-wasm-web ",
"recompile:php:web:light:7.0": "nx recompile-php:light php-wasm-web --PHP_VERSION=7.0",
"recompile:php:web:light:7.1": "nx recompile-php:light php-wasm-web --PHP_VERSION=7.1",
"recompile:php:web:light:7.2": "nx recompile-php:light php-wasm-web --PHP_VERSION=7.2",
"recompile:php:web:light:7.3": "nx recompile-php:light php-wasm-web --PHP_VERSION=7.3",
"recompile:php:web:light:7.4": "nx recompile-php:light php-wasm-web --PHP_VERSION=7.4",
"recompile:php:web:light:8.0": "nx recompile-php:light php-wasm-web --PHP_VERSION=8.0",
"recompile:php:web:light:8.1": "nx recompile-php:light php-wasm-web --PHP_VERSION=8.1",
"recompile:php:web:light:8.2": "nx recompile-php:light php-wasm-web --PHP_VERSION=8.2",
"recompile:php:web:light:8.3": "nx recompile-php:light php-wasm-web --PHP_VERSION=8.3",
"recompile:php:web:kitchen-sink": "nx recompile-php:kitchen-sink:all php-wasm-web",
"recompile:php:web:kitchen-sink:7.0": "nx recompile-php:kitchen-sink php-wasm-web --PHP_VERSION=7.0",
"recompile:php:web:kitchen-sink:7.1": "nx recompile-php:kitchen-sink php-wasm-web --PHP_VERSION=7.1",
"recompile:php:web:kitchen-sink:7.2": "nx recompile-php:kitchen-sink php-wasm-web --PHP_VERSION=7.2",
"recompile:php:web:kitchen-sink:7.3": "nx recompile-php:kitchen-sink php-wasm-web --PHP_VERSION=7.3",
"recompile:php:web:kitchen-sink:7.4": "nx recompile-php:kitchen-sink php-wasm-web --PHP_VERSION=7.4",
"recompile:php:web:kitchen-sink:8.0": "nx recompile-php:kitchen-sink php-wasm-web --PHP_VERSION=8.0",
"recompile:php:web:kitchen-sink:8.1": "nx recompile-php:kitchen-sink php-wasm-web --PHP_VERSION=8.1",
"recompile:php:web:kitchen-sink:8.2": "nx recompile-php:kitchen-sink php-wasm-web --PHP_VERSION=8.2",
"recompile:php:web:kitchen-sink:8.3": "nx recompile-php:kitchen-sink php-wasm-web --PHP_VERSION=8.3",
"recompile:php:web": "nx recompile-php:all php-wasm-web",
"recompile:php:web:7.0": "nx recompile-php php-wasm-web --PHP_VERSION=7.0",
"recompile:php:web:7.1": "nx recompile-php php-wasm-web --PHP_VERSION=7.1",
"recompile:php:web:7.2": "nx recompile-php php-wasm-web --PHP_VERSION=7.2",
"recompile:php:web:7.3": "nx recompile-php php-wasm-web --PHP_VERSION=7.3",
"recompile:php:web:7.4": "nx recompile-php php-wasm-web --PHP_VERSION=7.4",
"recompile:php:web:8.0": "nx recompile-php php-wasm-web --PHP_VERSION=8.0",
"recompile:php:web:8.1": "nx recompile-php php-wasm-web --PHP_VERSION=8.1",
"recompile:php:web:8.2": "nx recompile-php php-wasm-web --PHP_VERSION=8.2",
"recompile:php:web:8.3": "nx recompile-php php-wasm-web --PHP_VERSION=8.3",
"recompile:php:node": "nx recompile-php:all php-wasm-node",
"recompile:php:node:7.0": "nx recompile-php php-wasm-node --PHP_VERSION=7.0",
"recompile:php:node:7.1": "nx recompile-php php-wasm-node --PHP_VERSION=7.1",
Expand Down
1 change: 0 additions & 1 deletion packages/docs/site/docs/blueprints/01-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Blueprints are JSON files for setting up your very own WordPress Playground inst
"php": "8.0",
"wp": "latest"
},
"phpExtensionBundles": ["kitchen-sink"],
"steps": [
{
"step": "login",
Expand Down
16 changes: 0 additions & 16 deletions packages/docs/site/docs/blueprints/03-data-format.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import BlueprintExample from '@site/src/components/Blueprints/BlueprintExample.m
"php": "7.4",
"wp": "6.5"
},
"phpExtensionBundles": ["kitchen-sink"],
"features": {
"networking": true
},
Expand Down Expand Up @@ -67,21 +66,6 @@ The `preferredVersions` property declares your preferred PHP and WordPress versi
}
```

## PHP extensions

The `phpExtensionBundles` property is an array of PHP extension bundles that should be loaded. The following bundles are supported:

- `kitchen-sink`: Default choice. Installs [`gd`](https://www.php.net/manual/en/book.image.php), [`mbstring`](https://www.php.net/manual/en/mbstring.installation.php), [`iconv`](https://www.php.net/manual/en/function.iconv.php), [`openssl`](https://www.php.net/manual/en/book.openssl.php), [`libxml`](https://www.php.net/manual/en/book.libxml.php), [`xml`](https://www.php.net/manual/en/xml.installation.php), [`dom`](https://www.php.net/manual/en/intro.dom.php), [`simplexml`](https://www.php.net/manual/en/book.simplexml.php), [`xmlreader`](https://www.php.net/manual/en/book.xmlreader.php), and [`xmlwriter`](https://www.php.net/manual/en/book.xmlwriter.php)
- `light`: It saves 6MB of downloads and loads none of the extensions above.

```js
{
"phpExtensionBundles": [
"kitchen-sink"
],
}
```

## Features

You can use the `features` property to turn on or off certain features of the Playground instance. It can contain the following properties:
Expand Down
8 changes: 1 addition & 7 deletions packages/docs/site/docs/blueprints/08-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,10 @@ blueprint={{
]
}} />

## Enable PHP extensions and networking
## Enable networking

<BlueprintExample blueprint={{
"landingPage": "/wp-admin/plugin-install.php",
"phpExtensionBundles": [
"kitchen-sink"
],
"features": {
"networking": true
},
Expand All @@ -143,9 +140,6 @@ Use the `writeFile` step to add code to a mu-plugin that runs on every request.

<BlueprintExample blueprint={{
"landingPage": "/category/uncategorized/",
"phpExtensionBundles": [
"kitchen-sink"
],
"features": {
"networking": true
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ const client = await startPlaygroundWeb({
wp: '6.3',
php: '8.0',
},
// Optional: downloads additional PHP extensions like DOMDocument, mbstring, etc.
extensionBundles: ['kitchen-sink'],
steps: [
{ step: 'login' },
{
Expand Down
Loading

0 comments on commit bacc516

Please sign in to comment.