Skip to content
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

Playground block: Support remote files #282

Merged
merged 6 commits into from
May 22, 2024
Merged

Playground block: Support remote files #282

merged 6 commits into from
May 22, 2024

Conversation

 adamziel
Copy link
Collaborator

 @adamziel adamziel commented May 22, 2024

What?

Enables providing remote URLs as filenames in the Playground Block's code editor:

 CleanShot 2024-05-22 at 18 19  40@2x

With this change, you can write an interactive WordPress tutorial using source code hosted on GitHub. It's easier to manage, preview, clone, and fork. While the remote URL is a source of truth for the block, it still stores a copy of the code in block attributes.

Testing Instructions

  1. Insert the Playground block.
  2. Create a new file, paste this URL as its name: https://raw.githubusercontent.com/WordPress/block-development-examples/trunk/plugins/data-basics-59c8f8/_playground/blueprint.json
  3. Confirm a new file was created with the "link" icon at the top.
  4. Try changing its content, saving the post, and refreshing the page. It should have no effect.
  5. Confirm regular files still work as they used to.

cc @juanmaguitar @ryanwelcher

 @adamziel adamziel added Enhancement New feature or request Playground block labels May 22, 2024
Base automatically changed from jsx-support to trunk May 22, 2024 23:44
 @adamziel adamziel merged commit ad82663 into trunk May 22, 2024
1 check passed
 @adamziel adamziel deleted the github-files branch May 22, 2024 23:48
Sign up for free to join this conversation on GitHub . Already have an account? Sign in to comment
Labels
Enhancement New feature or request Playground block
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant