[Website] Add PHP next builds#3692
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds support for PHP next (dev-branch) builds in the web Playground runtime by publishing large nightly artifacts to a separate branch and wiring website/runtime/UI/docs to consume them without committing binaries to trunk.
Changes:
- Introduces
nextas a first-class PHP version across runtime APIs, blueprints schema/validator, and website UIs. - Adds tooling + CI to build and publish
php-nextweb artifacts and to sync them into the gitignored website public directory for deploys/dev. - Adds/updates static pages and docs to expose and document
?php=next, including a PHP 8.6 preview page.
Reviewed changes
Copilot reviewed 38 out of 39 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/playground/website/vite.config.ts | Avoids proxying php-next assets and adds a dev-only shim for importing the local client bundle. |
| packages/playground/website/src/components/site-manager/site-settings-form/unconnected-site-settings-form.tsx | Adds next to the PHP version dropdown and avoids resetting when next is selected. |
| packages/playground/website/public/php-playground.html | Adds next to the static PHP Playground UI, supports query params, and imports the client differently in dev. |
| packages/playground/website/public/php-code-snippet.js | Dedents embedded PHP code before execution/display. |
| packages/playground/website/public/php-8-6.html | Adds a new demo page showcasing PHP-next (8.6-dev) runnable snippets. |
| packages/playground/website/project.json | Syncs php-next assets before dev server start and exposes a dedicated sync target. |
| packages/playground/website/demos/index.html | Links to the new PHP 8.6 feature preview demo page. |
| packages/playground/website-extras/src/php-playground/url-state.ts | Adds support for php/wp query params when no hash state exists. |
| packages/playground/website-extras/src/php-playground/store.ts | Uses a curated PHP version list for the PHP Playground UI (including next). |
| packages/playground/website-extras/src/php-playground/php-versions.ts | Defines PHP Playground version ordering and label mapping for next. |
| packages/playground/website-extras/src/php-playground/components/PlaygroundManager.tsx | Passes preferredVersions.php into the Blueprint during boot. |
| packages/playground/website-extras/src/php-playground/components/Controls.tsx | Displays a friendly label for next in the PHP version select. |
| packages/playground/client/src/index.ts | Re-exports PHPNextVersion for consumers. |
| packages/playground/cli/src/run-cli.ts | Filters next out of CLI --php choices. |
| packages/playground/blueprints/public/blueprint-schema.json | Extends schema to accept php: "next" as an AllPHPVersion. |
| packages/playground/blueprints/public/blueprint-schema-validator.js | Updates generated validator to accept next in AllPHPVersion. |
| packages/php-wasm/web/src/lib/load-runtime.ts | Routes async-mode into loader selection and widens extension handling to AllPHPVersion. |
| packages/php-wasm/web/src/lib/get-php-next-module.ts | Adds dynamic import logic for /php-next/index.js artifacts. |
| packages/php-wasm/web/src/lib/get-php-loader-module.ts | Adds next handling and async-mode selection. |
| packages/php-wasm/web/src/lib/extensions/load-extensions.ts | Explicitly disallows extensions for legacy + next builds. |
| packages/php-wasm/universal/src/lib/supported-php-versions.ts | Introduces PHPNextVersion, type guard, and includes it in AllPHPVersions. |
| packages/php-wasm/universal/src/lib/index.ts | Exports PHPNextVersion and isPHPNextVersion. |
| packages/php-wasm/node/src/lib/get-php-loader-module.ts | Throws a clear error for next in the Node runtime. |
| packages/php-wasm/compile/sync-php-next-assets.mjs | Adds a script to fetch the php-next-builds artifact branch into the gitignored public directory. |
| packages/php-wasm/compile/php/php8.6.patch | Adds php-src patching needed for 8.6-dev builds. |
| packages/php-wasm/compile/php/Dockerfile | Adds support for cloning php-src by ref and patch selection fallback for unknown minors. |
| packages/php-wasm/compile/build.js | Adds PHP_REF plumbing to Docker builds for dev-branch builds. |
| packages/php-wasm/compile/build-php-next-web.mjs | Adds a builder that compiles php-src default branch into php-next web artifacts + loader index/manifest. |
| packages/docs/site/docs/main/quick-start-guide.md | Documents ?php=next usage in the quick start. |
| packages/docs/site/docs/developers/23-architecture/03-wasm-php-compiling.md | Documents the php-next-builds workflow and local sync/build commands. |
| packages/docs/site/docs/developers/06-apis/query-api/01-index.md | Documents next as a supported php Query API value (web-only). |
| packages/docs/site/docs/blueprints/03-data-format.md | Documents Blueprint preferredVersions.php = "next" (web-only). |
| package.json | Adds recompile:php:web:next and sync:php-next scripts. |
| AGENTS.md | Documents the new next build and sync scripts. |
| .prettierignore | Ignores generated php-next assets directory. |
| .github/workflows/refresh-php-next.yml | Adds scheduled workflow to build + publish php-next-builds artifacts and trigger website deploy. |
| .github/workflows/deploy-website.yml | Syncs php-next artifacts before building/deploying the website. |
| .eslintignore | Ignores generated php-next assets directory. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
Author
|
Let's try it! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What it does
Adds PHP
nextbuilds for the Playground web runtime without committing the binaries totrunk.php-next-buildsbranch.packages/playground/website/public/php-next/assets for website deploys and local dev.php=nextin the Query API and BlueprintpreferredVersions.php.php-8-6.html.?php=nextdirectly, displayed asNext (development).Demo: https://playground.wordpress.net/php-8-6.html
PHP Playground: https://playground.wordpress.net/php-playground.html?php=next
Rationale
nextis release-cycle neutral. It can point at PHP8.6.0-devtoday and PHP8.7.0-devlater without teaching Playground about each upcoming version in UI code.The binaries are large and change nightly. Publishing them to
php-next-buildskeeps daily binary churn out oftrunkwhile still making the artifacts available toplayground.wordpress.netand local dev servers.This PR intentionally ships web main modules only. PHP extensions are disabled for
nextuntil we also publish matching ABI side modules.Implementation
Key pieces:
@php-wasm/universaldefinesPHPNextVersion = "next"and includes it inAllPHPVersion.@php-wasm/webdetectsversion === "next"and dynamically imports/php-next/index.js.build-php-next-web.mjscompiles php-src's default development branch and writes theindex.jsloader plusjspi/asyncifyartifacts.sync-php-next-assets.mjsfetchesphp-next-buildsinto the gitignored website public directory.deploy-website.ymlsyncs those assets before deployingplayground.wordpress.net;npm run devsyncs them for local website dev.?php=next, showsNext (development), and passesnextto the runtime. There is no8.6mapping to update next cycle./website-server/client/index.js, so localphp-playground.htmlimports 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.jsnextartifacts, and teach Playground CLI how to resolve--php=next. Until then, the CLI filtersnextout of--phpchoices and the Node runtime returns an explicit “web runtime only” error if called directly.Testing instructions
Manual verification performed:
nextartifact:http://127.0.0.1:5400/website-server/?php=next&wp=latestand confirmed WordPress booted with PHP8.6.0-dev./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.wasmhttp://127.0.0.1:5400/website-server/php-playground.html?php=nextand confirmed:Next (development).Hello from PHP 8.6.0-dev.Checks run: