-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat: Filter
with next/dynamic and lazy import
#2596
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
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.
LGTM!
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.
LGTM
What's the purpose of this pull request?
This PR involves significant changes to the filter components within the
ProductGallery
and related files. The main goal is to refactor the filter functionality by removing theFilter
component and replacing it withFilterDesktop
andFilterSlider
components. Additionally, dynamic imports are introduced to optimize loading.Key changes include:
Refactoring Filter Components:
Filter
component and its associated code fromFilter.tsx
.FilterDesktop.tsx
to include the GraphQL fragment previously inFilter.tsx
.Filter
,FilterFacetBoolean
,FilterFacetBooleanItem
,FilterFacetRange
,FilterFacets
, andFilterSlider
inFilterSlider.tsx
.index.ts
to exportFilterDesktop
andFilterSlider
instead of the removedFilter
component.Dynamic Imports:
ProductCard
,EmptyGallery
,FilterDesktop
, andFilterSlider
inDefaultComponents.ts
.How to test it?
You can use the preview URL from the starter PR and double check that some JS are just loaded after Open the Filter in the mobile version.
https://sfj-d705510--starter.preview.vtex.app/office
Screen.Recording.2024-12-13.at.16.53.38.mov
Starters Deploy Preview
Filter
with next/dynamic vtex-sites/starter.store#638