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!

book
Note
Ensure you have the latest version of the Yext CLI installed before proceeding with the steps below (at least 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:

  1. 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 Markdown

  2. Updates the following dependencies to latest:

    • @vitejs/plugin-react
    • vite  (to latest Vite 5)
    • @yext/search-headless-react
    • @yext/search-ui-react
  3. Removes fetch imports if it’s coming from @yext/pages/util (as it is supported natively as part of node.js 18 )

  4. Adds/updates the following package.json scripts: dev, prod, build

  5. Updates node engines in package.json to ^18.0.0 || >=20.0.0

  6. Checks the current version of node the user is on and errors if not on 18 or 20

  7. Updates @yext/pages to the version of the upgrade script running (should be the latest)

  8. Removes the following dependencies from package.json and updates imports to use @yext/pages-components  instead

    • @yext/sites-components
    • @yext/react-components
  9. Installs dependencies based on the package manager you’re using (npm, pnpm, yarn)

  10. Migrates from sites-config files (refer to the Site Config Files (< PagesJS 1.0.0) reference) to the new consolidated config.yaml format (refer to the Site Configuration reference doc)

book
Note
As a best practice, we recommend performing this upgrade on a separate branch and testing a deployment in the platform before merging into your production branch.

For a list of features and bug fixes introduced in PagesJS 1.0.0 and each beta version, check out this Github changelog .

Feedback