@remix-run/cli 0.3.0 → 0.3.1

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.
@@ -39,5 +39,5 @@ function formatHeading(title, target) {
39
39
  return boldLightBlue(title, target);
40
40
  }
41
41
  function highlightSyntax(text, target) {
42
- return text.replace(/(--[A-Za-z0-9-]+|-[A-Za-z]|\[[A-Za-z][A-Za-z0-9-]*\]|<[^>\n]+>)/g, (token) => lightYellow(token, target));
42
+ return text.replace(/(?<![^\s[,|])(--[A-Za-z0-9-]+|-[A-Za-z])(?=$|[\s,\]|])|\[[A-Za-z][A-Za-z0-9-]*\]|<[^>\n]+>/g, (token) => lightYellow(token, target));
43
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@remix-run/cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Command-line interface for Remix",
5
5
  "author": "Michael Jackson <mjijackson@gmail.com>",
6
6
  "license": "MIT",
@@ -31,14 +31,14 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "semver": "^7.7.4",
34
- "@remix-run/test": "^0.4.0",
35
- "@remix-run/terminal": "^0.1.0"
34
+ "@remix-run/terminal": "^0.1.1",
35
+ "@remix-run/test": "^0.4.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/node": "^24.6.0",
39
39
  "@types/semver": "^7.5.8",
40
40
  "@typescript/native-preview": "7.0.0-dev.20251125.1",
41
- "@remix-run/assert": "^0.2.0"
41
+ "@remix-run/assert": "^0.2.1"
42
42
  },
43
43
  "keywords": [
44
44
  "remix",
@@ -82,7 +82,8 @@ function formatHeading(title: string, target: NodeJS.WriteStream): string {
82
82
  }
83
83
 
84
84
  function highlightSyntax(text: string, target: NodeJS.WriteStream): string {
85
- return text.replace(/(--[A-Za-z0-9-]+|-[A-Za-z]|\[[A-Za-z][A-Za-z0-9-]*\]|<[^>\n]+>)/g, (token) =>
86
- lightYellow(token, target),
85
+ return text.replace(
86
+ /(?<![^\s[,|])(--[A-Za-z0-9-]+|-[A-Za-z])(?=$|[\s,\]|])|\[[A-Za-z][A-Za-z0-9-]*\]|<[^>\n]+>/g,
87
+ (token) => lightYellow(token, target),
87
88
  )
88
89
  }
@@ -34,7 +34,7 @@ A Remix app has four main pieces:
34
34
  - **Middleware** composes request lifecycle behavior and populates typed context via
35
35
  `context.set(Key, value)`.
36
36
  - **Components** render UI with `remix/ui`. This is not React. A component receives a
37
- `handle`, reads current props from `handle.props`, and returns a render function.
37
+ `handle`, reads current props from `handle.props`, and returns a zero-argument render function.
38
38
 
39
39
  ## When To Use This Skill
40
40
 
@@ -198,9 +198,9 @@ When code could live in multiple places:
198
198
  need the harness
199
199
  - Outside actions and controllers, only use `getContext()` when `asyncContext()` is in the
200
200
  middleware stack
201
- - Remix Component is not React: read props from `handle.props`, keep state in setup-scope
202
- variables, call `handle.update()` explicitly, and do DOM-sensitive work in event handlers or
203
- `queueTask(...)`, not in render
201
+ - Remix Component is not React: write `function Name(handle: Handle<Props>) { return () => ... }`,
202
+ read props from `handle.props`, keep state in setup-scope variables, call `handle.update()`
203
+ explicitly, and do DOM-sensitive work in event handlers or `queueTask(...)`, not in render
204
204
  - Prefer host-element mixins via `mix={mixin(...)}` for behavior and styling instead of inventing
205
205
  custom host prop conventions. Use `mix={[...]}` only when composing multiple mixins
206
206
  - Hydrated `clientEntry(...)` props must be serializable. Do not pass functions, class instances, or
@@ -282,8 +282,6 @@ what it exports. Open the linked reference file when you need full examples.
282
282
  `form`, `resources` when defining `app/routes.ts`
283
283
  - `remix/node-fetch-server` — default Node adapter for new apps. Use `createRequestListener` with
284
284
  `node:http`, `node:https`, or `node:http2` in `server.ts` when booting the template-style app
285
- - `remix/node-serve` — managed high-performance Node server. Use `serve` when you want Remix to
286
- manage the server lifecycle, TLS options, or uWebSockets.js setup around a Fetch handler
287
285
  - `remix/assets` — browser asset server. Use for `createAssetServer` when serving compiled
288
286
  scripts and styles, getting public hrefs, and emitting preloads. Configure a `basePath`, and
289
287
  keep `fileMap` URL patterns relative to it. Shared compiler options such as `target`,
@@ -20,7 +20,10 @@ For host-element behavior (event handlers, styles, refs, animations), see
20
20
  A component has two phases:
21
21
 
22
22
  1. **Setup phase** — runs once when the component is created
23
- 2. **Render phase** — returned function runs on initial render and every update
23
+ 2. **Render phase** — returned zero-argument function runs on initial render and every update
24
+
25
+ The component shape is `function Component(handle: Handle<Props>) { return () => ... }`. Props are
26
+ available as `handle.props` in setup scope and are updated before every render.
24
27
 
25
28
  ```tsx
26
29
  import { on, type Handle } from 'remix/ui'
@@ -229,5 +229,4 @@ runtime behavior such as host/protocol handling, TLS, HTTP/2, WebSockets, deploy
229
229
  test-only server setup.
230
230
 
231
231
  Use `remix/node-fetch-server` when you want to keep owning a standard Node `http`, `https`, or
232
- `http2` server directly. Use `remix/node-serve` and `serve()` when you want a managed
233
- high-performance server with `server.ready`, TLS options, or uWebSockets.js setup.
232
+ `http2` server directly.
@@ -9,9 +9,10 @@ import { assetServer } from '../assets.ts'
9
9
 
10
10
  export function render() {
11
11
  return renderWith(
12
- () =>
12
+ ({ request }) =>
13
13
  function render(node: RemixNode, init?: ResponseInit) {
14
14
  let stream = renderToStream(node, {
15
+ signal: request.signal,
15
16
  // Server rendering turns client entries into browser module URLs.
16
17
  async resolveClientEntry(entryId, component) {
17
18
  if (!entryId.startsWith('file://')) {
@@ -10,7 +10,9 @@ const server = http.createServer(
10
10
  try {
11
11
  return await router.fetch(request)
12
12
  } catch (error) {
13
- console.error(error)
13
+ if (!(request.signal.aborted && error === request.signal.reason)) {
14
+ console.error(error)
15
+ }
14
16
  return new Response('Internal Server Error', { status: 500 })
15
17
  }
16
18
  }),