Skip to content

Commit

Permalink
Add upgrade instructions for transitioning from crypto-js to @oslo/cr…
Browse files Browse the repository at this point in the history
…ypto in v7 to v8 guide
  • Loading branch information
sergiodxa committed Dec 4, 2024
1 parent fca1b83 commit 2266773
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/v7-to-v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,27 @@ Then remove any `@remix-run/*` package you have. After that you should be good t

Note the following breaking changes:

## Switch from crypto-js to Oslo

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

```sh
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

```diff
- let inputProps = honeypot.getInputProps()
+ let inputProps = await honeypot.getInputProps()
```

```diff
- honeypot.check()
+ await honeypot.check()
```

## 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.
Expand Down

0 comments on commit 2266773

Please sign in to comment.