-
Notifications
You must be signed in to change notification settings - Fork 88
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
refactor(core): homepage fragment colocation #766
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Ignored Deployments
|
@@ -1,48 +0,0 @@ | |||
import { removeEdgesAndNodes } from '@bigcommerce/catalyst-client'; |
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.
The homepage was the only one using this query.
@@ -1,33 +0,0 @@ | |||
import { getFeaturedProducts } from '~/client/queries/get-featured-products'; |
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.
Looks like we weren't using this one. 🧹
9003dea
to
c9835d3
Compare
⚡️🏠 Lighthouse reportLighthouse ran against https://catalyst-latest-f78s8wzwu-bigcommerce-platform.vercel.app 🖥️ DesktopWe ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:
📱 MobileWe ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:
|
interface ProductCardProps { | ||
product: Partial<Product>; | ||
interface Props { | ||
product: ResultOf<typeof ProductCardFragment>; |
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.
👏
const [product, { data }] = await Promise.all([ | ||
getProduct(productId, optionValueIds), | ||
|
||
client.fetch({ | ||
document: ProductPageQuery, | ||
variables: { entityId: productId, optionValueIds }, | ||
customerId, | ||
fetchOptions: customerId ? { cache: 'no-store' } : { next: { revalidate } }, | ||
}), | ||
]); |
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.
😬
What/Why?
In this PR, the primary objective is to optimize the homepage by consolidating multiple GraphQL queries into a single one. However, due to the reuse of shared components like product cards and pricing across various pages, it required adjustments to GraphQL requests throughout the codebase.