Skip to content

Prototype Spacefast persistence and static publishing for Playground - #4488

Draft
akirk wants to merge 13 commits into
trunkfrom
prototype/spacefast-playground
Draft

akirk wants to merge 13 commits into
trunkfrom
prototype/spacefast-playground

Conversation

@akirk

@akirk akirk commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Motivation for the change, related issues

Saving through Autosaved → Storage location → Save to Spacefast installs/configures Simply Static and publishes the static website, Blueprint, SQLite snapshot, and one shared copy of uploads. Generated pages link back through Edit with Playground using a normal blueprint-url link. New Spaces are public, including the database; write credentials stay in tab memory.

Implementation details

Reopening recreates plugin/theme files, restores SQLite and uploads, migrates URLs, and logs in. WXR and theme starter-content imports are omitted. Remote JSON Blueprint dependencies keep their original URLs; local/ZIP bundle dependencies are copied to Spacefast. Static generation uses free Simply Static without WP-CLI; database URL migration uses WP-CLI. API/uploads use the CORS proxy, and Blueprint/resource loading supports proxy fallback. The local proxy defaults to 100 MiB per request; separately hosted proxies retain the 1 MiB default unless configured.

Each save replaces one snapshot, removes deleted files, retains unreferenced uploads, and records “Saved from WordPress Playground.” The current layout assumes a single WordPress site with standard uploads; plugin/theme file edits must be reproducible from the setup Blueprint. Remote dependencies must remain available at their original URLs.

Testing Instructions (or ideally a Blueprint)

  • Run npm run dev, open http://127.0.0.1:5400/website-server/, and click Autosaved → Storage location → Save to Spacefast. Restart an older dev server to pick up the new proxy upload limit. Override it with PLAYGROUND_CORS_PROXY_MAX_REQUEST_SIZE only when needed.
  • Verify the roundtrip: save to Spacefast, open the published Spacefast site, and click Edit with Playground. Check that the current content and uploads are restored, make an edit, and save to the same Space again. Open the published site, verify the edit, click Edit with Playground, and repeat.
  • npm exec -- nx run playground-website:typecheck
  • npm exec -- nx run playground-website:lint
  • npm exec -- nx test playground-website --testFile=spacefast — 36 tests, including dependency preservation across saves, original remote resource URLs, and omission of redundant content imports.
  • npm exec -- nx test playground-website --testFile=resolve-blueprint-from-url.spec.ts — 2 tests covering startup Blueprint and bundled-resource CORS fallback.
  • npm exec -- nx test playground-storage --testFile=filesystems.spec.ts — 53 filesystem tests.
  • npm exec -- nx test playground-php-cors-proxy — requires PHPUnit; previously verified for the proxy changes.

Browser checks used real WordPress and Simply Static 3.8.18 with mocked Spacefast responses: proxy-only uploads, retry retention, deduplicated uploads, referenced/unreferenced media, repeated saves and deletion, publish messages, destination retention, and reopening through the normal Blueprint URL into wp-admin. Later CORS and dependency fixes are covered by regression tests. Live publication was user-verified; no reference handoff was redeemed by tests.

@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant