- Next.js
Upgrade JSS 22.12 Next.js apps to version 23.0
This topic covers the changes you must make to your existing JSS 22.12 applications to upgrade to version 23.0. However, because of the nature of JavaScript and Next.js application development, this topic doesn't account for all the customization you might have in your existing application.
While upgrading, consider the JSS templates and add-ons you used when creating your Next.js application. You can find them in your package.json file. For example, a JSS 22.12 application included in the XM Cloud starter foundation uses the following templates and add-ons:
nextjsnextjs-styleguideornextjs-sxanextjs-multisite
Some code examples, images, and UI labels may still use XM Cloud while engineering assets are being updated.
-
If you haven't already done so, upgrade your app to JSS 22.12.
-
Familiarize yourself with the changelog. If your application is heavily customized, the changelog can provide guidance on what additional changes you need that are not covered in this topic.
Update application dependencies in your existing app
For your upgraded application to work correctly, you will need to update dependencies.
To update your dependencies:
-
In your existing application's
package.jsonupdate every@sitecore-jsspackage to version~23.0.0. -
Install the dependencies with the following command:
Update the Next.js template files in your existing app
This explains how to synchronize files in your existing application with corresponding files from your new JSS 23.0 app.
To update the Next.js template files:
-
The
Placeholdercomponent automatically passed several internal props (api,componentFactory,modifyComponentProps,sitecoreContext, andupdateSitecoreContext) to rendered components. These props are no longer forwarded. Components rendered throughPlaceholdernow only receive the following props by default:fieldsparamsrendering- Additional props returned by
modifyComponentProps
If your components depend on custom props being passed through a
Placeholder, use the newpassThroughComponentPropsproperty to explicitly pass those values. Review custom components that access any of the removed internal props and update them to obtain that functionality through supported APIs or explicit prop passing. -
The
VercelEditingDataCacheimplementation and the@vercel/kvdependency have been removed due to the deprecation of Vercel KV. Replace usage ofVercelEditingDataCachewithRedisEditingDataCache. See Use an out-of-process editing data cache with Vercel deploymentsd for more information.
Next steps
To finalize the upgrade process, make sure you resolve any errors and warnings you encounter. Enable debug logging for JSS specific issues to assist you if necessary.