Skip to content

Commit

Permalink
Merge branch 'dev' into typescript-eslint-require-await
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaKGoldberg committed Sep 18, 2023
2 parents 7f4168f + fccadba commit 1e75f10
Show file tree
Hide file tree
Showing 53 changed files with 1,233 additions and 1,136 deletions.
5 changes: 5 additions & 0 deletions .changeset/add-uimatch-handle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/react": patch
---

Add second generic to `UIMatch` for `handle` field
5 changes: 5 additions & 0 deletions .changeset/bump-web-fetch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/node": patch
---

Update to latest version of `@remix-run/web-fetch`
7 changes: 7 additions & 0 deletions .changeset/four-spies-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@remix-run/serve": patch
---

Fix error caused by partially written server build

Previously, it was possible to trigger a reimport of the app server code before the new server build had completely been written. Reimporting the partially written server build caused issues related to `build.assets` being undefined and crashing when reading `build.assets.version`.
5 changes: 5 additions & 0 deletions .changeset/get-dependencies-from-esm-without-main.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/dev": patch
---

Update `getDependenciesToBundle` to handle ESM packages without main exports. Note that these packages must expose `package.json` in their `exports` field so that their path can be resolved.
5 changes: 5 additions & 0 deletions .changeset/node-web-crypto.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/node": patch
---

Switch from `crypto.randomBytes` to `crypto.webcrypto.getRandomValues` for file session storage ID generation
5 changes: 5 additions & 0 deletions .changeset/use-native-blob.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@remix-run/node": patch
---

Use native `Blob` cleass instead of polyfill
7 changes: 7 additions & 0 deletions .changeset/wild-steaks-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@remix-run/dev": patch
---

Fix server builds where serverBuildPath extension is `.cjs`.

Fix a bug that caused the server build file to be emitted into the assets directory if the value of `serverBuildPath` ended in `.cjs`.
19 changes: 4 additions & 15 deletions .github/workflows/deployments.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ on:
TEST_FLY_TOKEN:
required: true

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
arc_deploy:
name: Architect Deploy
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

Expand Down Expand Up @@ -65,9 +66,6 @@ jobs:
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

Expand Down Expand Up @@ -103,9 +101,6 @@ jobs:
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

Expand Down Expand Up @@ -142,9 +137,6 @@ jobs:
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

Expand Down Expand Up @@ -184,9 +176,6 @@ jobs:
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,16 @@ on:
- main
- dev

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
format:
if: github.repository == 'remix-run/remix'
runs-on: ubuntu-latest

steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@ on:
- dev
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
name: ⬣ Lint
runs-on: ubuntu-latest
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
schedule:
- cron: "0 7 * * *" # every day at 12AM PST

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
CI: true

Expand All @@ -22,9 +26,6 @@ jobs:
# allows this to be used in the `comment` job below - will be undefined if there's no release necessary
NEXT_VERSION: ${{ steps.version.outputs.NEXT_VERSION }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
Expand Down
6 changes: 0 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ jobs:
published_packages: ${{ steps.changesets.outputs.publishedPackages }}
published: ${{ steps.changesets.outputs.published }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -72,9 +69,6 @@ jobs:
outputs:
package_version: ${{ steps.find_package_version.outputs.package_version }}
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⬇️ Checkout repo
uses: actions/checkout@v4

Expand Down
19 changes: 4 additions & 15 deletions .github/workflows/stacks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ on:
required: true
type: string

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
setup:
name: Remix Stacks Test
Expand All @@ -23,9 +27,6 @@ jobs:
- repo: "remix-run/grunge-stack"
name: "grunge"
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: ⎔ Setup node
uses: actions/setup-node@v3
with:
Expand Down Expand Up @@ -80,9 +81,6 @@ jobs:
- repo: "remix-run/grunge-stack"
name: "grunge"
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: 🗄️ Restore ${{ matrix.stack.name }}
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -123,9 +121,6 @@ jobs:
- repo: "remix-run/grunge-stack"
name: "grunge"
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: 🗄️ Restore ${{ matrix.stack.name }}
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -166,9 +161,6 @@ jobs:
- repo: "remix-run/grunge-stack"
name: "grunge"
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: 🗄️ Restore ${{ matrix.stack.name }}
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -212,9 +204,6 @@ jobs:
name: "grunge"
cypress: "npm run dev"
steps:
- name: 🛑 Cancel Previous Runs
uses: styfle/[email protected]

- name: 🗄️ Restore ${{ matrix.stack.name }}
uses: actions/download-artifact@v3
with:
Expand Down
8 changes: 6 additions & 2 deletions docs/file-conventions/entry.server.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,15 @@ export function handleError(
error: unknown,
{ request, params, context }: DataFunctionArgs
) {
sendErrorToErrorReportingService(error);
console.error(formatErrorForJsonLogging(error));
if (!request.signal.aborted) {
sendErrorToErrorReportingService(error);
console.error(formatErrorForJsonLogging(error));
}
}
```

_Note that you generally want to avoid logging when the request was aborted, since Remix's cancellation and race-condition handling can cause a lot of requests to be aborted._

### Streaming Rendering Errors

When you are streaming your HTML responses via [`renderToPipeableStream`][rendertopipeablestream] or [`renderToReadableStream`][rendertoreadablestream], your own `handleError` implementation will only handle errors encountered during the initial shell render. If you encounter a rendering error during subsequent streamed rendering you will need handle these errors manually since the Remix server has already sent the Response by that point.
Expand Down
35 changes: 35 additions & 0 deletions integration/compiler-mjs-cjs-output-test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { test, expect } from "@playwright/test";
import * as fs from "node:fs";
import * as path from "node:path";

import { createFixtureProject, js } from "./helpers/create-fixture.js";

test.describe("", () => {
for (let [serverModuleExt, serverModuleFormat, exportStatement] of [
["mjs", "esm", "export {"],
["cjs", "cjs", "module.exports ="],
]) {
test(`can write .${serverModuleExt} server output module`, async () => {
let projectDir = await createFixtureProject({
files: {
// Ensure the config is valid ESM
"remix.config.js": js`
export default {
serverModuleFormat: "${serverModuleFormat}",
serverBuildPath: "build/index.${serverModuleExt}",
};
`,
},
});

let buildPath = path.resolve(
projectDir,
"build",
`index.${serverModuleExt}`
);
expect(fs.existsSync(buildPath), "doesn't exist").toBe(true);
let contents = fs.readFileSync(buildPath, "utf8");
expect(contents, "no export statement").toContain(exportStatement);
});
}
});
69 changes: 0 additions & 69 deletions integration/compiler-mjs-output-test.ts

This file was deleted.

Loading

0 comments on commit 1e75f10

Please sign in to comment.