SalesforceCommerceCloud / pwa-kit

React-based JavaScript frontend framework to create a progressive web app (PWA) storefront for Salesforce B2C Commerce.
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pwa-kit-overview.html
BSD 3-Clause "New" or "Revised" License
285 stars 138 forks source link

[BUG] PWA fetches SCAPI data during hydration #1901

Closed bendvc closed 3 months ago

bendvc commented 4 months ago

Summary

When requesting a page from the server, I do not expect that the data serialized in the response to be fetched again on the client. This causes loading skeletons on the PLP to be shown and is a large contributor to lower lighthouse scores.

Steps To Reproduce

  1. Visit https://pwa-kit.mobify-storefront.com/global/en-GB/category/womens
  2. Open chrome inspector and set network speed to "fast 3g" (this step may or may not be required, but the result is produced more reliably when you do this)
  3. Refresh the page

Expected result

Notice that the content is returned, images are loaded, loading skeletons are NOT shown and no product search data is fetched client side.

Actual result

Notice that the content is returned, images are loaded, then loading skeletons are shown while new data is fetched.

System Information (as applicable)

Browser: Node version: pwa-kit version: Desktop OS: Mobile Device Info:

Additional information

Feel free to attach a screenshot.

git2gus[bot] commented 4 months ago

This issue has been linked to a new work item: W-16241415

bendvc commented 3 months ago

Fixed in #1912