Skip to content

[website] Add php-extension query parameter - #3645

Merged
adamziel merged 1 commit into
trunkfrom
adamziel/add-php-extension-query-param
May 15, 2026
Merged

[website] Add php-extension query parameter#3645
adamziel merged 1 commit into
trunkfrom
adamziel/add-php-extension-query-param

Conversation

@adamziel

@adamziel adamziel commented May 15, 2026

Copy link
Copy Markdown
Collaborator

What changed

Adds a php-extension Query API parameter for the Playground website. It accepts absolute, root-relative, and page-relative HTTP(S) manifest URLs, can be repeated, and mirrors the CLI --php-extension manifest flow for browser runtimes.

The website parses the query values into runtime extensions requests and passes them through startPlaygroundWeb to the Blueprints V1 and V2 boot paths. The Query API docs now list the new parameter.

Usage

Because php-extension is added by this PR, the first link targets a local website server running this branch. Start it first:

npm run dev

Click here to test locally.

The link loads the SQLite Database Integration wp_mysql_parser manifest and opens /wp-admin/plugins.php. The Blueprint installs a tiny mu-plugin that shows an admin notice like:

PHP extension check: wp_mysql_parser extension is loaded; native parser classes available: yes.

After this PR ships, click here to test on playground.wordpress.net.

Examples:

https://playground.wordpress.net/?php=8.3&php-extension=https://wordpress.github.io/sqlite-database-integration/wp_mysql_parser-wasm-extension/latest/manifest.json

To load multiple extension manifests, repeat the php-extension parameter:
?php-extension=https://.../manifest.json&php-extension=https://.../another-manifest.json.

Testing

  • NX_DAEMON=false npx nx test playground-website --testFile=php-extension-query.spec.ts
  • NX_DAEMON=false npx nx test playground-client --testFile=blueprints-v1-handler.spec.ts
  • NX_DAEMON=false npx playwright test --config=packages/playground/website/playwright/playwright.config.ts --project=chromium e2e/query-api.spec.ts -g 'option \php-extension`' --workers=1 --reporter=list`

The Playwright e2e covers both a routed local intl fixture and the version-pinned SQLite Database Integration wp_mysql_parser release manifest, then executes WP_MySQL_Native_Lexer to verify the real .so loaded.

@adamziel
adamziel force-pushed the adamziel/add-php-extension-query-param branch from b77109a to d3dc2c9 Compare May 15, 2026 00:16
@adamziel adamziel changed the title [codex] Add php-extension query parameter May 15, 2026
@adamziel
adamziel force-pushed the adamziel/add-php-extension-query-param branch from d3dc2c9 to f73cd80 Compare May 15, 2026 00:58
@adamziel
adamziel force-pushed the adamziel/add-php-extension-query-param branch from f73cd80 to 4632a84 Compare May 15, 2026 14:08
@adamziel
adamziel force-pushed the adamziel/add-php-extension-query-param branch from 4632a84 to 88aaf71 Compare May 15, 2026 14:38
@adamziel
adamziel changed the base branch from trunk to adamziel/fix-web-jspi-side-module-longjmp May 15, 2026 14:38
@adamziel
adamziel force-pushed the adamziel/fix-web-jspi-side-module-longjmp branch from e6241d0 to d85c42d Compare May 15, 2026 15:23
@adamziel
adamziel force-pushed the adamziel/add-php-extension-query-param branch from 88aaf71 to 097c9a1 Compare May 15, 2026 15:24
@adamziel
adamziel force-pushed the adamziel/fix-web-jspi-side-module-longjmp branch from d85c42d to 8a10166 Compare May 15, 2026 22:06
@adamziel
adamziel force-pushed the adamziel/add-php-extension-query-param branch from 097c9a1 to 66b0f9a Compare May 15, 2026 22:06
Base automatically changed from adamziel/fix-web-jspi-side-module-longjmp to trunk May 15, 2026 22:19
@adamziel
adamziel force-pushed the adamziel/add-php-extension-query-param branch 2 times, most recently from 8656837 to 83e11fa Compare May 15, 2026 23:08
@adamziel
adamziel marked this pull request as ready for review May 15, 2026 23:34
@adamziel
adamziel requested review from a team, ashfame and Copilot May 15, 2026 23:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds support for a php-extension Query API parameter on the Playground website, allowing callers to request PHP.wasm extension manifests via URL and pass them through to both Blueprints V1 and V2 boot paths.

Changes:

  • Added query parsing + normalization for php-extension (absolute/root-relative/page-relative), with scheme validation.
  • Plumbed parsed extensions through bootSiteClientstartPlaygroundWeb → Blueprints V1/V2 handlers.
  • Added unit + e2e coverage and updated Query API documentation.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/playground/website/src/lib/state/url/php-extension-query.ts Parses and normalizes php-extension query values into runtime extension requests.
packages/playground/website/src/lib/state/url/php-extension-query.spec.ts Unit tests for URL resolution and scheme rejection behavior.
packages/playground/website/src/lib/state/redux/boot-site-client.ts Wires parsed php-extension requests into startPlaygroundWeb options.
packages/playground/website/public/test-fixtures/php-extension-intl/manifest.json Adds a public fixture manifest for an intl extension.
packages/playground/website/playwright/e2e/query-api.spec.ts Adds e2e coverage for loading extensions via php-extension.
packages/playground/client/src/index.ts Extends StartPlaygroundOptions API to accept extensions.
packages/playground/client/src/blueprints-v2-handler.ts Passes extension requests into the V2 boot path.
packages/playground/client/src/blueprints-v1-handler.ts Merges existing intl handling with new extension requests.
packages/playground/client/src/blueprints-v1-handler.spec.ts Verifies extension requests are passed through to the runtime.
packages/docs/site/docs/developers/06-apis/query-api/01-index.md Documents the new php-extension parameter.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/playground/website/playwright/e2e/query-api.spec.ts
Comment thread packages/playground/website/playwright/e2e/query-api.spec.ts
Comment thread packages/playground/website/public/test-fixtures/php-extension-intl/manifest.json Outdated
@adamziel
adamziel force-pushed the adamziel/add-php-extension-query-param branch from 83e11fa to 01397ef Compare May 15, 2026 23:43
@adamziel
adamziel merged commit 0c8116c into trunk May 15, 2026
52 checks passed
@adamziel
adamziel deleted the adamziel/add-php-extension-query-param branch May 15, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment