| @bigcommerce/catalyst-core | minor |
|---|
This refactor optimizes home page, header, and footer for caching and the eventual use of dynamicIO. With these changes we leverage data caching to hit mostly cache data for guest shoppers in different locales and with different currencies.
- Header and Footer now have a blocking request for the shared data that is the same for all users.
- Data that can change for logged in users is now a separate request.
- Our query functions now take in all params required for fetching, instead of accessing dynamic variables internally. This is important to serialize arguments if we want to eventually
use cache. - Dynamic fetches (using customerAccessToken or preferred currency) are now all streaming queries.
- Use
Streamable.fromto generate our streaming props that are passed to our UI components. - Update Header UI component to allow streaming in of currencies data.
- Renamed
/app/[locale]/(default)/query.tsto/app/[locale]/(default)/page-data.ts, include page query on this page. - Updated
/app/[locale]/(default)/page.tsto useStreamable.frompattern. - Split data that can vary by user from
core/components/footer/fragment.tsandcore/components/header/fragment.ts - Updated
core/components/header/index.tsxandcore/components/footer/index.tsxto fetch shared data in a blocking request and pass data that varies by customer as streamable data. Updated to use the newStreamable.frompattern.