-
Notifications
You must be signed in to change notification settings - Fork 10
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
GEN-637 - feat: make Trustpilot data available globally #2710
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
c2481f7
to
4f41042
Compare
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.
Hmm now I'm confused 🤔
- We fetch and store Trustpilot data in edge config
- We fetch it again during build and cache it using SSG
Seems like we are just caching in two different ways, no? Could we not just fetch from Trustpilot at build-time and skip edge config?
917f0bf
to
32e2dd4
Compare
4f41042
to
727aa26
Compare
You right 👍🏻 |
32e2dd4
to
a2115a8
Compare
727aa26
to
b33c804
Compare
a2115a8
to
b2ffe32
Compare
b33c804
to
465cd12
Compare
b2ffe32
to
6588fb1
Compare
465cd12
to
412a50d
Compare
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 good, just had a comment about where to rehydrate
@@ -33,6 +34,8 @@ export const LayoutWithMenu = (props: LayoutWithMenuProps) => { | |||
const { story, globalStory, className, breadcrumbs } = props.children.props | |||
|
|||
useHydrateProductMetadata(props.children.props[GLOBAL_PRODUCT_METADATA_PROP_NAME]) | |||
useHydrateTrustpilotData(props.children.props.trustpilot) |
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.
hmm can we place this in a more relevant place? This has nothing to do with the "layout with menu" no?
Perhaps we can hydrate on "[[...slug]]" page instead? where we fetch the data anyways?
6588fb1
to
293fa1d
Compare
412a50d
to
6292006
Compare
6292006
to
b9aa0f1
Compare
293fa1d
to
a12e61b
Compare
b9aa0f1
to
91abec3
Compare
@guilhermespopolin started a stack merge that includes this pull request via Graphite. |
Graphite rebased this pull request as part of a merge. |
91abec3
to
0e6b172
Compare
@guilhermespopolin merged this pull request with Graphite. |
Describe your changes
How the whole thing works:
apps/store/src/services/trustpilot/trustpilot.tsx
- which fetch that data from Trustpilot API and store it in a Jotai's atom so it can be available through the whole app. We then fetch that data and proper hydrate the atom in theapps/store/src/pages/[[...slug]].tsx
andapps/store/src/components/LayoutWithMenu/LayoutWithMenu.tsx
files respectively.TrustpilotBlock
then reads that data from the atom and proper display it.Justify why they are needed
Requested by design/editors
Can be tested here