Skip to content

Support high performance YouTube and Twitter embeds #191

Open
@Swizec

Description

Hi,

YouTube and Twitter embeds hurt Lighthouse scores. Both load a bunch of unused JavaScript and create heavy iframe embeds.

I've built a custom transformer for YouTube that uses the lite-youtube facade embed (as recommended by Lighthouse). It uses a web component to render a preview image that turns into a full embed with user interaction.

I've also got a custom transformer that creates static Twitter embeds without client-side JavaScript. Uses the Twitter API to recreate tweets using static HTML and CSS.

You can see both in action here: https://serverlesshandbook.dev

The offer

Would contributing these to the core gatsby-remark-embedder plugin be desirable?

I think lite-youtube should be the default way this plugin embeds youtube.

Static Twitter I'm less sure of, but would love to find a way we can make it work.

If you think this is a good idea, I can make PRs :)

Cheers,
~Swizec

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions