Releases: SalesforceCommerceCloud/pwa-kit
v3.8.0 ([email protected] and [email protected])
retail-react-app
v5.0.0 (Oct 28, 2024)
New Features
- Implement ability to set Shopper Context via search parameters in the Retail React App #1986
- Display a promo banner from Page Designer in the PLP page of the Retail React App #2016
Performance Improvements
- PLP: When products are being refetched, only the pricing and promotions sections will display a skeleton in the ProductTile #2064
- Remove ocapi session-bridging on phased launches #2011
Other Changes
- [Hybrid Stability] - Attach dwsid to SCAPI request headers & remove OCAPI proxy #2090
- Announce wishlist change in total for screen readers (a11y) #2033
- Fixed a bug that incorrectly imports uninstalled package
@chakra-ui/layout
#2047 - Replace getAppOrigin with useOrigin to have a better support for an app origin building. #2050
- PWA Kit projects have Active Data tracking set to "true" by default #1983.
Bug Fixes
- The unused
njwt
npm package had a security vulnerability, since it was unused, the package has been dropped - Remove save/edit billing action in checkout page for the registered user #1976
- Product scroller: don't skip tiles if window is too large #2003
- PDP / PLP: Render non HTTP 404 erros #2003
- Error page: Render home page when clicking nav icon #2003
- Encode non ASCII HTTP headers when
encodeNonAsciiHttpHeaders
flag is set to true inssr.js
#2009 - Updated @salesforce/commerce-sdk-react to 3.0.1 to fix an issue with the expires attribute of cookies, ensuring it uses seconds instead of days #1994
Accessibility Improvements
- [a11y] Hide svg from screenreader as they are decorative on homepage #1980
- [a11y] Hide log out svg from screenreader as they are decorative #2000
- [a11y] Ensure heading level matches the heading's visual importance/level #2000
- [a11y] Provide a descriptive dialog title for Mobile Navigation Header #2000
- Hide breadcrumb chevrons from screen readers #1965
- Add descriptive text for screen readers on product edit modal in cart page #1965
- A11y: Fix search bar header element focus order #1969
- A11y: Order Details - hide decorative image and convert some p tags as proper headings #2026
- Add aria-labels for buttons in product item wishlist component to ensure they are unique and descriptive. #2023
- Focus onto the
ToggleCard
title whenever the component is opened to be editted #2029 - Add descriptive acccessibility label for edit/remove buttons on account addresses and checkout pages #2037
- [a11y] Mobile view account menu a11y adjustments #2059
- [a11y] PLP - Use header tags for filter options #2065
commerce-sdk-react
v3.1.0 (Oct 28, 2024)
- [Hybrid Stability] Attach dwsid to SCAPI request headers #2090
- Add the
authorizeCustomer
andgetPasswordResetToken
to theShopperLoginMutations
#2056 - Add useDNT hook to commerce-sdk-react and put DNT in auth #2067
- Add Trusted Agent on Behalf of (TAOB) support for SLAS APIs #2077
- Add optional
refreshTokenRegisteredCookieTTL
andrefreshTokenGuestCookieTTL
to Commerce API config #2077 - Improve refresh token error logging #2028
- Remove ocapi session-bridging on phased launches #2011
- Add
defaultDnt
to support setting the dnt flag for SLAS. Upgradecommerce-sdk-isomorphic
to v3.1.1 #1979 - Update logout helper to work for guest users #1997
- Update
useCustomMutation
hook to accept request body as a parameter to the mutate function #2030 - Simplify
useCustomMutation
hook implementation #2034 - Documentation for
useCustomMutation
hook along with new dynamicbody
param option #2042
pwa-kit-create-app
v3.8.0 (Oct 28, 2024)
- Removed OCAPISessionURL prop from provider template. #2090
- Update ssr.js templates to include new feature flag to encode non ASCII HTTP headers #2048
- Replace getAppOrigin with useOrigin to have a better support for an app origin building. #2050
pwa-kit-dev
v3.8.0 (Oct 28, 2024)
(No changes)
pwa-kit-react-sdk
v3.8.0 (Oct 28, 2024)
- [Hybrid Stability] - Attach dwsid to SCAPI request headers #2090
- Create useOrigin hook to return an app origin that takes x-forwarded-host header into consideration. #2050
pwa-kit-runtime
v3.8.0 (Oct 28, 2024)
v3.7.0 ([email protected] and [email protected])
@salesforce/[email protected]
- Fixed an issue with the
expires
attribute in cookies, ensuring it uses seconds instead of days #1994
@salesforce/[email protected]
- Update dependency
@salesforce/[email protected]
v3.7.0 ([email protected] and [email protected])
@salesforce/[email protected]
- Add
meta.displayName
to queries. It can be used to identify queries in performance metrics or logs. #1895 - Upgrade to commerce-sdk-isomorphic v3.0.0 #1914
⚠️ Planned API Changes ⚠️
Shopper Context
Starting July 31st 2024, all endpoints in the Shopper context API will require the siteId
parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025. You can read more about the planned change here in the notes section.
Shopper Login (SLAS)
SLAS will soon require new tenants to pass channel_id
as an argument for retrieving guest access tokens. You can read more about the planned change here.
Please be aware that existing tenants are on a temporary allow list and will see no immediate disruption to service. We do ask that all users seek to adhere to the channel_id
requirement before the end of August to enhance your security posture before the holiday peak season.
In practice, we recommend:
- For customers using the SLAS helpers with a private client, it is recommended to upgrade to
v3.0.0
of thecommerce-sdk-react
.
@salesforce/[email protected]
- Update default Node.js version to v20. #1867
@salesforce/[email protected]
- Add
beforeHydrate
option to withReactQuery component #1912 - Add server side rendering performance metrics via query parameter
__server_timing
or environment variableSERVER_TIMING
, the metrics is available in the console logs and response headerserver-timing
. #1895
@salesforce/[email protected]
New Features
Bug Fixes
- Update serialized query data via
beforeHydrate
to prevent data re-fetching on load #1912 - Out of stock and low stock items are removed from cart and checkout as unavailable products #1881
- Fix infinity sign price on product tile #1903
- Remove unecessary params from product search #1873
Accessibility Improvements
- Improve accessibility readout for strikethrough price on shipping options in checkout page #1892
- Ensure credit card informational tooltip on checkout page persists after the user is no longer hovering over it #1890
- A11y: Add aria-label to the address form based on the address type #1904
- A11y: Account Nav fixes #1884
- A11y: Replace
<p>
tags with header tag in home page Features section #1902 - Add aria-label for Checkout's action buttons #1906
- Avoid forced focus changes that are not user-initiated #1940
v2.8.4
What's Changed
- Google Search Console fix createCodeVerifier #1765
- Fix StorefrontPreview component add siteId query parameter to shopper context calls #1876
Full Changelog: v2.8.3...v2.8.4
⚠️ Planned API Changes ⚠️
Shopper Context
Starting July 31st 2024, all endpoints in the Shopper context API will require the siteId
parameter for new customers. This field is marked as optional for backward compatibility and will be changed to mandatory tentatively by January 2025. You can read more about the planned change here in the notes section.
Shopper Login (SLAS)
SLAS will soon require new tenants to pass channel_id
as an argument for retrieving guest access tokens. You can read more about the planned change here.
Please be aware that existing tenants are on a temporary allow list and will see no immediate disruption to service. We do ask that all users seek to adhere to the channel_id
requirement before the end of August to enhance your security posture before the holiday peak season.
Summary of Changes for PWA Kit v2
To comply with the planned API changes effective July 31st, 2024, you need to update your PWA Kit v2 projects. These changes involve adding the channel_id
parameter for Shopper Login and optionally scoping your local storage keys and cookie names with the siteId
prefix if your site uses multisite.
1. Update auth.js
to Include channel_id
in Calls to Shopper Login
Add the channel_id
parameter in the appropriate functions for obtaining tokens.
Example Changes:
// In the Auth class, add channel_id to the data in _loginAsGuest method
channel_id: this._config.parameters.siteId
// In the refreshToken method, add channel_id to the data
data.append('channel_id', this._config.parameters.siteId)
2. Scope Local Storage Keys and Cookie Names per Site for Multisite Projects
For customers using multiple site IDs, it is recommended to scope your local storage keys and cookie names per site to avoid conflicts. This ensures that tokens from different sites (e.g., RefArch and RefArchGlobal) are not incorrectly used across sites.
Example Changes:
// Add siteId parameter in LocalStorage and CookieStorage constructors
constructor(siteId, ...args) {
super(args)
if (typeof window === 'undefined') {
throw new Error('LocalStorage is not available in the current environment.')
}
this.siteId = siteId
}
// Create storage key with siteId prefix
createStorageKey(key) {
return `${this.siteId}_${key}`
}
// Set item in local storage with siteId prefix
set(key, value) {
window.localStorage.setItem(this.createStorageKey(key), value)
}
// Get item from local storage with siteId prefix
get(key) {
return window.localStorage.getItem(this.createStorageKey(key))
}
// Delete item from local storage with siteId prefix
delete(key) {
window.localStorage.removeItem(this.createStorageKey(key))
}
// Similar changes for CookieStorage
Important Note:
Implementing the siteId
prefix for local storage keys and cookie names will effectively log out any existing customer sessions on the site. This includes registered logins and baskets for all users.
Recommendation:
- Established sites that do not need this change should avoid implementing it to prevent logging out existing users.
- If a project decides to implement this change, be aware that the PWA will now look for tokens under a different cookie name, causing all existing users to be logged out.
Full example of the changes in the auth.js
file: 949b8b3...534dab2
v3.6.0 ([email protected] and [email protected])
@salesforce/[email protected]
- Fix StorefrontPreview component add siteId query parameter to shopper context calls #1891
@salesforce/[email protected]
- Update dependency
@salesforce/[email protected]
v3.6.0 ([email protected] and [email protected])
@salesforce/[email protected]
- Fix private slas proxy config for commerce api in provider #1883
- Fix
useCustomQuery
error handling #1883 - Fix
updateCustomer
squashing existing data #1883 - Fix
transferBasket
updating the wrong customer basket #1887
@salesforce/[email protected]
- Fix basket transfer during checkout login #1887
v3.6.0 ([email protected] and [email protected])
@salesforce/[email protected]
- Add logger to print logs generated by PWA Kit packages #1822
- Memoize
getConfig
on the server-side #1800 - Added the
x-correlation-id
response header, which is set to the MRT correlation ID. This enhances traceability by including the correlation ID from the request in the response. #1787 - Keep API Gateway headers in proxied requests #1772
- Hide x-sfdc-access-control header #1805
@salesforce/[email protected]
- Fix: 'Cannot use import statement outside a module' error in generated extensible project unit tests #1821
@salesforce/[email protected]
Improvements
- Product Tile Revamp
- Display different pricing for various products on Product tiles and PDP #1760
- Display pricing for cart, checkout and wishlist page #1796
- Shows promotional callout message on Product List and Product Detail pages #1786 #1804
- Display selectable swatch groups for attributes like color #1773
- Show badges #1791
- Lazy basket creation #1677
- Use
stale-while-revalidate
cache control directive #1744
Accessibility Improvements
- Added live region support to components #1825
- Replace p tag with heading tags in cart page #1818
- Fix product tile img alt text #1769
- Add aria-hidden to search icon #1809
- Add explicit headers to cart modal #1811
- Add autocomplete to text input fields #1840
- Add error icon to error messages #1839
Performance Improvements
Bug Fixes
- Fix seo component not settings keywords meta tag #1762
- Fix RecommendedProducts' toggling of the favourite icon #1861
@salesforce/[email protected]
- Add
useCustomQuery
anduseCustomMutation
for SCAPI custom endpoint support #1793 - Add Shopper Stores hooks #1788
- Add a helper method to add an item to either new or existing basket #1677
- Add
updateItemsInBasket
mutation #1852 - Upgrade to commerce-sdk-isomorphic v2.1.0 #1852
Full Changelog: v3.5.1...v3.6.0
v2.8.3
What's Changed
- Fix env conflicts by @wjhsf in #1531
- V2/update babel traverse by @alexvuong in #1562
- [v2] Your Experience With PWA Kit - Fall 2023 by @wjhsf in #1542
- @W-14544940@ Release v2.8.2 by @joeluong-sfcc in #1590
- Add deprecation notice to v2 pwa-kit-create-app by @wjhsf in #1575
- Security patch for v2 by @kevinxh in #1737
- [Storefront Preview] SCAPI cache breaker for older v2 PWA Kit (@W-15214446@) by @vmarta in #1740
- Release PWA Kit 2.8.3 by @vmarta in #1741
Full Changelog: v2.8.1...v2.8.3
v3.5.1 ([email protected] and [email protected])
@salesforce/[email protected]
- Update SLAS private proxy path #1752
@salesforce/[email protected]
- Update SLAS private proxy path #1752
@salesforce/[email protected]
- Update dependency
@salesforce/commerce-sdk-react
@1.4.2
v3.5.0 ([email protected] and [email protected])
@salesforce/[email protected]
- Add Support for SLAS private flow #1722
- Fix invalid query params warnings and allow custom query #1655
- Fix cannot read properties of undefined (reading 'unshift') #1689
- Add Shopper SEO hook #1688
- Update useLocalStorage implementation to be more responsive #1703
- Storefront Preview: avoid stale cached Commerce API responses, whenever the Shopper Context is set #1701
@salesforce/[email protected]
- Add Support for SLAS private flow #1722
@salesforce/[email protected]
- Add Support for SLAS private flow #1722
@salesforce/[email protected]
New Feature
- Add Support for SLAS private flow #1722
Bug Fixes
- Fix promo codes not being properly applied in cart #1692
- Fix checkout shipping method fetching #1693
- Fix invalid query params warnings #1655
- Fix internal server error on account pages #1675
- Fix
product-item
component imports to ensure that it is overridable. #1672 - Fix locale selector navigating back to default locale #1670
- Fix handling of offline products on Cart, Checkout, Order History, and Wishlist pages #1691
- Fix tracking of
viewSearch
event for Einstein analytics, in the case of no-search-results #1702 - Remove invalid header
_sfdc_customer_id
due to recent MRT HTTP3 upgrade #1731