Releases: SalesforceCommerceCloud/pwa-kit
v3.9.1
v3.9.0 (retail-react-app@6.0.0 and commerce-sdk-react@3.2.0)
New Features
- Passwordless Login
- Social Logins
- Password Reset
- Do Not Track
- Node 22 support for v3 projects
- Stores can be selected via store locator
- Redirects with http status other than 302
- Cookies are now allowed on SLAS calls
- Sessions on other browsers are cleared on password change
@salesforce/commerce-sdk-react@3.2.0
- Allow cookies for ShopperLogin API #2190
- Fix refresh token TTL warning from firing when override is not provided #2114
- Readme updates for private clients #2212
- Update CacheUpdateMatrix for mergeBasket mutation #2138
- Clear auth state if session has been invalidated by a password change #2092
- DNT interface improvement #2203
- Support Node 22 #2218
- Add
authorizeIDP,loginIDPUser,authorizePasswordless,getPasswordLessAccessToken,getPasswordResetToken, andresetPasswordwrapper functions to support Social Login, Passwordless Login, and Password Reset #2079
@salesforce/pwa-kit-create-app@3.9.0
- Update
default.jsandssr.jstemplate to support new passwordless, social, and reset password flows. #2263 - Support Node 22 #2218
- Update
default.jstemplate to include new login configurations #2079 - Handle import error when ssr.js imports from template retail react app #2270
@salesforce/pwa-kit-dev@3.9.0
@salesforce/pwa-kit-react-sdk@3.9.0
- Fix the performance logging util to not round duration. #2199
- Add RedirectWithStatus component, allowing finer grained control of rediriects and their status code #2173
- Support Node 22 #2218
@salesforce/pwa-kit-runtime@3.9.0
- Fix stale service worker file that could cause requests to still use old Content-Security-Policy #2191
- Support Node 22 #2218
- Support Social Login, Passwordless Login, and Password Reset: update the default value for
applySLASPrivateClientToEndpointsoption #2250]
@salesforce/retail-react-app@6.0.0
- DNT Consent Banner: #2203]
- Support Node 22 #2218
- Implemented opt-in Social & Passwordless Login features and fixed the Reset Password flow which now leverages SLAS APIs #2079
- Allow store to be selectable in StoreLocator #2187
- Replace transfer basket call with merge basket on checkout #2138
Bug Fixes
- [BUG] Fixed GET /shopper-context API calls being made without the usid #2206
- Update test data references to 2024, and unify to 01/2040 #2196
- Fixed failing checkout tests #2195
- [BUG] Fixed "getCheckboxProps is not a function" when rendering checkout page in generated app. #2140
- [BUG] Fix images being fetced multiple times on Safari #2223
Accessibility Improvements
- [a11y] Fix LinkList component to follow a11y practise #2098
v2.9.0
What's Changed
- Support Node 20 #2189
- Update Auth class in retail-react-app to pass required
channel_idto SLAS #2189- For more information about the SLAS changes, please see the Salesforce developer docs and the release notes for
v2.8.4.
- For more information about the SLAS changes, please see the Salesforce developer docs and the release notes for
Full Changelog: v2.8.4...v2.9.0
v3.8.0 (retail-react-app@5.0.0 and commerce-sdk-react@3.1.0)
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
njwtnpm 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
encodeNonAsciiHttpHeadersflag 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
ToggleCardtitle 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
authorizeCustomerandgetPasswordResetTokento 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
refreshTokenRegisteredCookieTTLandrefreshTokenGuestCookieTTLto Commerce API config #2077 - Improve refresh token error logging #2028
- Remove ocapi session-bridging on phased launches #2011
- Add
defaultDntto support setting the dnt flag for SLAS. Upgradecommerce-sdk-isomorphicto v3.1.1 #1979 - Update logout helper to work for guest users #1997
- Update
useCustomMutationhook to accept request body as a parameter to the mutate function #2030 - Simplify
useCustomMutationhook implementation #2034 - Documentation for
useCustomMutationhook along with new dynamicbodyparam 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 (commerce-sdk-react@3.0.1 and retail-react-app@4.0.1)
@salesforce/commerce-sdk-react@3.0.1
- Fixed an issue with the
expiresattribute in cookies, ensuring it uses seconds instead of days #1994
@salesforce/retail-react-app@4.0.1
- Update dependency
@salesforce/commerce-sdk-react@3.0.1
v3.7.0 (retail-react-app@4.0.0 and commerce-sdk-react@3.0.0)
@salesforce/commerce-sdk-react@3.0.0
- Add
meta.displayNameto 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.0of thecommerce-sdk-react.
@salesforce/pwa-kit-create-app@3.7.0
- Update default Node.js version to v20. #1867
@salesforce/pwa-kit-react-sdk@3.7.0
- Add
beforeHydrateoption to withReactQuery component #1912 - Add server side rendering performance metrics via query parameter
__server_timingor environment variableSERVER_TIMING, the metrics is available in the console logs and response headerserver-timing. #1895
@salesforce/retail-react-app@4.0.0
New Features
Bug Fixes
- Update serialized query data via
beforeHydrateto 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 CookieStorageImportant 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 (commerce-sdk-react@2.0.2 and retail-react-app@3.0.2)
@salesforce/commerce-sdk-react@2.0.2
- Fix StorefrontPreview component add siteId query parameter to shopper context calls #1891
@salesforce/retail-react-app@3.0.2
- Update dependency
@salesforce/commerce-sdk-react@2.0.2
v3.6.0 (commerce-sdk-react@2.0.1 and retail-react-app@3.0.1)
@salesforce/commerce-sdk-react@2.0.1
- Fix private slas proxy config for commerce api in provider #1883
- Fix
useCustomQueryerror handling #1883 - Fix
updateCustomersquashing existing data #1883 - Fix
transferBasketupdating the wrong customer basket #1887
@salesforce/retail-react-app@3.0.1
- Fix basket transfer during checkout login #1887
v3.6.0 (retail-react-app@3.0.0 and commerce-sdk-react@2.0.0)
@salesforce/pwa-kit-runtime@3.6.0
- Add logger to print logs generated by PWA Kit packages #1822
- Memoize
getConfigon the server-side #1800 - Added the
x-correlation-idresponse 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/pwa-kit-create-app@3.6.0
- Fix: 'Cannot use import statement outside a module' error in generated extensible project unit tests #1821
@salesforce/retail-react-app@3.0.0
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-revalidatecache 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/commerce-sdk-react@2.0.0
- Add
useCustomQueryanduseCustomMutationfor 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
updateItemsInBasketmutation #1852 - Upgrade to commerce-sdk-isomorphic v2.1.0 #1852
Full Changelog: v3.5.1...v3.6.0