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

Move embed scripts into the body in preview documents #10434

Merged
merged 2 commits into from Oct 9, 2018

Conversation

Projects
None yet
3 participants
@notnownikki
Member

notnownikki commented Oct 9, 2018

Description

Jetpack supplies embeds that use shortcodes, and enqueue scripts needed for the embeds to work. We were including these scripts in <head> but that doesn't work for all embeds. This change moves them into the body of the preview document, which fixes issues with Instagram embeds.

How has this been tested?

Install Jetpack and make sure the shortcode module is enabled.

In a new post, embed https://www.pinterest.co.uk/pin/373869206564305678/ and https://www.instagram.com/p/BoEH8K_lCJ4/?taken-by=juicedpixels

Both should show a preview of the embed.

Types of changes

Bug fix

@notnownikki notnownikki added this to the 4.0 milestone Oct 9, 2018

@notnownikki notnownikki requested a review from WordPress/gutenberg-core Oct 9, 2018

@notnownikki notnownikki modified the milestones: 4.0, 4.1 Oct 9, 2018

@tofumatt

I hate to be that person, but is there any chance this could be something we have an E2E test for? I'm not sure how easy it'd be to test the embed appearing or the enabling of the Jetpack plugin without an account. I guess it might be a pain, but this seems a good candidate for something we could easily regress in the future.

Code makes sense to me though. If a test is too much of a pain, maybe you could add a comment about the reason the code is in the body and not the head? I could imagine someone in the future thinking they're clever and moving it back out! 😅

@notnownikki

This comment has been minimized.

Show comment
Hide comment
@notnownikki

notnownikki Oct 9, 2018

Member

@tofumatt I'll add a comment :)

And everyone has permission to buy a giant foam bat with "embed e2e" tests written on to bop me on the head with. They are coming.

Member

notnownikki commented Oct 9, 2018

@tofumatt I'll add a comment :)

And everyone has permission to buy a giant foam bat with "embed e2e" tests written on to bop me on the head with. They are coming.

@tofumatt

This comment has been minimized.

Show comment
Hide comment
@tofumatt

tofumatt Oct 9, 2018

Member

OMG now I want that bat for everyone! 😆

Member

tofumatt commented Oct 9, 2018

OMG now I want that bat for everyone! 😆

@notnownikki notnownikki merged commit 32f763c into master Oct 9, 2018

2 checks passed

codecov/project 49.5% (+0.06%) compared to cc5bf5c
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@youknowriad youknowriad deleted the fix/instagram-jetpack-embed branch Oct 9, 2018

@gziolo gziolo modified the milestones: 4.1, 4.0 Oct 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment