Skip to content

[PHP] Add Blueprint PHP extension loading step - #3568

Closed
adamziel wants to merge 3 commits into
trunkfrom
codex/php-extension-blueprint-loading
Closed

[PHP] Add Blueprint PHP extension loading step#3568
adamziel wants to merge 3 commits into
trunkfrom
codex/php-extension-blueprint-loading

Conversation

@adamziel

@adamziel adamziel commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

What it does

Adds a loadPHPExtension Blueprint step on top of the runtime extension loader from #3566. Blueprints can now load either a direct .so resource or a compile-extension manifest.json resource, plus optional sidecar files through extraFiles.

This is the middle PR in the stack: #3566 runtime loader → this Blueprint step → #3567 compiler tools.

Rationale

The runtime PR gives Playground a shared loadPHPExtension() API, but extenders also need a declarative Blueprint entry point. Keeping this in a stacked PR makes the runtime API reviewable on its own while preserving the same loading path for Blueprint users.

Implementation

The step resolves source as a normal Blueprint file resource, infers sourceFormat from .json vs .so, then calls @php-wasm/universal:

{
  "step": "loadPHPExtension",
  "source": {
    "resource": "url",
    "url": "https://example.com/extensions/example/manifest.json"
  },
  "sourceFormat": "manifest"
}

literal:directory is now recognized as a directory resource so extraFiles can carry data files or dependency assets. URL resources retain a non-enumerable sourceUrl so relative manifest artifacts can be resolved from the manifest URL.

Testing instructions

npx nx typecheck playground-blueprints
npx nx build:blueprint-schema playground-blueprints
cd packages/playground/blueprints
npx vitest run src/lib/steps/load-php-extension.spec.ts --config vite.config.ts
npx vitest run src/lib/v1/resources.spec.ts --config vite.config.ts -t "recognizes literal directory resources"
@adamziel
adamziel force-pushed the codex/php-extension-blueprint-loading branch from 38515ca to cdbef2d Compare April 29, 2026 17:59
@adamziel
adamziel force-pushed the codex/unified-php-extension-loading branch 4 times, most recently from e170be1 to fc69850 Compare April 30, 2026 19:27
Base automatically changed from codex/unified-php-extension-loading to trunk May 1, 2026 10:57
@adamziel

Copy link
Copy Markdown
Collaborator Author

Closing without merge per maintainer direction. The Blueprint PHP extension loading step is not being advanced from this PR.

@adamziel adamziel closed this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment