Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor!(docs,dev,server-runtime): remove deprecated REMIX_DEV_HTTP_… #6963

Merged
merged 1 commit into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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