-
-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add upgrade guide for transitioning from Remix Utils v7 to v8
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: Upgrade from v7 to v8 | ||
--- | ||
|
||
# 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: | ||
|
||
## namedAction | ||
|
||
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. | ||
|
||
## wait | ||
|
||
If you were using the `wait` timer util, that was removed, instead use `setTimeout` from `node:timers/promise`. | ||
|
||
```diff | ||
- import { wait } from 'remix-utils/timers" | ||
+ import { setTimeout } from 'node:timers/promise' | ||
``` | ||
|
||
And then in the usage: | ||
|
||
```diff | ||
- await wait(1000, { signal }) | ||
+ await setTimeout(1000, void 0, { signal }) | ||
``` |