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

fix(gatsby-plugin-image): fix image flickers #35226

Merged
merged 20 commits into from
May 5, 2022
Merged

Conversation

wardpeet
Copy link
Contributor

@wardpeet wardpeet commented Mar 25, 2022

Description

Fixes gatsby-plugin-image flickering between page navigations and/or state updates.

  • add prod

Related Issues

Fixes #34190
Fixes #34009

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 25, 2022
@wardpeet wardpeet added topic: media Related to gatsby-plugin-image, or general image/media processing topics and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 25, 2022
@wardpeet wardpeet marked this pull request as draft March 25, 2022 23:24
@wardpeet wardpeet force-pushed the feat/image-plugin branch 4 times, most recently from 78a01e5 to 8ad1e67 Compare March 30, 2022 21:31
@wardpeet wardpeet force-pushed the feat/image-plugin branch from 9c147f7 to 21b6595 Compare April 7, 2022 19:52
@wardpeet wardpeet marked this pull request as ready for review April 7, 2022 22:02
@tyhopp
Copy link
Contributor

tyhopp commented Apr 8, 2022

@wardpeet I'm having a hard time separating out the parts that are fix-related from the parts that are refactored, can you add some comments (the GitHub kind, not inline 😄) that point that out? Looks great at first glance

@wardpeet
Copy link
Contributor Author

wardpeet commented Apr 8, 2022

That's the tricky bit. With the current component, we were constantly unmounting and remounting. It led to the flicker when you were doing page navigations.

The old technique is a way to do partial hydration, so we could stop hydrating gatsby-plugin-image, rely on a snippet in HTML, and only hydrate on state changes or navigations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: media Related to gatsby-plugin-image, or general image/media processing topics
Projects
None yet
3 participants