Skip to content

Fix customize bundle instructions in "Host Own Playground" docs - #2510

Merged
brandonpayton merged 10 commits into
trunkfrom
docs-fix-host-own-playground
Aug 15, 2025
Merged

brandonpayton merged 10 commits into
trunkfrom
docs-fix-host-own-playground

Conversation

@brandonpayton

@brandonpayton brandonpayton commented Aug 14, 2025 •

Copy link
Copy Markdown
Member

Motivation for the change, related issues

Our build instructions for customized WP bundles are both incorrect and incomplete. The purpose of this PR is to fix that and make the experience clearer and less error prone.

cc @n8finch @fellyph

Implementation details

This PR:

  • Corrects the doc page.
  • Adds an package script for rebuilding WP bundles: npm run rebuild:wordpress-builds.
  • Fixes a race condition that led to EADDRINUSE errors when rebuilding WP builds all at the same time.
  • Attempts to address stale WP builds seeing in website output by setting emptyOutDir: true in the Playground remote package Vite config.

Due to CI bugs experienced with this branch, this PR also fixes:

  • Playwright E2E tests to only delete the playwright-dist artifact after tests pass for each tested browser. Otherwise, test retries fail because the playwright-dist artifact is no longer found.
  • Fix Cypress E2E test failures caused by Playground switching the default URL from the home page to the site editor. The Cypress tests expect the home page, so now those tests explicitly specify the home page URL.
  • Add missing docs asset for pt-br that was causing a build error.

Testing Instructions (or ideally a Blueprint)

  • CI
  • Run npm run rebuild:wordpress-builds and confirm that it rebuilt all supported WP versions

Note: As an additional test, I modified one of the new WP zip files, ran npm run build:website, and confirmed the zip file changes were included in the corresponding zip under dist/packages/playground/wasm-wordpress-net/assets.

@brandonpayton

Copy link
Copy Markdown
Member Author

If the CI tests pass, I'll go ahead and merge, and we can clean up in a follow-up PR if desired.

@brandonpayton

Copy link
Copy Markdown
Member Author

There are some Cypress E2E failures:
https://github.com/WordPress/wordpress-playground/actions/runs/16975320106/job/48125848254?pr=2510#step:5:975

    1. should log the user in as an admin
    1. should defer loading the Playground assets until someone clicks on the "Run" button

The same tests failed twice in a row, but I'm not sure why. At least for the failing admin login test, the screenshot shows the test runner logged into the site editor which is part of the admin.

I'll try a third run and then dig further if the same failures continue.

@fellyph fellyph left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM 🚢 !

@fellyph
fellyph self-requested a review August 14, 2025 22:30
@brandonpayton

Copy link
Copy Markdown
Member Author

I created a test PR with no meaningful commits apart from trunk, and it has the same E2E test failures:
https://github.com/WordPress/wordpress-playground/actions/runs/16979047944/job/48135004196?pr=2513#step:5:1099

So the failures appear to have nothing to do with this PR.

That said, I think I see the reason for the E2E failures and just pushed 6884af8 to hopefully fix them.

@brandonpayton

Copy link
Copy Markdown
Member Author

It turned out there really was a missing asset from the docs build for pt-br. I'm not sure how previous CI builds didn't catch this. But we can fix it here.

@brandonpayton

Copy link
Copy Markdown
Member Author

This was an unexpected adventure with three different unrelated failures during CI. But those are now fixed as part of this PR. :) Let's merge!

@brandonpayton
brandonpayton merged commit f99b3b1 into trunk Aug 15, 2025
@brandonpayton
brandonpayton deleted the docs-fix-host-own-playground branch August 15, 2025 03:20
@fellyph

fellyph commented Aug 15, 2025

Copy link
Copy Markdown
Collaborator

@brandonpayton, to avoid this issue with assets, I will move the images to a global folder. It only makes sense to duplicate them when the image contains localized content.

@fellyph

fellyph commented Aug 15, 2025

Copy link
Copy Markdown
Collaborator

I have created the issue: #2516

@brandonpayton

Copy link
Copy Markdown
Member Author

@brandonpayton, to avoid this issue with assets, I will move the images to a global folder. It only makes sense to duplicate them when the image contains localized content.

Thanks, @fellyph, that sounds good.

If we are going to fix that, I think other locales may also have some English duplicates. Last night when I was trying to fix the build issue, I saw that "ja" had an English instance of that same image (or thought it did when viewing through VSCode).

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.

2 participants