remix 3.0.0-rc.3 → 3.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/INDEX.md +13 -21
- package/dist/component/dev/refresh.d.ts +2 -0
- package/dist/component/dev/refresh.d.ts.map +1 -0
- package/dist/{ui → component}/dev/refresh.js +1 -1
- package/dist/component/jsx-dev-runtime.d.ts +2 -0
- package/dist/component/jsx-dev-runtime.d.ts.map +1 -0
- package/dist/{ui → component}/jsx-dev-runtime.js +1 -1
- package/dist/component/jsx-runtime.d.ts +2 -0
- package/dist/component/jsx-runtime.d.ts.map +1 -0
- package/dist/{ui → component}/jsx-runtime.js +1 -1
- package/dist/component/server.d.ts +2 -0
- package/dist/component/server.d.ts.map +1 -0
- package/dist/{ui → component}/server.js +1 -1
- package/dist/component/test.d.ts +2 -0
- package/dist/component/test.d.ts.map +1 -0
- package/dist/{ui → component}/test.js +1 -1
- package/dist/component-hmr/assets.d.ts +2 -0
- package/dist/component-hmr/assets.d.ts.map +1 -0
- package/dist/{ui-hmr.js → component-hmr/assets.js} +1 -1
- package/dist/component-hmr/node.d.ts +3 -0
- package/dist/component-hmr/node.d.ts.map +1 -0
- package/dist/{ui-hmr → component-hmr}/node.js +1 -1
- package/dist/component-hmr/runtime/browser.d.ts +2 -0
- package/dist/component-hmr/runtime/browser.d.ts.map +1 -0
- package/dist/{ui-hmr → component-hmr}/runtime/browser.js +1 -1
- package/dist/component-hmr/runtime/server.d.ts +2 -0
- package/dist/component-hmr/runtime/server.d.ts.map +1 -0
- package/dist/{ui-hmr → component-hmr}/runtime/server.js +1 -1
- package/dist/component-hmr.d.ts +2 -0
- package/dist/component-hmr.d.ts.map +1 -0
- package/dist/{ui-hmr/assets.js → component-hmr.js} +1 -1
- package/dist/component.d.ts +2 -0
- package/dist/component.d.ts.map +1 -0
- package/dist/{ui/anchor.js → component.js} +1 -1
- package/dist/fetch-router.d.ts +1 -3
- package/dist/fetch-router.d.ts.map +1 -1
- package/dist/fetch-router.js +0 -1
- package/dist/index.d.ts +18 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1 -0
- package/guides/01-start-here.md +23 -24
- package/guides/02-routing-and-controllers.md +4 -4
- package/guides/03-request-handling.md +6 -20
- package/guides/04-rendering-ui.md +342 -110
- package/guides/05-interactivity.md +133 -41
- package/guides/06-streaming-ui-with-frames.md +29 -71
- package/guides/07-animation.md +710 -24
- package/guides/08-data-and-validation.md +452 -0
- package/guides/09-forms-and-mutations.md +277 -0
- package/guides/10-auth-sessions-security.md +61 -0
- package/guides/11-files-and-assets.md +98 -0
- package/guides/12-errors-and-cancellation.md +44 -0
- package/guides/13-testing.md +14 -14
- package/guides/14-cli-and-tooling.md +52 -0
- package/guides/15-production.md +57 -0
- package/package.json +105 -176
- package/src/assets/README.md +122 -16
- package/src/async-context-middleware/README.md +6 -6
- package/src/auth/README.md +8 -6
- package/src/auth-middleware/README.md +7 -7
- package/src/cli/README.md +2 -0
- package/src/{ui → component}/README.md +50 -66
- package/src/{ui → component}/dev/refresh.ts +1 -1
- package/src/{ui → component}/jsx-dev-runtime.ts +1 -1
- package/src/{ui → component}/jsx-runtime.ts +1 -1
- package/src/{ui → component}/server/README.md +8 -8
- package/src/{ui → component}/server.ts +1 -1
- package/src/{ui → component}/test/README.md +6 -6
- package/src/{ui → component}/test.ts +1 -1
- package/src/{ui-hmr → component-hmr}/README.md +15 -15
- package/src/{ui-hmr → component-hmr}/assets.ts +1 -1
- package/src/{ui-hmr → component-hmr}/node.ts +1 -1
- package/src/{ui-hmr → component-hmr}/runtime/browser.ts +1 -1
- package/src/{ui-hmr → component-hmr}/runtime/server.ts +1 -1
- package/{dist/ui/accordion.js → src/component-hmr.ts} +1 -1
- package/{dist/ui/tabs.js → src/component.ts} +1 -1
- package/src/compression-middleware/README.md +4 -4
- package/src/cookie/README.md +3 -3
- package/src/cop-middleware/README.md +4 -4
- package/src/cors-middleware/README.md +3 -3
- package/src/csrf-middleware/README.md +20 -12
- package/src/data-table/README.md +6 -5
- package/src/data-table-mysql/README.md +5 -5
- package/src/data-table-postgres/README.md +5 -5
- package/src/data-table-sqlite/README.md +5 -5
- package/src/fetch-proxy/README.md +22 -4
- package/src/fetch-router/README.md +17 -15
- package/src/fetch-router.ts +1 -3
- package/src/file-storage/README.md +3 -3
- package/src/file-storage-s3/README.md +3 -3
- package/src/form-data-middleware/README.md +8 -5
- package/src/form-data-parser/README.md +10 -8
- package/src/fs/README.md +4 -4
- package/src/headers/README.md +8 -2
- package/src/html-template/README.md +1 -1
- package/src/index.ts +18 -0
- package/src/lazy-file/README.md +2 -2
- package/src/logger-middleware/README.md +1 -1
- package/src/method-override-middleware/README.md +3 -3
- package/src/multipart-parser/README.md +26 -5
- package/src/multiple-import-maps-polyfill/README.md +4 -4
- package/src/node-fetch-server/README.md +3 -1
- package/src/node-hmr/README.md +19 -10
- package/src/render-middleware/README.md +9 -9
- package/src/response/README.md +6 -6
- package/src/route-pattern/README.md +2 -0
- package/src/session/README.md +4 -4
- package/src/session-middleware/README.md +3 -3
- package/src/session-storage-memcache/README.md +3 -3
- package/src/session-storage-redis/README.md +1 -1
- package/src/spa/README.md +6 -6
- package/src/static-middleware/README.md +15 -3
- package/src/tar-parser/README.md +1 -1
- package/src/terminal/README.md +2 -2
- package/src/test/README.md +17 -7
- package/dist/ui/accordion/primitives.d.ts +0 -2
- package/dist/ui/accordion/primitives.d.ts.map +0 -1
- package/dist/ui/accordion/primitives.js +0 -2
- package/dist/ui/accordion.d.ts +0 -2
- package/dist/ui/accordion.d.ts.map +0 -1
- package/dist/ui/anchor.d.ts +0 -2
- package/dist/ui/anchor.d.ts.map +0 -1
- package/dist/ui/animation.d.ts +0 -2
- package/dist/ui/animation.d.ts.map +0 -1
- package/dist/ui/animation.js +0 -2
- package/dist/ui/breadcrumbs.d.ts +0 -2
- package/dist/ui/breadcrumbs.d.ts.map +0 -1
- package/dist/ui/breadcrumbs.js +0 -2
- package/dist/ui/button.d.ts +0 -3
- package/dist/ui/button.d.ts.map +0 -1
- package/dist/ui/button.js +0 -3
- package/dist/ui/checkbox.d.ts +0 -3
- package/dist/ui/checkbox.d.ts.map +0 -1
- package/dist/ui/checkbox.js +0 -3
- package/dist/ui/combobox/primitives.d.ts +0 -2
- package/dist/ui/combobox/primitives.d.ts.map +0 -1
- package/dist/ui/combobox/primitives.js +0 -2
- package/dist/ui/combobox.d.ts +0 -2
- package/dist/ui/combobox.d.ts.map +0 -1
- package/dist/ui/combobox.js +0 -2
- package/dist/ui/dev/refresh.d.ts +0 -2
- package/dist/ui/dev/refresh.d.ts.map +0 -1
- package/dist/ui/input.d.ts +0 -3
- package/dist/ui/input.d.ts.map +0 -1
- package/dist/ui/input.js +0 -3
- package/dist/ui/jsx-dev-runtime.d.ts +0 -2
- package/dist/ui/jsx-dev-runtime.d.ts.map +0 -1
- package/dist/ui/jsx-runtime.d.ts +0 -2
- package/dist/ui/jsx-runtime.d.ts.map +0 -1
- package/dist/ui/listbox.d.ts +0 -2
- package/dist/ui/listbox.d.ts.map +0 -1
- package/dist/ui/listbox.js +0 -2
- package/dist/ui/menu/primitives.d.ts +0 -2
- package/dist/ui/menu/primitives.d.ts.map +0 -1
- package/dist/ui/menu/primitives.js +0 -2
- package/dist/ui/menu.d.ts +0 -2
- package/dist/ui/menu.d.ts.map +0 -1
- package/dist/ui/menu.js +0 -2
- package/dist/ui/popover.d.ts +0 -2
- package/dist/ui/popover.d.ts.map +0 -1
- package/dist/ui/popover.js +0 -2
- package/dist/ui/radio.d.ts +0 -3
- package/dist/ui/radio.d.ts.map +0 -1
- package/dist/ui/radio.js +0 -3
- package/dist/ui/select/primitives.d.ts +0 -2
- package/dist/ui/select/primitives.d.ts.map +0 -1
- package/dist/ui/select/primitives.js +0 -2
- package/dist/ui/select.d.ts +0 -2
- package/dist/ui/select.d.ts.map +0 -1
- package/dist/ui/select.js +0 -2
- package/dist/ui/server.d.ts +0 -2
- package/dist/ui/server.d.ts.map +0 -1
- package/dist/ui/tabs/primitives.d.ts +0 -2
- package/dist/ui/tabs/primitives.d.ts.map +0 -1
- package/dist/ui/tabs/primitives.js +0 -2
- package/dist/ui/tabs.d.ts +0 -2
- package/dist/ui/tabs.d.ts.map +0 -1
- package/dist/ui/test.d.ts +0 -2
- package/dist/ui/test.d.ts.map +0 -1
- package/dist/ui/toggle/primitives.d.ts +0 -2
- package/dist/ui/toggle/primitives.d.ts.map +0 -1
- package/dist/ui/toggle/primitives.js +0 -2
- package/dist/ui/toggle.d.ts +0 -3
- package/dist/ui/toggle.d.ts.map +0 -1
- package/dist/ui/toggle.js +0 -3
- package/dist/ui-hmr/assets.d.ts +0 -2
- package/dist/ui-hmr/assets.d.ts.map +0 -1
- package/dist/ui-hmr/node.d.ts +0 -3
- package/dist/ui-hmr/node.d.ts.map +0 -1
- package/dist/ui-hmr/runtime/browser.d.ts +0 -2
- package/dist/ui-hmr/runtime/browser.d.ts.map +0 -1
- package/dist/ui-hmr/runtime/server.d.ts +0 -2
- package/dist/ui-hmr/runtime/server.d.ts.map +0 -1
- package/dist/ui-hmr.d.ts +0 -2
- package/dist/ui-hmr.d.ts.map +0 -1
- package/dist/ui.d.ts +0 -2
- package/dist/ui.d.ts.map +0 -1
- package/dist/ui.js +0 -2
- package/src/ui/accordion/README.md +0 -202
- package/src/ui/accordion/primitives.ts +0 -2
- package/src/ui/accordion.ts +0 -2
- package/src/ui/anchor/README.md +0 -196
- package/src/ui/anchor.ts +0 -2
- package/src/ui/animation/README.md +0 -316
- package/src/ui/animation.ts +0 -2
- package/src/ui/breadcrumbs/README.md +0 -55
- package/src/ui/breadcrumbs.ts +0 -2
- package/src/ui/button/README.md +0 -44
- package/src/ui/button.ts +0 -3
- package/src/ui/checkbox/README.md +0 -59
- package/src/ui/checkbox.ts +0 -3
- package/src/ui/combobox/README.md +0 -194
- package/src/ui/combobox/primitives.ts +0 -2
- package/src/ui/combobox.ts +0 -2
- package/src/ui/input/README.md +0 -52
- package/src/ui/input.ts +0 -3
- package/src/ui/listbox/README.md +0 -83
- package/src/ui/listbox.ts +0 -2
- package/src/ui/menu/README.md +0 -161
- package/src/ui/menu/primitives.ts +0 -2
- package/src/ui/menu.ts +0 -2
- package/src/ui/popover/README.md +0 -103
- package/src/ui/popover.ts +0 -2
- package/src/ui/radio/README.md +0 -53
- package/src/ui/radio.ts +0 -3
- package/src/ui/select/README.md +0 -117
- package/src/ui/select/primitives.ts +0 -2
- package/src/ui/select.ts +0 -2
- package/src/ui/tabs/README.md +0 -141
- package/src/ui/tabs/primitives.ts +0 -2
- package/src/ui/tabs.ts +0 -2
- package/src/ui/toggle/README.md +0 -56
- package/src/ui/toggle/primitives.ts +0 -2
- package/src/ui/toggle.ts +0 -3
- package/src/ui-hmr.ts +0 -2
- package/src/ui.ts +0 -2
package/INDEX.md
CHANGED
|
@@ -12,8 +12,15 @@ Search this generated index by task, export name, or description. Use the guides
|
|
|
12
12
|
| [Rendering UI](guides/04-rendering-ui.md) | How to build pages from Remix components, props, context, document shells, styles, and first-party UI. |
|
|
13
13
|
| [Interactivity](guides/05-interactivity.md) | How server-rendered UI hydrates, handles events, connects components to application models, navigates, and cancels stale work. |
|
|
14
14
|
| [Streaming UI with Frames](guides/06-streaming-ui-with-frames.md) | How to stream and reload route-owned UI with Frame, fallbacks, and server and browser frame resolvers. |
|
|
15
|
-
| [Animation](guides/07-animation.md) | The CSS-first animation model and Remix
|
|
15
|
+
| [Animation](guides/07-animation.md) | The CSS-first animation model and Remix component helpers for motion that respects rendering state. |
|
|
16
|
+
| [Data and Validation](guides/08-data-and-validation.md) | How Remix validates inputs, defines relational data, queries databases, and runs SQL migrations. |
|
|
17
|
+
| [Forms and Mutations](guides/09-forms-and-mutations.md) | How native forms, action responses, validation failures, redirects, and enhanced mutations fit together. |
|
|
18
|
+
| [Auth, Sessions, and Security](guides/10-auth-sessions-security.md) | How Remix stores per-browser state, resolves identity, protects routes, and defends browser request boundaries. |
|
|
19
|
+
| [Files and Assets](guides/11-files-and-assets.md) | How Remix serves static files and source assets, accepts bounded uploads, stores files, and returns HTTP file responses. |
|
|
20
|
+
| [Errors and Cancellation](guides/12-errors-and-cancellation.md) | How expected HTTP failures, uncaught server errors, rendering failures, client runtime errors, and aborted work propagate through Remix. |
|
|
16
21
|
| [Testing](guides/13-testing.md) | How to choose a test boundary and test Remix routes, stateful request flows, components, and end-to-end behavior. |
|
|
22
|
+
| [CLI and Tooling](guides/14-cli-and-tooling.md) | The Remix command-line workflow for creating, inspecting, testing, checking, and running TypeScript projects. |
|
|
23
|
+
| [Production](guides/15-production.md) | How to configure, start, cache, observe, and shut down a Remix application in production. |
|
|
17
24
|
|
|
18
25
|
## Package APIs
|
|
19
26
|
|
|
@@ -24,6 +31,10 @@ Exports covered by the same README are grouped together.
|
|
|
24
31
|
| `remix/assert` | Node assert-compatible utilities for any JavaScript environment | [README](src/assert/README.md) |
|
|
25
32
|
| `remix/assets`<br>`remix/assets/types/hmr` | Fetch-based server for compiling browser JS/TS and CSS assets on demand | [README](src/assets/README.md) |
|
|
26
33
|
| `remix/auth` | Browser login, OAuth, and OIDC helpers for Remix | [README](src/auth/README.md) |
|
|
34
|
+
| `remix/component`<br>`remix/component/dev/refresh`<br>`remix/component/jsx-dev-runtime`<br>`remix/component/jsx-runtime` | Component runtime with server rendering and browser hydration | [README](src/component/README.md) |
|
|
35
|
+
| `remix/component-hmr`<br>`remix/component-hmr/assets`<br>`remix/component-hmr/node`<br>`remix/component-hmr/runtime/browser`<br>`remix/component-hmr/runtime/server` | Hot module replacement runtime and transforms for Remix components | [README](src/component-hmr/README.md) |
|
|
36
|
+
| `remix/component/server` | Component runtime with server rendering and browser hydration | [README](src/component/server/README.md) |
|
|
37
|
+
| `remix/component/test` | Component runtime with server rendering and browser hydration | [README](src/component/test/README.md) |
|
|
27
38
|
| `remix/cookie` | A toolkit for working with cookies in JavaScript | [README](src/cookie/README.md) |
|
|
28
39
|
| `remix/data-schema`<br>`remix/data-schema/checks`<br>`remix/data-schema/coerce`<br>`remix/data-schema/form-data`<br>`remix/data-schema/lazy` | Tiny, standards-aligned schema validation | [README](src/data-schema/README.md) |
|
|
29
40
|
| `remix/data-table`<br>`remix/data-table/cli`<br>`remix/data-table/migrations`<br>`remix/data-table/migrations/node`<br>`remix/data-table/operators`<br>`remix/data-table/sql-helpers` | A typed, relational query toolkit for JavaScript | [README](src/data-table/README.md) |
|
|
@@ -47,7 +58,7 @@ Exports covered by the same README are grouped together.
|
|
|
47
58
|
| `remix/middleware/form-data` | Middleware for parsing FormData from request bodies | [README](src/form-data-middleware/README.md) |
|
|
48
59
|
| `remix/middleware/logger` | Middleware for logging HTTP requests and responses | [README](src/logger-middleware/README.md) |
|
|
49
60
|
| `remix/middleware/method-override` | Middleware for overriding HTTP request methods from form data | [README](src/method-override-middleware/README.md) |
|
|
50
|
-
| `remix/middleware/render` | Conventional Remix
|
|
61
|
+
| `remix/middleware/render` | Conventional Remix component and custom request-scoped render middleware | [README](src/render-middleware/README.md) |
|
|
51
62
|
| `remix/middleware/session` | Middleware for managing sessions with cookie-based storage | [README](src/session-middleware/README.md) |
|
|
52
63
|
| `remix/middleware/static` | Middleware for serving static files from the filesystem | [README](src/static-middleware/README.md) |
|
|
53
64
|
| `remix/mime` | Utilities for working with MIME types | [README](src/mime/README.md) |
|
|
@@ -66,22 +77,3 @@ Exports covered by the same README are grouped together.
|
|
|
66
77
|
| `remix/tar-parser` | A fast, efficient parser for tar streams in any JavaScript environment | [README](src/tar-parser/README.md) |
|
|
67
78
|
| `remix/terminal` | Terminal output utilities for JavaScript libraries and CLIs | [README](src/terminal/README.md) |
|
|
68
79
|
| `remix/test`<br>`remix/test/cli` | A test framework for JavaScript and TypeScript projects | [README](src/test/README.md) |
|
|
69
|
-
| `remix/ui`<br>`remix/ui/dev/refresh`<br>`remix/ui/jsx-dev-runtime`<br>`remix/ui/jsx-runtime` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/README.md) |
|
|
70
|
-
| `remix/ui-hmr`<br>`remix/ui-hmr/assets`<br>`remix/ui-hmr/node`<br>`remix/ui-hmr/runtime/browser`<br>`remix/ui-hmr/runtime/server` | Hot module replacement runtime and transforms for Remix UI components | [README](src/ui-hmr/README.md) |
|
|
71
|
-
| `remix/ui/accordion`<br>`remix/ui/accordion/primitives` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/accordion/README.md) |
|
|
72
|
-
| `remix/ui/anchor` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/anchor/README.md) |
|
|
73
|
-
| `remix/ui/animation` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/animation/README.md) |
|
|
74
|
-
| `remix/ui/breadcrumbs` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/breadcrumbs/README.md) |
|
|
75
|
-
| `remix/ui/button` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/button/README.md) |
|
|
76
|
-
| `remix/ui/checkbox` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/checkbox/README.md) |
|
|
77
|
-
| `remix/ui/combobox`<br>`remix/ui/combobox/primitives` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/combobox/README.md) |
|
|
78
|
-
| `remix/ui/input` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/input/README.md) |
|
|
79
|
-
| `remix/ui/listbox` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/listbox/README.md) |
|
|
80
|
-
| `remix/ui/menu`<br>`remix/ui/menu/primitives` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/menu/README.md) |
|
|
81
|
-
| `remix/ui/popover` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/popover/README.md) |
|
|
82
|
-
| `remix/ui/radio` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/radio/README.md) |
|
|
83
|
-
| `remix/ui/select`<br>`remix/ui/select/primitives` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/select/README.md) |
|
|
84
|
-
| `remix/ui/server` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/server/README.md) |
|
|
85
|
-
| `remix/ui/tabs`<br>`remix/ui/tabs/primitives` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/tabs/README.md) |
|
|
86
|
-
| `remix/ui/test` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/test/README.md) |
|
|
87
|
-
| `remix/ui/toggle`<br>`remix/ui/toggle/primitives` | UI runtime, headless primitives, and styled components for Remix | [README](src/ui/toggle/README.md) |
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/component/dev/refresh.ts"],"names":[],"mappings":"AACA,cAAc,kCAAkC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
-
export * from '@remix-run/
|
|
2
|
+
export * from '@remix-run/component/dev/refresh';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-dev-runtime.d.ts","sourceRoot":"","sources":["../../src/component/jsx-dev-runtime.ts"],"names":[],"mappings":"AACA,cAAc,sCAAsC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
-
export * from '@remix-run/
|
|
2
|
+
export * from '@remix-run/component/jsx-dev-runtime';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsx-runtime.d.ts","sourceRoot":"","sources":["../../src/component/jsx-runtime.ts"],"names":[],"mappings":"AACA,cAAc,kCAAkC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
-
export * from '@remix-run/
|
|
2
|
+
export * from '@remix-run/component/jsx-runtime';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/component/server.ts"],"names":[],"mappings":"AACA,cAAc,6BAA6B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
-
export * from '@remix-run/
|
|
2
|
+
export * from '@remix-run/component/server';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../src/component/test.ts"],"names":[],"mappings":"AACA,cAAc,2BAA2B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
-
export * from '@remix-run/
|
|
2
|
+
export * from '@remix-run/component/test';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assets.d.ts","sourceRoot":"","sources":["../../src/component-hmr/assets.ts"],"names":[],"mappings":"AACA,cAAc,iCAAiC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
-
export * from '@remix-run/
|
|
2
|
+
export * from '@remix-run/component-hmr/assets';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/component-hmr/node.ts"],"names":[],"mappings":"AACA,OAAO,+BAA+B,CAAA;AACtC,OAAO,EAAE,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../../src/component-hmr/runtime/browser.ts"],"names":[],"mappings":"AACA,cAAc,0CAA0C,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
-
export * from '@remix-run/
|
|
2
|
+
export * from '@remix-run/component-hmr/runtime/browser';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../../src/component-hmr/runtime/server.ts"],"names":[],"mappings":"AACA,cAAc,yCAAyC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
-
export * from '@remix-run/
|
|
2
|
+
export * from '@remix-run/component-hmr/runtime/server';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-hmr.d.ts","sourceRoot":"","sources":["../src/component-hmr.ts"],"names":[],"mappings":"AACA,cAAc,0BAA0B,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
-
export * from '@remix-run/
|
|
2
|
+
export * from '@remix-run/component-hmr';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../src/component.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
-
export * from '@remix-run/
|
|
2
|
+
export * from '@remix-run/component';
|
package/dist/fetch-router.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
+
import type { RouterTypes as RemixRouterTypes } from './index.ts';
|
|
1
2
|
export * from '@remix-run/fetch-router';
|
|
2
|
-
export interface RouterTypes {
|
|
3
|
-
}
|
|
4
|
-
type RemixRouterTypes = RouterTypes;
|
|
5
3
|
declare module '@remix-run/fetch-router' {
|
|
6
4
|
interface RouterTypes extends RemixRouterTypes {
|
|
7
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-router.d.ts","sourceRoot":"","sources":["../src/fetch-router.ts"],"names":[],"mappings":"AACA,
|
|
1
|
+
{"version":3,"file":"fetch-router.d.ts","sourceRoot":"","sources":["../src/fetch-router.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACjE,cAAc,yBAAyB,CAAA;AAEvC,OAAO,QAAQ,yBAAyB,CAAC;IACvC,UAAU,WAAY,SAAQ,gBAAgB;KAAG;CAClD"}
|
package/dist/fetch-router.js
CHANGED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// IMPORTANT: This file is auto-generated, please do not edit manually.
|
|
2
|
+
/**
|
|
3
|
+
* Ambient router type configuration for application-wide defaults.
|
|
4
|
+
*
|
|
5
|
+
* Apps may augment this interface to define the default request context used by
|
|
6
|
+
* `createAction()`, `createController()`, and `getContext()`.
|
|
7
|
+
* Apps with multiple routers should pass explicit context types instead.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```ts
|
|
11
|
+
* declare module 'remix' {
|
|
12
|
+
* interface RouterTypes {
|
|
13
|
+
* context: AppContext
|
|
14
|
+
* }
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export interface RouterTypes {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,WAAW;CAAG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/guides/01-start-here.md
CHANGED
|
@@ -13,7 +13,7 @@ These APIs ship together through focused subpath imports from the `remix` packag
|
|
|
13
13
|
|
|
14
14
|
The design of Remix comes from six core principles:
|
|
15
15
|
|
|
16
|
-
1. **
|
|
16
|
+
1. **Model-First Development.** Remix optimizes source code, documentation, tooling, and abstractions for LLMs, and provides primitives for using models inside the products you build.
|
|
17
17
|
2. **Build on Web APIs.** Remix builds on `Request`, `Response`, `URL`, `FormData`, headers, cookies, and JavaScript because shared platform APIs reduce context switching across the full stack while keeping your application portable.
|
|
18
18
|
3. **Religiously Runtime.** Remix APIs do not depend on bundlers, type generation, or static analysis. Routes, middleware, controllers, and tests should run as ordinary runtime code.
|
|
19
19
|
4. **Avoid Dependencies.** Remix chooses dependencies carefully, wraps them behind its own boundaries, and works toward replacing them with focused packages when the framework needs long-term control.
|
|
@@ -78,6 +78,7 @@ my-remix-app/
|
|
|
78
78
|
├── router.ts # middleware, routes, and controller mapping
|
|
79
79
|
├── middleware/ # request middleware and context providers
|
|
80
80
|
├── actions/ # controllers, route actions, and route-local UI
|
|
81
|
+
│ ├── controller.tsx # root route controller
|
|
81
82
|
│ ├── document.tsx # app document shell
|
|
82
83
|
│ └── public/
|
|
83
84
|
│ └── entry.ts # starts the browser runtime
|
|
@@ -93,9 +94,7 @@ import { createRequestListener } from "remix/node-fetch-server";
|
|
|
93
94
|
|
|
94
95
|
import { router } from "./app/router.ts";
|
|
95
96
|
|
|
96
|
-
const requestListener = createRequestListener(
|
|
97
|
-
return await router.fetch(request);
|
|
98
|
-
});
|
|
97
|
+
const requestListener = createRequestListener(router.fetch);
|
|
99
98
|
const server = http.createServer(requestListener);
|
|
100
99
|
|
|
101
100
|
server.listen(44100, () => {
|
|
@@ -193,14 +192,14 @@ The [Routing and Controllers](/routing-and-controllers/) chapter covers route ma
|
|
|
193
192
|
|
|
194
193
|
Let's make this album page a little more interesting by returning HTML from a Remix component.
|
|
195
194
|
|
|
196
|
-
|
|
195
|
+
A component is a function that receives a `handle` and returns another function that renders JSX. The outer function is setup: it runs once when the component is created, so normal JavaScript variables declared there can hold local state. The returned function is render: it runs on the first render and every update afterward.
|
|
197
196
|
|
|
198
197
|
We'll come back to the component model later. If you want the full model now, check out the [Rendering UI](/rendering-ui/) chapter.
|
|
199
198
|
|
|
200
199
|
```tsx
|
|
201
200
|
function MyComponent(handle) {
|
|
202
201
|
// Setup phase: runs once when this component is created.
|
|
203
|
-
// The handle gives the component access to props and other Remix
|
|
202
|
+
// The handle gives the component access to props and other Remix component APIs.
|
|
204
203
|
|
|
205
204
|
return () => {
|
|
206
205
|
// Render phase: runs on the first render and every update afterward.
|
|
@@ -218,7 +217,7 @@ touch app/actions/albums/show-page.tsx
|
|
|
218
217
|
```
|
|
219
218
|
|
|
220
219
|
```tsx filename=app/actions/albums/show-page.tsx
|
|
221
|
-
import type { Handle } from "remix/
|
|
220
|
+
import type { Handle } from "remix/component";
|
|
222
221
|
|
|
223
222
|
import { Document } from "../document.tsx";
|
|
224
223
|
|
|
@@ -321,7 +320,7 @@ export default createController(routes.albums, {
|
|
|
321
320
|
Let's tweak our `AlbumPage` component to display the album data:
|
|
322
321
|
|
|
323
322
|
```tsx filename=app/actions/albums/show-page.tsx lines=[3,6,8,11,13-16]
|
|
324
|
-
import type { Handle } from "remix/
|
|
323
|
+
import type { Handle } from "remix/component";
|
|
325
324
|
|
|
326
325
|
import type { Album } from "./data.ts";
|
|
327
326
|
import { Document } from "../document.tsx";
|
|
@@ -349,8 +348,8 @@ Now the page displays the album title, artist, and year.
|
|
|
349
348
|
Center it and add a little spacing with the `css` function and `mix` prop. The [Rendering UI](/rendering-ui/) chapter covers this helper and prop in more detail.
|
|
350
349
|
|
|
351
350
|
```tsx filename=app/actions/albums/show-page.tsx lines=[2,14-18,20]
|
|
352
|
-
import type { Handle } from "remix/
|
|
353
|
-
import { css } from "remix/
|
|
351
|
+
import type { Handle } from "remix/component";
|
|
352
|
+
import { css } from "remix/component";
|
|
354
353
|
|
|
355
354
|
import type { Album } from "./data.ts";
|
|
356
355
|
import { Document } from "../document.tsx";
|
|
@@ -455,8 +454,8 @@ router.map(routes.albums.edit, albumsEditController);
|
|
|
455
454
|
Now we can create the form page. It's a very simple form that displays the existing data and submits a POST request to our edit action.
|
|
456
455
|
|
|
457
456
|
```tsx filename=app/actions/albums/edit/page.tsx
|
|
458
|
-
import { css } from "remix/
|
|
459
|
-
import type { Handle } from "remix/
|
|
457
|
+
import { css } from "remix/component";
|
|
458
|
+
import type { Handle } from "remix/component";
|
|
460
459
|
|
|
461
460
|
import { routes } from "../../../routes.ts";
|
|
462
461
|
import { Document } from "../../document.tsx";
|
|
@@ -549,7 +548,7 @@ export const router = createRouter({
|
|
|
549
548
|
|
|
550
549
|
export type AppContext = RouterContext<typeof router>;
|
|
551
550
|
|
|
552
|
-
declare module "remix
|
|
551
|
+
declare module "remix" {
|
|
553
552
|
interface RouterTypes {
|
|
554
553
|
context: AppContext;
|
|
555
554
|
}
|
|
@@ -607,7 +606,7 @@ export default createController(routes.albums.edit, {
|
|
|
607
606
|
});
|
|
608
607
|
```
|
|
609
608
|
|
|
610
|
-
The `action` route action validates the parsed Web `FormData`, returns an explicit response for invalid input or a missing album, and redirects back to the album page after a successful update. The [
|
|
609
|
+
The `action` route action validates the parsed Web `FormData`, returns an explicit response for invalid input or a missing album, and redirects back to the album page after a successful update. The [Forms and Mutations](/forms-and-mutations/) chapter shows how to render field-level validation errors back into a form.
|
|
611
610
|
|
|
612
611
|
Now we can update our album data and set it to the correct year.
|
|
613
612
|
|
|
@@ -630,13 +629,13 @@ mkdir -p app/actions/albums/edit/public
|
|
|
630
629
|
touch app/actions/albums/edit/public/album-edit-form.tsx
|
|
631
630
|
```
|
|
632
631
|
|
|
633
|
-
The colocated `public/` directory is the explicit browser-source boundary. The template's asset server allows source beneath `app/**/public/**`, so Remix can turn this component and its local dependencies into browser modules. Keep those local dependencies inside the same `public/` directory; `app/routes.ts` is allowed separately for type-safe links. The template also loads `app/actions/public/entry.ts`, which starts the Remix
|
|
632
|
+
The colocated `public/` directory is the explicit browser-source boundary. The template's asset server allows source beneath `app/**/public/**`, so Remix can turn this component and its local dependencies into browser modules. Keep those local dependencies inside the same `public/` directory; `app/routes.ts` is allowed separately for type-safe links. The template also loads `app/actions/public/entry.ts`, which starts the Remix component client runtime. The [Files and Assets](/files-and-assets/) chapter goes deeper into this bundlerless setup.
|
|
634
633
|
|
|
635
634
|
Now that we have a place for the form to live, let's pull it into its own component.
|
|
636
635
|
|
|
637
636
|
```tsx filename=app/actions/albums/edit/public/album-edit-form.tsx
|
|
638
|
-
import { css } from "remix/
|
|
639
|
-
import type { Handle } from "remix/
|
|
637
|
+
import { css } from "remix/component";
|
|
638
|
+
import type { Handle } from "remix/component";
|
|
640
639
|
|
|
641
640
|
import { routes } from "../../../../routes.ts";
|
|
642
641
|
|
|
@@ -686,8 +685,8 @@ export function AlbumEditForm(handle: Handle<{ album: Album }>) {
|
|
|
686
685
|
Let's update the edit page to render this new `AlbumEditForm` component:
|
|
687
686
|
|
|
688
687
|
```tsx filename=app/actions/albums/edit/page.tsx lines=[4,16]
|
|
689
|
-
import type { Handle } from "remix/
|
|
690
|
-
import { css } from "remix/
|
|
688
|
+
import type { Handle } from "remix/component";
|
|
689
|
+
import { css } from "remix/component";
|
|
691
690
|
|
|
692
691
|
import { AlbumEditForm } from "./public/album-edit-form.tsx";
|
|
693
692
|
import { Document } from "../../document.tsx";
|
|
@@ -714,8 +713,8 @@ Everything should look like it did before.
|
|
|
714
713
|
Next mark the form as a client entry. [`import.meta.url`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/import.meta) tells our asset server which source file should be turned into a browser-loadable module:
|
|
715
714
|
|
|
716
715
|
```tsx filename=app/actions/albums/edit/public/album-edit-form.tsx lines=[1,13-15,18]
|
|
717
|
-
import { clientEntry, css } from "remix/
|
|
718
|
-
import type { Handle } from "remix/
|
|
716
|
+
import { clientEntry, css } from "remix/component";
|
|
717
|
+
import type { Handle } from "remix/component";
|
|
719
718
|
|
|
720
719
|
import { routes } from "../../../../routes.ts";
|
|
721
720
|
|
|
@@ -753,11 +752,11 @@ export const AlbumEditForm = clientEntry(
|
|
|
753
752
|
);
|
|
754
753
|
```
|
|
755
754
|
|
|
756
|
-
When the form submits, we flip the `pending` variable from `false` to `true` and call `handle.update()`. `handle.update()` tells
|
|
755
|
+
When the form submits, we flip the `pending` variable from `false` to `true` and call `handle.update()`. `handle.update()` tells the component runtime to render this component again with the new local state. To listen for the submit, we add an event listener via the `on` helper and pass an array into the `mix` prop.
|
|
757
756
|
|
|
758
757
|
```tsx filename=app/actions/albums/edit/public/album-edit-form.tsx lines=[1,25,27-31,34-36]
|
|
759
|
-
import { clientEntry, css, on } from "remix/
|
|
760
|
-
import type { Handle } from "remix/
|
|
758
|
+
import { clientEntry, css, on } from "remix/component";
|
|
759
|
+
import type { Handle } from "remix/component";
|
|
761
760
|
|
|
762
761
|
import { routes } from "../../../../routes.ts";
|
|
763
762
|
|
|
@@ -46,7 +46,7 @@ Path variables are one part of Remix's route pattern syntax. Patterns can also i
|
|
|
46
46
|
// matches /docs/v2/guides/routing/route-maps.html?preview=1
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
You do not need to memorize Remix's route pattern syntax to follow this guide. The [`route-pattern` overview](
|
|
49
|
+
You do not need to memorize Remix's route pattern syntax to follow this guide. The [`route-pattern` overview](../src/route-pattern/README.md) covers the full grammar and the lower-level `remix/route-pattern/href` and `remix/route-pattern/match` APIs.
|
|
50
50
|
|
|
51
51
|
Finally, the `edit` branch has two leaves at the same URL: `index` handles `GET` and `action` handles `POST`.
|
|
52
52
|
|
|
@@ -148,7 +148,7 @@ export const routes = route({
|
|
|
148
148
|
// routes.albums.create -> POST /albums
|
|
149
149
|
```
|
|
150
150
|
|
|
151
|
-
These helpers produce ordinary route maps and leaves, so you can nest them with hand-written definitions. Pass a map to `createController(...)`, then register it with `router.map(...)` just as you would a hand-written map. The [`remix/router` overview](
|
|
151
|
+
These helpers produce ordinary route maps and leaves, so you can nest them with hand-written definitions. Pass a map to `createController(...)`, then register it with `router.map(...)` just as you would a hand-written map. The [`remix/router` overview](../src/fetch-router/README.md) covers the full route builder API.
|
|
152
152
|
|
|
153
153
|
## Controllers and actions
|
|
154
154
|
|
|
@@ -226,7 +226,7 @@ return context.render(<AlbumPage album={album} />);
|
|
|
226
226
|
|
|
227
227
|
The result is still an ordinary Web `Response`. An action can render a page, return text or JSON, redirect the browser, send a file, or return an error response.
|
|
228
228
|
|
|
229
|
-
Expected outcomes such as invalid input, conflicts, and missing records should also return a `Response` with the appropriate status. Reserve thrown errors for unexpected failures. If an action or middleware throws, `router.fetch(...)` rejects so the server boundary can log the error and return a `500` response. The [Errors and
|
|
229
|
+
Expected outcomes such as invalid input, conflicts, and missing records should also return a `Response` with the appropriate status. Reserve thrown errors for unexpected failures. If an action or middleware throws, `router.fetch(...)` rejects so the server boundary can log the error and return a `500` response. The [Errors and Cancellation](/errors-and-cancellation/) chapter covers that path in detail.
|
|
230
230
|
|
|
231
231
|
A text response can be as simple as:
|
|
232
232
|
|
|
@@ -245,7 +245,7 @@ import { routes } from "../../../routes.ts";
|
|
|
245
245
|
return redirect(routes.albums.show.href({ albumId: context.params.albumId }), 303);
|
|
246
246
|
```
|
|
247
247
|
|
|
248
|
-
For HTML outside the Remix
|
|
248
|
+
For HTML outside the Remix component render pipeline, the `html` template tag escapes interpolated values and `createHtmlResponse(...)` sets the HTML content type and adds a doctype:
|
|
249
249
|
|
|
250
250
|
```ts
|
|
251
251
|
import { html } from "remix/html-template";
|
|
@@ -50,19 +50,7 @@ import { router } from "./app/router.ts";
|
|
|
50
50
|
|
|
51
51
|
const port = process.env.PORT ? Number.parseInt(process.env.PORT, 10) : 44100;
|
|
52
52
|
|
|
53
|
-
const server = http.createServer(
|
|
54
|
-
createRequestListener(async (request) => {
|
|
55
|
-
try {
|
|
56
|
-
return await router.fetch(request);
|
|
57
|
-
} catch (error) {
|
|
58
|
-
if (!(request.signal.aborted && error === request.signal.reason)) {
|
|
59
|
-
console.error(error);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
return new Response("Internal Server Error", { status: 500 });
|
|
63
|
-
}
|
|
64
|
-
}),
|
|
65
|
-
);
|
|
53
|
+
const server = http.createServer(createRequestListener(router.fetch));
|
|
66
54
|
|
|
67
55
|
server.listen(port, () => {
|
|
68
56
|
console.log(`Server listening on http://localhost:${port}`);
|
|
@@ -83,7 +71,7 @@ Keep that boundary narrow. Code that only needs a URL, headers, cookies, a body,
|
|
|
83
71
|
- passes the request to your Fetch handler; and
|
|
84
72
|
- writes the returned response status, headers, and streamed body through Node.
|
|
85
73
|
|
|
86
|
-
The same listener works with `node:http`, `node:https`, and Node's HTTP/2 compatibility API.
|
|
74
|
+
The same listener works with `node:http`, `node:https`, and Node's HTTP/2 compatibility API. `createRequestListener(...)` logs errors and returns a generic `500` response by default.
|
|
87
75
|
|
|
88
76
|
The listener accepts a few options when the server boundary needs more information:
|
|
89
77
|
|
|
@@ -97,7 +85,7 @@ The listener accepts a few options when the server boundary needs more informati
|
|
|
97
85
|
For example, a Node server behind a trusted reverse proxy can let the listener recover the public protocol and host:
|
|
98
86
|
|
|
99
87
|
```ts filename=server.ts
|
|
100
|
-
const requestListener = createRequestListener(
|
|
88
|
+
const requestListener = createRequestListener(router.fetch, {
|
|
101
89
|
trustProxy: true,
|
|
102
90
|
onError(error) {
|
|
103
91
|
console.error(error);
|
|
@@ -143,9 +131,7 @@ Deno uses the handler in `Deno.serve(...)`:
|
|
|
143
131
|
```ts filename=server.ts
|
|
144
132
|
import { router } from "./app/router.ts";
|
|
145
133
|
|
|
146
|
-
Deno.serve({ port: 44100 },
|
|
147
|
-
return router.fetch(request);
|
|
148
|
-
});
|
|
134
|
+
Deno.serve({ port: 44100 }, router.fetch);
|
|
149
135
|
```
|
|
150
136
|
|
|
151
137
|
A Cloudflare Worker exports an object with a `fetch` method:
|
|
@@ -233,7 +219,7 @@ export const router = createRouter({
|
|
|
233
219
|
|
|
234
220
|
export type AppContext = RouterContext<typeof router>;
|
|
235
221
|
|
|
236
|
-
declare module "remix
|
|
222
|
+
declare module "remix" {
|
|
237
223
|
interface RouterTypes {
|
|
238
224
|
context: AppContext;
|
|
239
225
|
}
|
|
@@ -268,7 +254,7 @@ The default app starts with static-file and render middleware. Add the others wh
|
|
|
268
254
|
| Middleware | Import | What it does | Placement |
|
|
269
255
|
| ------------------ | ---------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
|
|
270
256
|
| `formData()` | `remix/middleware/form-data` | Parses URL-encoded and multipart bodies once, then provides `context.formData`. Non-form requests receive empty `FormData`. | Before `methodOverride()`, CSRF form-field checks, or actions that read parsed form data. |
|
|
271
|
-
| `render()` | `remix/middleware/render` | Installs the standard Remix
|
|
257
|
+
| `render()` | `remix/middleware/render` | Installs the standard Remix component `context.render(...)` function. | After middleware that may answer without rendering. |
|
|
272
258
|
| `staticFiles()` | `remix/middleware/static` | Serves `GET` and `HEAD` requests from a directory, with conditional and range request support. | Early, before request enrichment that static files do not need. |
|
|
273
259
|
| `compression()` | `remix/middleware/compression` | Negotiates Brotli, gzip, or deflate for suitable downstream responses. | Before every response it should wrap, including `staticFiles()` when static text is compressed. |
|
|
274
260
|
| `logger()` | `remix/middleware/logger` | Logs the request and downstream response and provides `context.logger(...)`. | Usually first so early responses and `404`s are logged. |
|