Skip to content

Commit

Permalink
refactor!(docs,dev,server-runtime): remove deprecated REMIX_DEV_HTTP_… (
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori authored Jul 26, 2023
1 parent 63b61e3 commit 7917c81
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .changeset/cuddly-rings-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
"@remix-run/dev": major
"@remix-run/server-runtime": major
---

Remove deprecated REMIX_DEV_HTTP_ORIGIN env var.

Use REMIX_DEV_ORIGIN instead.
2 changes: 1 addition & 1 deletion docs/other-api/dev-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ To use [Mock Service Worker][msw] in development, you'll need to:
1. Run MSW as part of your app server
2. Configure MSW to not mock internal "dev ready" messages to the Remix compiler

Make sure that you are setting up your mocks for your _app server_ within the `-c` flag so that the `REMIX_DEV_HTTP_ORIGIN` environment variable is available to your mocks.
Make sure that you are setting up your mocks for your _app server_ within the `-c` flag so that the `REMIX_DEV_ORIGIN` environment variable is available to your mocks.
For example, you can use `NODE_OPTIONS` to set Node's `--require` flag when running `remix-serve`:

```json filename=package.json
Expand Down
4 changes: 0 additions & 4 deletions packages/remix-dev/compiler/server/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,6 @@ const createEsbuildConfig = (
"process.env.REMIX_DEV_ORIGIN": JSON.stringify(
ctx.options.REMIX_DEV_ORIGIN ?? ""
),
// TODO: remove in v2
"process.env.REMIX_DEV_HTTP_ORIGIN": JSON.stringify(
ctx.options.REMIX_DEV_ORIGIN ?? ""
),
},
jsx: "automatic",
jsxDev: ctx.options.mode !== "production",
Expand Down
1 change: 0 additions & 1 deletion packages/remix-dev/devServer_unstable/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ export let serve = async (
PATH:
bin + (process.platform === "win32" ? ";" : ":") + process.env.PATH,
REMIX_DEV_ORIGIN: options.REMIX_DEV_ORIGIN.href,
REMIX_DEV_HTTP_ORIGIN: options.REMIX_DEV_ORIGIN.href, // TODO: remove in v2
FORCE_COLOR: process.env.NO_COLOR === undefined ? "1" : "0",
},
// https://github.com/sindresorhus/execa/issues/433
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-server-runtime/dev.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { ServerBuild } from "./build";

export async function broadcastDevReady(build: ServerBuild, origin?: string) {
origin ??= process.env.REMIX_DEV_HTTP_ORIGIN;
origin ??= process.env.REMIX_DEV_ORIGIN;
if (!origin) throw Error("Dev server origin not set");
let url = new URL(origin);
url.pathname = "ping";
Expand Down

0 comments on commit 7917c81

Please sign in to comment.