WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
283054
Support JSPI
https://bugs.webkit.org/show_bug.cgi?id=283054
Summary
Support JSPI
Adam Zielinski
Reported
2024-11-13 07:55:37 PST
I'm a WordPress core committer sponsored by Automattic to work on WordPress Playground [1] – a version of WordPress that runs in browsers, CLI, etc. via WebAssembly. JSPI support in WebKit would be supremely helpful in making WordPress Playground stable for Safari users. Right now, Playground runs feature detection to ship a JSPI build of PHP.wasm to supporting browsers, and an Asyncify build otherwise. In Chrome and Firefox, the JSPI version of Playground just works. In Safari, the Asyncify version of Playground is unreliable [2]. By design, Asyncify crashes whenever an asynchronous call is made and any of the call stack functions wasn't explicitly in the build arguments. PHP is a complex programming language interpreter and we haven't found an easy way of detecting all the relevant code paths, and listing all the available functions adds significant overhead both in terms of speed and a bundle size. The bug reports we receive require significant effort to address. As a result, we're only fixing the most problematic Asyncify issues and waiting for JSPI support in WebKit to remove the Asyncify build entirely. Playground is becoming an important part of the WordPress ecosystem. It makes WordPress setup as easy as clicking a button, it enables using WordPress inside other applications, and it's been used by hundreds of thousands of people in the WordPress community. Personally, I hope to eventually ship an "Export Site" feature that would download a single executable, e.g. via Bun [3]. However, Bun uses the same JavaScript engine as WebKit which means today it could only run the Asyncify build. This means we can either wait for the JSPI support or explore other JavaScript engines. [1]
https://w.org/playground
[2]
https://github.com/WordPress/wordpress-playground/blob/8dfeea161742f3f94b18729fa8870e6314786f51/packages/docs/site/docs/developers/23-architecture/07-wasm-asyncify.md#asyncify-crashes
[3]
https://bun.sh/docs/bundler/executables
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2024-11-13 23:17:28 PST
<
rdar://problem/139856074
>
Brandon Payton
Comment 2
2024-12-17 16:31:10 PST
Note: There is an issue for JSPI under the WebKit/standards-positions GitHub repo:
https://github.com/WebKit/standards-positions/issues/422
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug