Skip to content

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Aug 7, 2025

Motivation for the change, related issues

Moves the blueprints.phar file from the Playground CLI package into the @wp-playground/blueprints package to enable in-browser usage.

Implementation details

Exposes the blueprints.phar binary using a dynamic import that fetches a .js file with an inlined version of the base64 binary.

In addition, this PR adds a vite-global-extensions.ts file with plugins applied in all vite config files across the entire Playground repository.

Base64 encoding adds decoding time and increases the file size by ~30%. This isnot ideal, but there's no other standard solution for shipping static files with isomorphic npm CJS+ESM packages so this will have to do until a better solution emerges.

Some other packages in this repository are published with lines such as await import('php.wasm') and rely on bundler configuration for correct handling. This is fine as they're fairly low-level, isomorphic, multi-purpose packages. @wp-playground/blueprints, however, is a higher-level package that's already consumed by projects without special configuration for importing non-JS files. We don't want to break them.

Testing Instructions (or ideally a Blueprint)

Confirm the CI checks are green. This PR only moves code around and does not change any features.

@adamziel
Copy link
Collaborator Author

adamziel commented Aug 8, 2025

These webkit failures feel so random. Firefox and Chrome have very few flaky tests, but whenever I skip two more tests in Safari, another set of two random failures emerges. It feels like something is off with Webkit in CI in general. I don't think having a webkit runner ever detected a major Safari-only issue – let me try disabling the webkit runner entirely.

@adamziel
Copy link
Collaborator Author

adamziel commented Aug 8, 2025

I just can’t get the offline mode to work here. It would be easier if we had an exact error message.

Edit: it finally worked! Although the e2e offline mode test required an additional page reload, which means Playground is only offline-ready on the second page load, not on the first one. TBD whether that's new in this PR or already the case.

@adamziel adamziel changed the title [Blueprints] Move V2 runner to the Blueprints package [Blueprints] Move blueprints.phar to the Blueprints package Aug 10, 2025
@adamziel
Copy link
Collaborator Author

adamziel commented Sep 2, 2025

I just confirmed the E2E test I'm updating in this PR does not actually work in trunk. Is it green in CI because of nx cache? Not sure. We should poke around to make sure we don't have other such false-positives. In any case, for the purposes of this PR – the offline mode situation is not made any better or worse than it was before merging.

@adamziel adamziel marked this pull request as ready for review September 2, 2025 15:22
@adamziel adamziel merged commit 47d921f into trunk Sep 2, 2025
26 checks passed
@adamziel adamziel deleted the move-v2-runner-to-blueprints-package branch September 2, 2025 15:25
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