Upgrading to PagesJS 1.0.0 | Yext Hitchhikers Platform
If you are using a beta version of PagesJS (anything below version 1.0.0), we recommend upgrading your project ASAP to take advantage of the latest features!
0.1_382
or higher).
To help facilitate this, Pages offers an upgrade command that will update any necessary portions of your project automatically.
To get started, cd
into your project and run the following command:
npx @yext/pages@latest upgrade
This command will perform the following actions automatically:
Logs a warning if you’re using the legacy markdown component from
react-components
and links to the reference doc on Rendering Rich Text and MarkdownUpdates the following dependencies to latest:
@vitejs/plugin-react
-
vite
(to latest Vite 5) @yext/search-headless-react
@yext/search-ui-react
Removes
fetch
imports if it’s coming from@yext/pages/util
(as it is supported natively as part of node.js 18 )Adds/updates the following
package.json
scripts: dev, prod, buildUpdates node
engines
inpackage.json
to^18.0.0 || >=20.0.0
Checks the current version of node the user is on and errors if not on 18 or 20
Updates
@yext/pages
to the version of the upgrade script running (should be the latest)Removes the following dependencies from
package.json
and updates imports to use@yext/pages-components
instead@yext/sites-components
@yext/react-components
Installs dependencies based on the package manager you’re using (npm, pnpm, yarn)
Migrates from
sites-config
files (refer to the Site Config Files (< PagesJS 1.0.0) reference) to the new consolidatedconfig.yaml
format (refer to the Site Configuration reference doc)
For a list of features and bug fixes introduced in PagesJS 1.0.0 and each beta version, check out this Github changelog .