-
Notifications
You must be signed in to change notification settings - Fork 55
Add memoization and performance optimizations for PLPs and PDPs #33
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
45819fa
Add memoization and performance optimizations for PLPs and PDPs
Cichorek a27927b
Address PR review feedback: type safety, blur placeholder, defensive …
Cichorek 4436900
Address PR review round 2: void return types and defensive equality
Cichorek cc241a5
Extract shared ProductGridSkeleton component to remove duplication
Cichorek 06e9187
Remove unused products loading.tsx
Cichorek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -40,3 +40,6 @@ yarn-error.log* | |
| # typescript | ||
| *.tsbuildinfo | ||
| next-env.d.ts | ||
|
|
||
| # claude code | ||
| .claude/ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
src/app/[country]/[locale]/(storefront)/t/[...permalink]/loading.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| import { ProductGridSkeleton } from "@/components/products/ProductGridSkeleton"; | ||
|
|
||
| export default function CategoryLoading() { | ||
| return ( | ||
| <div> | ||
| {/* Banner skeleton */} | ||
| <div className="w-full h-48 md:h-64 lg:h-80 bg-gray-200 animate-pulse" /> | ||
|
|
||
| <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8"> | ||
| {/* Breadcrumb skeleton */} | ||
| <div className="flex items-center gap-2 mb-8"> | ||
| <div className="h-4 bg-gray-200 rounded w-12 animate-pulse" /> | ||
| <div className="h-4 bg-gray-200 rounded w-4 animate-pulse" /> | ||
| <div className="h-4 bg-gray-200 rounded w-24 animate-pulse" /> | ||
| </div> | ||
|
|
||
| {/* Filter button skeleton (mobile) */} | ||
| <div className="lg:hidden mb-4"> | ||
| <div className="h-10 bg-gray-200 rounded-md animate-pulse" /> | ||
| </div> | ||
|
|
||
| <div className="lg:grid lg:grid-cols-4 lg:gap-8"> | ||
| {/* Sidebar skeleton (desktop) */} | ||
| <div className="hidden lg:block space-y-4"> | ||
| <div className="h-6 bg-gray-200 rounded w-1/2 animate-pulse" /> | ||
| <div className="h-10 bg-gray-200 rounded animate-pulse" /> | ||
| <div className="h-6 bg-gray-200 rounded w-1/2 animate-pulse" /> | ||
| <div className="h-10 bg-gray-200 rounded animate-pulse" /> | ||
| </div> | ||
|
|
||
| {/* Product grid skeleton */} | ||
| <div className="lg:col-span-3"> | ||
| <ProductGridSkeleton /> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| export function ProductGridSkeleton() { | ||
| return ( | ||
| <div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6"> | ||
| {[...Array(6)].map((_, i) => ( | ||
| <div | ||
| key={i} | ||
| className="bg-white rounded-xl overflow-hidden shadow-sm animate-pulse" | ||
| > | ||
| <div className="aspect-square bg-gray-200" /> | ||
| <div className="p-4"> | ||
| <div className="h-4 bg-gray-200 rounded w-3/4 mb-2" /> | ||
| <div className="mt-2 h-5 bg-gray-200 rounded w-1/4" /> | ||
| </div> | ||
| </div> | ||
| ))} | ||
| </div> | ||
| ); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.