0.24.0, please review the 0.24.0 upgrade
guide first.
v0.25.0 of the runtime introduces new mechanisms for viewing different
versions of your site, including support for shareable links and previewing
scheduled/past publishes. It also includes several internal improvements and bug
fixes.
Refer to the official release
notes
for the full list of changes.
Breaking Changes
Minimum Node.js v20 required
Now that Node.js 18 has reached its end of life, version0.25.0 of the runtime requires a minimum of Node.js v20.
MakeswiftSiteVersion replaced with SiteVersion
We’ve replaced the MakeswiftSiteVersion type with SiteVersion, which is now
the return type of the getSiteVersion function. Any client method that accepts
a siteVersion option (including getPageSnapshot, getComponentSnapshot, and
getPages) should only be using the value returned by getSiteVersion. If
you’re already using getSiteVersion for these methods (as recommended by our
installation guides), no changes should be required.
ReactRuntimeProvider takes a siteVersion prop
The <ReactRuntimeProvider>’s previewMode prop has been replaced with the
required siteVersion prop. The value passed for this prop should be set
by the same getSiteVersion function.
App Router
If you’re using App Router, use thegetSiteVersion function to get the value
to be passed to the siteVersion prop of <ReactRuntimeProvider>. If you
followed our installation guide and created a <MakeswiftProvider> component in
src/makeswift/provider.tsx, you can update the props of this component:
siteVersion prop in the
root layout (layout.tsx):
Pages Router
If you’re using Pages Router, you’ll need to update thegetStaticProps
function in your optional catch-all route to replace previewMode with
siteVersion in its returned data so that it becomes available in the
_app.tsx file:
_app.tsx file and pass it to the
<ReactRuntimeProvider>.
Removed deprecated client getSitemap method
The getSitemap client method, which was deprecated in
v0.19.0,
has been removed. See the v0.19.0 upgrade guide
on how to use the client.getPages method to create a sitemap instead.
Removed PageProvider component and usePageId hook
The PageProvider component and usePageId hook have been removed from the
runtime. These exports were obsolete and not being used for any functionality.