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
276 stars 126 forks source link

@W-15725921@ Memoize server config #1800

Closed vcua-mobify closed 1 month ago

vcua-mobify commented 1 month ago

Description

Whenever getConfig is called server-side, it performs a file system lookup, which is expensive. The environment config will not change unless the PWA bundle is redeployed so the config lookup is safe to memoize so that repeated calls do not result in repeated file system lookups.

Types of Changes

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

How to Test-Drive This PR

Checklists

General

Accessibility Compliance

You must check off all items in one of the follow two lists:

or...

Localization