Upgrade JSS apps to JSS 21.7
Sitecore JavaScript Rendering SDK version 21.7 brings changes to JSS packages, other NPM dependencies, and some environment variables.
-
If you haven't already done so, upgrade your app to JSS 21.6.
-
Familiarize yourself with the JSS 21.7 release notes to ensure you understand the implications of upgrading.
This topic describes how to:
Update dependencies in React apps
Upgrading your applications based on JSS templates requires changing some dependencies and replacing their usage.
To upgrade your applications:
-
In your
package.jsonfile, update every@sitecore-jssdependency to use the~21.7.0version and replace thedeep-equaldependency withfast-deep-equalversion^3.1.3. -
In a shell, install or update dependencies in your app by running the following command:
-
Update the
/src/Layout.jsfile as follows:-
Remove the
deepEqualimport statement. -
Import the
fastDeepEqualfunction from the newly added dependency: -
Replace the usage of the
deepEqualfunction with thefastDeepEqualfunction:
-
Upgrade JSS Next.js apps to JSS 21.7
In JSS 21.7, Sitecore improved GraphQL retries and upgraded Next.js to version 14.
To upgrade JSS Next.js apps:
Update the Node headless SSR proxy app
In JSS 21.7, the Node headless SSR proxy template adds the sc_site query parameter to Layout Service requests.
To update your Node headless SSR proxy app:
-
In the
/src/config.tsfile, add query string parameters for Layout service requests using theqsParamsconfiguration property, as follows: