-
Notifications
You must be signed in to change notification settings - Fork 328
[Blueprints] Move blueprints.phar to the Blueprints package #2471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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. |
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. |
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. |
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.