Add Playground markdown editor extension - #1
Merged
Merged
Conversation
adamziel
added a commit
to WordPress/wordpress-playground
that referenced
this pull request
May 14, 2026
## What it does Exports SQLite's `sqlite3_auto_extension()` and `sqlite3_cancel_auto_extension()` symbols from PHP.wasm main modules. ## Rationale External PHP.wasm side modules can register SQLite virtual table modules by calling `sqlite3_auto_extension()` during PHP startup. The markdown editor now lives in `adamziel/wp-extensions` and uses this path to register its `markdown_posts` and `markdown_postmeta` virtual tables. The current published `@wp-playground/cli@3.1.30` cannot run that extension: it does not expose the complete `--php-extension` workflow, and its PHP.wasm builds do not export these SQLite symbols. This PR is the Playground-side runtime change needed before the `wp-extensions` instructions can use a published CLI release. Related feature PR: adamziel/wp-extensions#1 ## Implementation Adds `sqlite3_auto_extension` and `sqlite3_cancel_auto_extension` to the Asyncify export lists in: - `packages/php-wasm/compile/php/Dockerfile` - `packages/php-wasm/compile/php/Dockerfile-5-2` The markdown-editor command, mu-plugin, SQLite extension source, and `php-toolkit` submodule are intentionally not in this Playground PR. ## Testing instructions ```bash git diff --check origin/trunk...HEAD ``` Full verification requires recompiling PHP.wasm and loading an external side module that calls `sqlite3_auto_extension()`. The consumer lives in adamziel/wp-extensions#1.
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
markdown-editor/, a Playground-oriented extension for editing a hostdirectory of Markdown files through the WordPress block editor.
Rationale
The markdown editor pieces need to move as one unit. Keeping the mu-plugin,
sqlite_markdownPHP.wasm side-module source, andphp-toolkitsubmodule inthis repository keeps the feature out of the Playground monorepo while still
making it easy to mount into Playground.
Implementation
The extension includes:
edit-markdown-mu-plugin.php, loaded as a mu-pluginsqlite-markdown-extension/src, compiled with@php-wasm/compile-extensionvendor/php-toolkit, pinned as a submodulemarkdown-editor/README.mdThe current published
@wp-playground/cli@3.1.30is not enough for thisworkflow. The README documents the source-checkout path that uses
WordPress/wordpress-playground#3524, and the shorter
npx @wp-playground/cli@latestcommand to use after Playground publishes thatsupport.
Testing instructions
Full runtime testing requires a Playground build with:
--php-extensionsupportsqlite3_auto_extension()andsqlite3_cancel_auto_extension()That support is tracked in
WordPress/wordpress-playground#3524.