Skip to content
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

Consider dropping the "light" PHP build #1848

Closed
adamziel opened this issue Oct 4, 2024 · 4 comments · Fixed by #1861
Closed

Consider dropping the "light" PHP build #1848

adamziel opened this issue Oct 4, 2024 · 4 comments · Fixed by #1861

Comments

@adamziel
Copy link
Collaborator

adamziel commented Oct 4, 2024

Playground ships three PHP builds:

  • CLI
  • Web – with extensions ("kitchen sink")
  • Web – without extensions ("light")

With the upcoming JSPI support we'll have to ship twice the .wasm binaries – one set built with JSPI for the runtimes that support it, and another set built with Asyncify for the browsers that don't. That's 48 binaries instead of the 24 we have today. That's a lot! It's a build time burden and the disk space burden.

What if we dropped the "light" build entirely? WordPress doesn't work correctly with it, which makes it useful for extreme compatibility testing but not so useful for most real world scenarios. JSPI will unlock dynamic extensions loading so eventually we'll be able to ship a barebones version of PHP and load as many extensions as needed.

Questions to answer:

  • How many people actually use the light build?
  • Is it by accident, or do they rely on it?

cc @brandonpayton @bgrgicak @eliot-akira

@adamziel adamziel added this to the PHP Feature Parity milestone Oct 4, 2024
@adamziel adamziel changed the title Consider dropping PHP "light" build Consider dropping the "light" PHP build Oct 4, 2024
@adamziel adamziel moved this from Inbox to Needs review in Playground Board Oct 4, 2024
@eliot-akira
Copy link
Collaborator

eliot-akira commented Oct 4, 2024

For my use case (in-company dev tools), mostly we've been using the server-side modules @php-wasm/node and cli.

  • PHP parser for gathering docblock comments to generate documentation
  • PHP linter and formatter (Code Sniffer with custom WordPress Code Standards)
  • A fork of wp-now with small feature to load mapping paths from .wp-env.json (compatibility with existing setup)

As for the web build of PHP-WASM, I have a side project of a custom self-hosted Playground site, but that's fallen behind recent upstream development - it's using the "kitchen sink" variant.

I'm also exploring the use of GitHub Pages to embed a Playground instance that runs a plugin at the newest commit, using github-proxy.com. So far I'm using the default settings, which is apparently the "light" variant according to the API docs for getPHPLoaderModule.

In all cases, if the default and only variant changed to "kitchen sink", it would be better and backward compatible.

@bgrgicak
Copy link
Collaborator

bgrgicak commented Oct 8, 2024

I would remove the light package. We want Playground to be compatible with a regular LAMP server and disabling features that we support doesn't make a lot of sense except if you really want to reduce the size. Even the size matters less now when we have caching because it happens only once (until an update is available).

Here are some usage stats.

The Website reports that 1.3% of Playgrounds are loaded with the light PHP build.

Image

@adamziel
Copy link
Collaborator Author

adamziel commented Oct 8, 2024

Oh nice, I'm glad we're collecting that information. I would assume a part of that 1.3% are stale Blueprints and maybe even documentation examples. I would love to hear more from the people who are intentionally using the light build, but reaching them might be quite difficult. Let's prepare a PR, then, write a make.wordpress.org/playground post and share it on the w.org slack before merging.

adamziel added a commit that referenced this issue Oct 8, 2024
…sink" one

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",

 ## 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
@adamziel
Copy link
Collaborator Author

adamziel commented Oct 8, 2024

PR ready: #1861

adamziel added a commit that referenced this issue Oct 9, 2024
…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
@github-project-automation github-project-automation bot moved this from Needs review to Done in Playground Board Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
3 participants