You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/other-api/adapter.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,15 +24,15 @@ Each adapter has the same API. In the future we may have helpers specific to the
24
24
25
25
## Community Adapters
26
26
27
-
-[`@fastly/remix-server-adapter`][fastly-remix-server-adapter]- For [Fastly Compute][fastly-compute].
28
-
-[`@mcansh/remix-fastify`][remix-fastify]- For [Fastify][fastify].
29
-
-[`@mcansh/remix-raw-http`][remix-raw-http]- For a good old barebones Node server.
30
-
-[`@netlify/remix-adapter`][netlify-remix-adapter]- For [Netlify][netlify].
31
-
-[`@netlify/remix-edge-adapter`][netlify-remix-edge-adapter]- For [Netlify][netlify] Edge.
32
-
-[`@vercel/remix`][vercel-remix]- For [Vercel][vercel].
33
-
-[`remix-google-cloud-functions`][remix-google-cloud-functions]- For [Google Cloud][google-cloud-functions] and [Firebase][firebase-functions] functions.
34
-
-[`partymix`][partymix]- For [PartyKit][partykit].
35
-
-[`@scandinavianairlines/remix-azure-functions`][remix-azure-functions]: For [Azure Functions][azure-functions] and [Azure Static Web Apps][azure-static-web-apps].
27
+
-[`@fastly/remix-server-adapter`][fastly-remix-server-adapter]— For [Fastly Compute][fastly-compute].
28
+
-[`@mcansh/remix-fastify`][remix-fastify]— For [Fastify][fastify].
29
+
-[`@mcansh/remix-raw-http`][remix-raw-http]— For a good old bare-bones Node.js server.
30
+
-[`@netlify/remix-adapter`][netlify-remix-adapter]— For [Netlify][netlify].
31
+
-[`@netlify/remix-edge-adapter`][netlify-remix-edge-adapter]— For [Netlify][netlify] Edge.
32
+
-[`@vercel/remix`][vercel-remix]— For [Vercel][vercel].
33
+
-[`remix-google-cloud-functions`][remix-google-cloud-functions]— For [Google Cloud][google-cloud-functions] and [Firebase][firebase-functions] functions.
34
+
-[`partymix`][partymix]— For [PartyKit][partykit].
35
+
-[`@scandinavianairlines/remix-azure-functions`][remix-azure-functions] — For [Azure Functions][azure-functions] and [Azure Static Web Apps][azure-static-web-apps].
36
36
37
37
## Creating an Adapter
38
38
@@ -65,7 +65,7 @@ app.all(
65
65
// to pass that build to the request handler
66
66
build: require("./build"),
67
67
68
-
//return anything you want here to be available as `context` in your
68
+
//Return anything you want here to be available as `context` in your
69
69
// loaders and actions. This is where you can bridge the gap between Remix
Copy file name to clipboardExpand all lines: docs/other-api/create-remix.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,33 +8,33 @@ title: "create-remix (CLI)"
8
8
9
9
The `create-remix` CLI will create a new Remix project. Without passing arguments, this command will launch an interactive CLI to configure the new project and set it up in a given directory.
10
10
11
-
```sh
11
+
```shellscript nonumber
12
12
npx create-remix@latest
13
13
```
14
14
15
-
Optionally you can pass the desired directory path as an argument:
15
+
Optionally, you can pass the desired directory path as an argument:
16
16
17
-
```sh
17
+
```shellscript nonumber
18
18
npx create-remix@latest <projectDir>
19
19
```
20
20
21
-
The default application is a TypeScript app using the builtin [Remix App Server][remix-app-server]. If you wish to create your application based on a different setup, you can use the [`--template`][template-flag-hash-link] flag:
21
+
The default application is a TypeScript app using the built-in [Remix App Server][remix-app-server]. If you wish to create your application based on a different setup, you can use the [`--template`][template-flag-hash-link] flag:
22
22
23
-
```sh
23
+
```shellscript nonumber
24
24
npx create-remix@latest --template <templateUrl>
25
25
```
26
26
27
27
To get a full list of available commands and flags, run:
28
28
29
-
```sh
29
+
```shellscript nonumber
30
30
npx create-remix@latest --help
31
31
```
32
32
33
33
### Package managers
34
34
35
-
`create-remix` can also be invoked using various package managers, allowing you to choose between npm, Yarn, pnpm, and Bun for managing the install process.
35
+
`create-remix` can also be invoked using various package managers, allowing you to choose between npm, Yarn, pnpm, and Bun for managing the installation process.
36
36
37
-
```sh
37
+
```shellscript nonumber
38
38
npm create remix@latest <projectDir>
39
39
# or
40
40
yarn create remix@latest <projectDir>
@@ -57,7 +57,7 @@ A valid template can be:
57
57
- a local file path to a directory of files — `./path/to/remix-template`
58
58
- a local file path to a tarball — `./path/to/remix-template.tar.gz`
Copy file name to clipboardExpand all lines: docs/other-api/dev.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,13 +102,13 @@ HMR handles client-side code updates like when you change the components, markup
102
102
Likewise, HDR handles server-side code updates.
103
103
104
104
That means any time your change a [`loader`][loader] on your current page (or any code that your `loader` depends on), Remix will re-fetch data from your changed loader.
105
-
That way your app is _always_ up-to-date with the latest code changes, client-side or server-side.
105
+
That way your app is _always_ up to date with the latest code changes, client-side or server-side.
106
106
107
107
To learn more about how HMR and HDR work together, check out [Pedro's talk at Remix Conf 2023][legendary_dx].
108
108
109
109
</docs-info>
110
110
111
-
#### With custom app server
111
+
#### With a custom app server
112
112
113
113
If you used a template to get started, hopefully it's already integrated with `remix dev` out-of-the-box.
114
114
If not, you can follow these steps to integrate your project with `remix dev`:
In contrast, the `remix dev --port` option is an escape-hatch for users who need fine-grain control of network ports.
203
-
Most users, should not need to use `remix dev --port`.
203
+
Most users should not need to use `remix dev --port`.
204
204
205
205
#### Manual mode
206
206
@@ -214,7 +214,7 @@ You can see if app server restarts are a bottleneck for your project by comparin
214
214
215
215
#### Pick up changes from other packages
216
216
217
-
If you are using a monorepo, you might want Remix to perform hot updates not only when your app code changes, but whenever you change code in any of your apps dependencies.
217
+
If you are using a monorepo, you might want Remix to perform hot updates not only when your app code changes, but whenever you change code in any of your app's dependencies.
218
218
219
219
For example, you could have a UI library package (`packages/ui`) that is used within your Remix app (`packages/app`).
220
220
To pick up changes in `packages/ui`, you can configure [watchPaths][watch_paths] to include your packages.
@@ -238,7 +238,7 @@ For example, you can use `NODE_OPTIONS` to set Node's `--require` flag when runn
238
238
}
239
239
```
240
240
241
-
If you're using ESM as the default module system you will need to set the `--import` flag instead of `--require`:
241
+
If you're using ESM as the default module system, you will need to set the `--import` flag instead of `--require`:
242
242
243
243
```json filename=package.json
244
244
{
@@ -295,11 +295,11 @@ Now, hot updates will be sent correctly to the proxy:
295
295
##### Path imports
296
296
297
297
Currently, when Remix rebuilds your app, the compiler has to process your app code along with any of its dependencies.
298
-
The compiler tree-shakes unused code from app so that you don't ship any unused code to browser and so that you keep your server as slim as possible.
298
+
The compiler tree-shakes unused code from the app so that you don't ship any unused code to the browser and so that you keep your server as slim as possible.
299
299
But the compiler still needs to _crawl_ all the code to know what to keep and what to tree shake away.
300
300
301
301
In short, this means that the way you do imports and exports can have a big impact on how long it takes to rebuild your app.
302
-
For example, if you are using a library like Material UI or AntD you can likely speed up your builds by using [path imports][path_imports]:
302
+
For example, if you are using a library like Material UI or AntD, you can likely speed up your builds by using [path imports][path_imports]:
303
303
304
304
```diff
305
305
- import { Button, TextField } from '@mui/material';
@@ -327,7 +327,7 @@ check out our [discussion on Hot Module Replacement][hmr] to learn more about th
327
327
Hot Data Revalidation detects loader changes by trying to bundle each loader and then fingerprinting the content for each.
328
328
It relies on tree shaking to determine whether your changes affect each loader or not.
329
329
330
-
To ensure that tree shaking can reliably detect changes to loaders, make sure you declare that your app's package is sideeffectfree:
330
+
To ensure that tree shaking can reliably detect changes to loaders, make sure you declare that your app's package is side-effect-free:
Copy file name to clipboardExpand all lines: docs/other-api/node.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ This package contains utilities and polyfills for Node.js.
8
8
9
9
## Polyfills
10
10
11
-
Since Remix relies on browser APIs such as `fetch` that aren't natively & stably available yet in Node.js you may find that your unit tests fail without these globals when running with tools such as Jest.
11
+
Since Remix relies on browser APIs such as `fetch` that aren't natively and stably available yet in Node.js you may find that your unit tests fail without these globals when running with tools such as Jest.
12
12
13
13
Your testing framework should provide you with a hook or location to polyfill globals / mock out APIs; here you can add the following lines to install the globals that Remix relies on:
Copy file name to clipboardExpand all lines: docs/other-api/serve.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,11 +5,11 @@ order: 3
5
5
6
6
# Remix App Server
7
7
8
-
Remix is designed for you to own your server, but if you don't want to set one up you can use the Remix App Server instead. It's a production-ready, but basic Node.js server built with Express.
8
+
Remix is designed for you to own your server, but if you don't want to set one up, you can use the Remix App Server instead. It's a production-ready but basic Node.js server built with Express.
9
9
10
-
By design, we do not provide options to customize the Remix App Server because if you need to customize the underlying `express` server, we'd rather you manage the server completely instead of creating an abstraction to handle all of the possible customizations you may require. If you find you want to customize it, you should use the `@remix-run/express` adapter instead.
10
+
By design, we do not provide options to customize the Remix App Server because if you need to customize the underlying `express` server, we'd rather you manage the server completely instead of creating an abstraction to handle all the possible customizations you may require. If you find you want to customize it, you should use the `@remix-run/express` adapter instead.
11
11
12
-
You can see the underlying `express` server configuration in [packages/remix-serve/cli.ts][remix-serve-code]. By default it uses the following Express middlewares (please refer to their documentation for default behaviors):
12
+
You can see the underlying `express` server configuration in [packages/remix-serve/cli.ts][remix-serve-code]. By default, it uses the following Express middlewares (please refer to their documentation for default behaviors):
@@ -69,7 +69,7 @@ In development, `remix-serve` will ensure the latest code is run by purging the
69
69
70
70
If you need a workaround for preserving cache in development, you can set up a [singleton][singleton] in your server.
71
71
72
-
- Any **module side effects** will remain in place! This may cause problems, but should probably be avoided anyway.
72
+
- Any **module side effects** will remain in place! This may cause problems but should probably be avoided anyway.
73
73
74
74
```tsx lines=[3-6]
75
75
import { json } from"@remix-run/node"; // or cloudflare/deno
@@ -86,7 +86,7 @@ In development, `remix-serve` will ensure the latest code is run by purging the
86
86
87
87
If you need to write your code in a way that has these types of module side effects, you should set up your own [@remix-run/express][remix-run-express] server and a tool in development like pm2-dev or nodemon to restart the server on file changes instead.
88
88
89
-
In production this doesn't happen. The server boots up and that's the end of it.
89
+
In production this doesn't happen. The server boots up, and that's the end of it.
Copy file name to clipboardExpand all lines: docs/other-api/testing.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ title: "@remix-run/testing"
6
6
7
7
This package contains utilities to assist in unit testing portions of your Remix application. This is accomplished by mocking the Remix route modules/assets manifest output by the compiler and generating an in-memory React Router app via [createMemoryRouter][create-memory-router].
8
8
9
-
The general usage of this is to test components/hooks that rely on Remix hooks/components which you do not have the ability to cleanly mock ([`useLoaderData`][use-loader-data], [`useFetcher`][use-fetcher], etc.). While it can also be used for more advanced testing such as clicking links and navigating to pages, those are better suited for End-to-End tests via something like [Cypress][cypress] or [Playwright][playwright].
9
+
The general usage of this is to test components/hooks that rely on Remix hooks/components which you aren't able to cleanly mock ([`useLoaderData`][use-loader-data], [`useFetcher`][use-fetcher], etc.). While it can also be used for more advanced testing such as clicking links and navigating to pages, those are better suited for End-to-End tests via something like [Cypress][cypress] or [Playwright][playwright].
0 commit comments