-
Notifications
You must be signed in to change notification settings - Fork 800
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
Try using the @wordpress/embed-block library #14648
Conversation
Caution: This PR has changes that must be merged to WordPress.com |
Thank you for the great PR description! When this PR is ready for review, please apply the Scheduled Jetpack release: March 3, 2020. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looks like this approach removes some of the functionality that the Core embed components don't provide.
For example, the pin.it
short urls don't work for me when testing this (I assume because the url is no longer run through the resolve-redirect
endpoint to get the destination url for the embed).
Given how the embed blocks in Jetpack have evolved so far (Pinterest, Eventbrite, OpenTable, Calendly), in many cases with similar but slightly different functionality specific to each embed, I think we're going to need more flexibility than the getEmbedBlockSettings
function provides in order to support existing functionality.
I'm not all that familiar with the Core embed blocks, but one example might be exporting the EmbedPreview component, since we've copied the same overlay technique into Jetpack's blocks.
Thanks for the testing, and feedback! @zinigor: You're absolutely right, there's still work to be done on transforming old blocks into the new blocks, as well as general usability. Given that the Gutenberg PR is still highly experimental, I didn't want to get too much into building something, when it could all change. @creativecoder: The Gutenberg PR is very much a first step, it clearly needs the ability to hook into various parts of the block. The solution for each block may end up being different that a straight port, though. For example, |
Thanks for clarifying! That's a good reminder to consider if there are PHP elements of Core embeds that are useful for the future embed blocks in Jetpack. |
Given that block variations are currently being explored in Core for providing embed blocks (see the discussion on WordPress/gutenberg#19113), I'm going to close this PR, I'll likely open a new one when there's something in Core to experiment with. |
WordPress/gutenberg#19113 is an experiment in extracting the embed block boilerplate code into a new
@wordpress/embed-block
library.This PR is an experiment in making use of that library.
Changes proposed in this Pull Request:
Replace embed block boilerplate code with
@wordpress/embed-block
.Is this a new feature or does it add/remove features to an existing part of Jetpack?
This improves and standardises existing embed blocks.
Testing instructions:
Download and build WordPress/gutenberg#19113.
Create a
docker-compose.jetpack.yml
file in the directory above your Jetpack directory:Start the Jetpack Docker environment with this command:
yarn docker:compose -f ../docker-compose.jetpack.yml up -d
Proposed changelog entry for your changes: