Skip to content

Commit

Permalink
Mention more optional dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa committed Oct 4, 2023
1 parent 8c4270a commit 7723ff1
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ This package contains simple utility functions to use with [Remix.run](https://r
npm install remix-utils
```

Additional optional dependencies may be needed, all peer dependencies are:
Additional optional dependencies may be needed, all optional dependencies are:

- `zod`
- `react`
- `@remix-run/react` (also `@remix-run/router` but you sohuld be using the React one)
- `@remix-run/react` (also `@remix-run/router` but you should be using the React one)
- `@remix-run/node` or `@remix-run/cloudflare` or `@remix-run/deno` (actually it's `@remix-run/server-runtime` but you should use one of the others)
- `crypto-js`
- `is-ip`
- `intl-parse-accept-language`
- `react`
- `zod`

The utils that require an extra optional dependency mention it in their documentation.

Expand Down Expand Up @@ -327,7 +330,7 @@ Additionally, the `cors` function accepts a `options` object as a third optional

### CSRF

> **Note**: This depends on `react`, and a Remix server runtime.
> **Note**: This depends on `react`, `crypto-js`, and a Remix server runtime.
The CSRF related functions let you implement CSRF protection on your application.

Expand All @@ -338,7 +341,7 @@ First create a new CSRF instance.
```ts
// app/utils/csrf.server.ts
import { CSRF } from "remix-utils/csrf";
import { createCookie } from "@remix-run/node"; // or /cloudflare
import { createCookie } from "@remix-run/node"; // or cloudflare/deno

export const cookie = createCookie("csrf", {
path: "/",
Expand Down Expand Up @@ -837,6 +840,8 @@ The `useShouldHydrate` hook will detect `hydrate` as a function and call it usin

### getClientIPAddress

> **Note**: This depends on `is-ip`.
This function receives a Request or Headers objects and will try to get the IP address of the client (the user) who originated the request.

```ts
Expand Down Expand Up @@ -872,6 +877,8 @@ When a header is found that contains a valid IP address, it will return without

### getClientLocales

> **Note**: This depends on `intl-parse-accept-language`.
This function let you get the locales of the client (the user) who originated the request.

```ts
Expand Down Expand Up @@ -1740,7 +1747,7 @@ This means that the `respondTo` helper will prioritize any handler that match `t

### Form Honeypot

> **Note**: This depends on `react`.
> **Note**: This depends on `react` and `crypto-js`.
Honeypot is a simple technic to prevent spam bots from submitting forms, it works by adding a hidden field to the form that bots will fill, but humans won't.

Expand Down

0 comments on commit 7723ff1

Please sign in to comment.