Skip to content

Upgrade Reprint native extension runtime#3558

Draft
adamziel wants to merge 1 commit into
trunkfrom
adamziel/upgrade-reprint-native-exts
Draft

Upgrade Reprint native extension runtime#3558
adamziel wants to merge 1 commit into
trunkfrom
adamziel/upgrade-reprint-native-exts

Conversation

@adamziel
Copy link
Copy Markdown
Contributor

Related issues

  • Related to Reprint native extension rollout; no tracked issue linked yet.

How AI was used in this PR

AI helped research the current Reprint, PHP Toolkit, WordPress Playground, and SQLite integration extension packaging, then applied and validated the code changes. I reviewed the generated changes, verified the extension artifacts and checksums, and reran the benchmark locally.

Proposed Changes

  • Upgrade bundled reprint.phar to adamziel/reprint v0.8.0.
  • Load Reprint through loadNodeRuntime() with bundled wp_native_apis and wp_mysql_parser extension manifests.
  • Bundle the extension manifest.json, SHA256SUMS, and .so files under apps/cli/lib/pull/wasm-extensions/, and copy them into dist/cli/wasm-extensions during the CLI build.
  • Add a startup assertion for pull-reprint that aborts when the native extensions or expected native parser classes are missing. This prevents silently falling back to the much slower PHP parser path.

Benchmark

The previous 336s Studio run did not load the native extensions, so it is a native-missing baseline rather than the corrected Reprint result.

Run Native extensions Total pull-reprint db-apply Notes
Previous Studio run No 336s Not isolated Native extensions were missing
Corrected Studio run Yes 252.47s 174.95s Docker fixture, fresh HOME, 52,003 posts / 154,002 postmeta rows
Isolated db-apply comparison No -> yes N/A 852.95s -> 113.34s Standalone Reprint benchmark

Corrected Studio benchmark command:

STUDIO_ENABLE_PULL_REPRINT=1 NO_UPDATE_NOTIFIER=1 HOME="$(mktemp -d)" \
  node --experimental-wasm-jspi apps/cli/dist/cli/main.mjs pull-reprint \
  --url http://127.0.0.1:8199 \
  --secret benchmark-secret \
  --name benchmark-native \
  --verbose

Benchmark log: .context/studio-pull-reprint-native-20260520161134.log

Testing Instructions

  • npx eslint --fix apps/cli/reprint-child.ts apps/cli/vite.config.base.ts
  • npm run typecheck
  • npm test -- apps/cli/commands/tests/pull-reprint.test.ts
  • npm run cli:build
  • Verified source and built extension checksums with shasum -a 256 -c.
  • Ran the full studio pull-reprint benchmark against the Docker fixture with a fresh HOME.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant