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

Implement background image with gatsby-plugin-image #533

Conversation

Brenosalv
Copy link
Collaborator

@Brenosalv Brenosalv commented Oct 11, 2024

#440

Changes

  • Migrate background images to use gatsby-plugin-image instead of gatsby-background-image

Tests / Screenshots

image

Docs

image

@Brenosalv Brenosalv added the tech debt This is a task that really only the engineers notice label Oct 11, 2024
@Brenosalv Brenosalv self-assigned this Oct 11, 2024
@Brenosalv Brenosalv linked an issue Oct 11, 2024 that may be closed by this pull request
1 task
@Brenosalv Brenosalv changed the title Brenosalv/tech debt/440 implement background image with gatsby background image Implement background image with gatsby-plugin-image Oct 11, 2024
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main change is here.

Copy link

github-actions bot commented Oct 11, 2024

Visit the preview URL for this PR (updated for commit 66e4dcb):

https://estuary-marketing--pr533-brenosalv-tech-debt-zo36fz6y.web.app

(expires Thu, 14 Nov 2024 19:15:48 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 76f6b095a0752e5d9c6c890267f9fdc3e392161e

@Brenosalv Brenosalv marked this pull request as ready for review October 14, 2024 18:05
className={clsx(backgroundImage, swoopingLines)}
placeholder="blurred"
quality={100}
backgroundColor="#04192b"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move the background colors into a shared file? That way we only have one spot we need to update color.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good point. I created a separate shared object for the colors.

travjenkins
travjenkins previously approved these changes Oct 14, 2024
Copy link
Member

@travjenkins travjenkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small change that I honestly think can probably wait.

@Brenosalv
Copy link
Collaborator Author

@travjenkins If it was added only for gatsby-background-image, can we remove this code from gatsby-browser.tsx?

export const onClientEntry = () => {
    // IntersectionObserver polyfill for gatsby-background-image (Safari, IE)
    if (!('IntersectionObserver' in window)) {
        import('intersection-observer');
        console.log('# IntersectionObserver is polyfilled!!');
    }
};

Comment on lines +11 to +20
<div className={fullWidth}>
<StaticImage
alt=""
src="../../images/circles-background.png"
className={clsx(backgroundImage, fullHeight)}
placeholder="blurred"
quality={100}
/>
<div className={className}>{children}</div>
</div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of the BackgroundImages/* components should probably share a single root component since they are all the same except for the src setting.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The StaticImage component does not accept to receive prop values as variables. They should be constants. So we can't create a separate component for it, but I created a separate component for the wrapper div element.

yarn.lock Outdated Show resolved Hide resolved
Copy link
Member

@travjenkins travjenkins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Brenosalv
Copy link
Collaborator Author

Brenosalv commented Oct 15, 2024

PageSpeed Insights:

Home page:

  • Mobile prod:
image
  • Mobile preview:
image
  • Desktop prod:
image
  • Desktop preview:
image

Blog post page:

  • Mobile prod:
image
  • Mobile preview:
image
  • Desktop prod:
image
  • Desktop preview:
image

Connector template page:

  • Mobile prod:
image
  • Mobile preview:
image
  • Desktop prod:
image
  • Desktop preview:
image

@travjenkins travjenkins merged commit b4c73d7 into master Oct 15, 2024
15 checks passed
@travjenkins travjenkins deleted the Brenosalv/tech-debt/440-implement-background-image-with-gatsby-background-image branch October 15, 2024 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tech debt This is a task that really only the engineers notice
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement background image with gatsby-background-image
2 participants