Commit 4f38ee9
authored
[Website] Add PHP next builds (#3692)
## What it does
Adds PHP `next` builds for the Playground **web** runtime without
committing the binaries to `trunk`.
- Publishes generated web binaries to a separate `php-next-builds`
branch.
- Syncs gitignored `packages/playground/website/public/php-next/` assets
for website deploys and local dev.
- Supports `php=next` in the Query API and Blueprint
`preferredVersions.php`.
- Adds a PHP 8.6 preview page with runnable examples: `php-8-6.html`.
- Adds PHP Playground support for `?php=next` directly, displayed as
`Next (development)`.
- Documents the runtime, asset flow, and API usage.
Demo: https://playground.wordpress.net/php-8-6.html
PHP Playground:
https://playground.wordpress.net/php-playground.html?php=next
## Rationale
`next` is release-cycle neutral. It can point at PHP `8.6.0-dev` today
and PHP `8.7.0-dev` later without teaching Playground about each
upcoming version in UI code.
The binaries are large and change nightly. Publishing them to
`php-next-builds` keeps daily binary churn out of `trunk` while still
making the artifacts available to `playground.wordpress.net` and local
dev servers.
This PR intentionally ships **web main modules only**. PHP extensions
are disabled for `next` until we also publish matching ABI side modules.
## Implementation
```text
php-src default development branch
-> refresh-php-next.yml
-> npm run recompile:php:web:next
-> packages/playground/website/public/php-next/ (gitignored)
-> php-next-builds branch (binary artifact branch)
-> deploy-website.yml / local dev sync
-> ?php=next / Blueprint preferredVersions.php="next"
```
Key pieces:
1. `@php-wasm/universal` defines `PHPNextVersion = "next"` and includes
it in `AllPHPVersion`.
2. `@php-wasm/web` detects `version === "next"` and dynamically imports
`/php-next/index.js`.
3. `build-php-next-web.mjs` compiles php-src's default development
branch and writes the `index.js` loader plus `jspi` / `asyncify`
artifacts.
4. `sync-php-next-assets.mjs` fetches `php-next-builds` into the
gitignored website public directory.
5. `deploy-website.yml` syncs those assets before deploying
`playground.wordpress.net`; `npm run dev` syncs them for local website
dev.
6. PHP Playground accepts `?php=next`, shows `Next (development)`, and
passes `next` to the runtime. There is no `8.6` mapping to update next
cycle.
7. Static Playground pages use a dev-server shim for
`/website-server/client/index.js`, so local `php-playground.html`
imports the local client instead of the deployed one.
CLI support is a follow-up PR. The next PR can reuse `php-next-builds`,
add Node.js `next` artifacts, and teach Playground CLI how to resolve
`--php=next`. Until then, the CLI filters `next` out of `--php` choices
and the Node runtime returns an explicit “web runtime only” error if
called directly.
## Testing instructions
Manual verification performed:
1. Built a local `next` artifact:
```bash
PHP_NEXT_MODES=jspi PHP_NEXT_APPEND=yes npm run recompile:php:web:next
```
2. Started the website dev server:
```bash
npm run dev
```
3. Opened `http://127.0.0.1:5400/website-server/?php=next&wp=latest` and
confirmed WordPress booted with PHP `8.6.0-dev`.
4. Confirmed the browser loaded the gitignored local assets:
- `/website-server/php-next/index.js`
- `/website-server/php-next/jspi/php_8_6.js`
- `/website-server/php-next/jspi/8_6_0-dev/php_8_6.wasm`
5. Opened
`http://127.0.0.1:5400/website-server/php-playground.html?php=next` and
confirmed:
- PHP select shows `Next (development)`.
- The example renders `Hello from PHP 8.6.0-dev`.
Checks run:
```bash
node --check packages/php-wasm/compile/build-php-next-web.mjs
node --check packages/php-wasm/compile/sync-php-next-assets.mjs
npx nx build playground-blueprints --output-style=stream
npx nx typecheck php-wasm-universal --output-style=stream
npx nx typecheck php-wasm-web --output-style=stream
npx nx typecheck playground-client --output-style=stream
npx nx typecheck playground-website-extras --output-style=stream
npx nx typecheck playground-website --output-style=stream
npx nx build playground-website --output-style=stream
npm run format:uncommitted
git diff --check
```1 parent 32db600 commit 4f38ee9
39 files changed
Lines changed: 1273 additions & 126 deletions
File tree
- .github/workflows
- packages
- docs/site/docs
- blueprints
- developers
- 06-apis/query-api
- 23-architecture
- main
- php-wasm
- compile
- php
- node/src/lib
- universal/src/lib
- web/src/lib
- extensions
- playground
- blueprints/public
- client/src
- cli/src
- website-extras/src/php-playground
- components
- website
- demos
- public
- src/components/site-manager/site-settings-form
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
25 | 45 | | |
26 | 46 | | |
27 | 47 | | |
| |||
0 commit comments