Upgrade from Remix Utils v7

Tip

This guide only matters if you're using Remix and you want to upgrade from Remix Utils v7 to v8.

The Remix Utils v8 package is not compatible anymore with Remix v1 or v2, instead it requires you to use React Router v7, and some utils may require you to use the framework mode of RRv7.

If you're on the process of migrating from Remix to RRv7, upgrade also Remix Utils to v8.

Then remove any @remix-run/* package you have. After that you should be good to go.

Note the following breaking changes:

If you were using Honeypot and CSRF utils, you should switch from crypto-js to @oslo/crypto and @oslo/encoding.

npm remove crypto-js @types/crypto-js
npm install @oslo/crypto @oslo/encoding

This change also introduced a breaking change in Honeypot getInputProps and check methods which is now async

- let inputProps = honeypot.getInputProps()
+ let inputProps = await honeypot.getInputProps()
- honeypot.check()
+ await honeypot.check()

If you're using namedAction util, note that it has dropped support for receiving a URL, URLSearchParams or Request objects, and now only accepts a FormData.

It also only support the field intent for the action name, if you were using ?/action-name or action or _action, that won't work anymore.

If you were using the wait timer util, that was removed, instead use setTimeout from node:timers/promise.

- import { wait } from 'remix-utils/timers"
+ import { setTimeout } from 'node:timers/promise'

And then in the usage:

- await wait(1000, { signal })
+ await setTimeout(1000, void 0, { signal })