Skip to content

Code block: Remove reliance on recommendedWorkerType #81

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

Merged
merged 1 commit into from
Jun 21, 2023

Conversation

adamziel
Copy link
Collaborator

Adjusts the interactive code block to use the new spawnPHPWorkerThread() signature committed in WordPress/wordpress-playground#471

The old signature was spawnPHPWorkerThread(url, workerType, options)

The new signature is spawnPHPWorkerThread(url, options) as WASM in ESM WebWorkers is now correctly supported in all major browser.

Testing Instructions

  1. Update npm packages
  2. nx build interactive-code-block
  3. Try that block via wp-now cd dist/packages/interactive-code-block; wp-now start
  4. Create a post, add a PHP code block, confirm it runs
  5. Publish the post, confirm it works on the frontend

Adjusts the interactive code block to use the new `spawnPHPWorkerThread()` signature committed in WordPress/wordpress-playground#471

The old signature was `spawnPHPWorkerThread(url, workerType, options)`

The new signature is `spawnPHPWorkerThread(url, options)` as WASM in ESM WebWorkers is now correctly supported in all major browser.
Copy link
Collaborator

@sejas sejas left a comment

Choose a reason for hiding this comment

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

I confirm it works. Tested on Brave browser and Safari.

Screenshot 2023-06-19 at 13 57 26

@sejas sejas merged commit 832a8ba into trunk Jun 21, 2023
@sejas sejas deleted the icb-ditch-recommendedWorkerType branch June 21, 2023 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants