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

refactor(core): homepage fragment colocation #766

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

deini
Copy link
Member

@deini deini commented Apr 15, 2024

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.

Copy link

changeset-bot bot commented Apr 15, 2024

⚠️ No Changeset found

Latest commit: c9835d3

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Apr 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
catalyst-latest ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2024 5:25pm
catalyst-test-store ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 15, 2024 5:25pm
catalyst-uk 🔄 Building (Inspect) Visit Preview 💬 Add feedback Apr 15, 2024 5:25pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
catalyst-1millionproducts-store ⬜️ Ignored (Inspect) Visit Preview Apr 15, 2024 5:25pm
catalyst-au ⬜️ Ignored (Inspect) Visit Preview Apr 15, 2024 5:25pm
catalyst-storybook ⬜️ Ignored (Inspect) Visit Preview Apr 15, 2024 5:25pm

@@ -1,48 +0,0 @@
import { removeEdgesAndNodes } from '@bigcommerce/catalyst-client';
Copy link
Member Author

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';
Copy link
Member Author

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. 🧹

Copy link
Contributor

⚡️🏠 Lighthouse report

Lighthouse ran against https://catalyst-latest-f78s8wzwu-bigcommerce-platform.vercel.app

🖥️ Desktop

We ran Lighthouse against the changes on a desktop and produced this report. Here's the summary:

Category Score
🟢 Performance 100
🟢 Accessibility 100
🟠 Best practices 78
🟢 SEO 90

📱 Mobile

We ran Lighthouse against the changes on a mobile and produced this report. Here's the summary:

Category Score
🟢 Performance 99
🟢 Accessibility 100
🟠 Best practices 78
🟢 SEO 92

@deini deini marked this pull request as ready for review April 15, 2024 18:21
@deini deini requested a review from a team as a code owner April 15, 2024 18:21
interface ProductCardProps {
product: Partial<Product>;
interface Props {
product: ResultOf<typeof ProductCardFragment>;
Copy link
Contributor

Choose a reason for hiding this comment

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

👏

Comment on lines +92 to +101
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 } },
}),
]);
Copy link
Contributor

Choose a reason for hiding this comment

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

😬

@deini deini added this pull request to the merge queue Apr 16, 2024
Merged via the queue into main with commit beb5795 Apr 16, 2024
15 checks passed
@deini deini deleted the deini/homepage-fragment-colocation branch April 16, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants