Skip to content

refactor: update @mjackson/* packages to @remix-run/* #14070

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions decisions/0014-context-middleware.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ We've done a lot of work since then to get us to a place where we could ship a m

- Shipped [Single Fetch][single-fetch]
- Shipped [`dataStrategy`][data-strategy] for DIY middleware in React Router SPAs
- Iterated on middleware/context APIs in the [Remix the Web][remix-the-web] project
- Iterated on middleware/context APIs in the [Remix 3][remix-3] project
- Developed a non-invasive type-safe + composable [context][async-provider] API

## Decision
Expand Down Expand Up @@ -276,5 +276,5 @@ If `clientLoaders` do call `serverLoaders` it gets trickier since they make indi
[client-context]: https://github.com/remix-run/react-router/discussions/9856
[single-fetch]: https://remix.run/docs/en/main/guides/single-fetch
[data-strategy]: https://reactrouter.com/v6/routers/create-browser-router#optsdatastrategy
[remix-the-web]: https://github.com/mjackson/remix-the-web
[remix-3]: https://github.com/remix-run/remix/tree/v3
[async-provider]: https://github.com/ryanflorence/async-provider
21 changes: 10 additions & 11 deletions docs/how-to/file-uploads.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ title: File Uploads
<br/>
<br/>

Handle file uploads in your React Router applications. This guide uses some packages from the [Remix The Web][remix-the-web] project to make file uploads easier.

_Thank you to David Adams for [writing an original guide](https://programmingarehard.com/2024/09/06/remix-file-uploads-updated.html/) on which this doc is based. You can refer to it for even more examples._

## Basic File Upload
Expand Down Expand Up @@ -38,7 +36,7 @@ export default [
`form-data-parser` is a wrapper around `request.formData()` that provides streaming support for handling file uploads.

```shellscript
npm i @mjackson/form-data-parser
npm i @remix-run/form-data-parser
```

[See the `form-data-parser` docs for more information][form-data-parser]
Expand All @@ -57,11 +55,13 @@ You must set the form's `enctype` to `multipart/form-data` for file uploads to w
import {
type FileUpload,
parseFormData,
} from "@mjackson/form-data-parser";
} from "@remix-run/form-data-parser";

import type { Route } from "./+types/user-profile";

export async function action({
request,
}: ActionFunctionArgs) {
}: Route.ActionArgs) {
const uploadHandler = async (fileUpload: FileUpload) => {
if (fileUpload.fieldName === "avatar") {
// process the upload and return a File
Expand Down Expand Up @@ -93,7 +93,7 @@ export default function Component() {
`file-storage` is a key/value interface for storing [File objects][file] in JavaScript. Similar to how `localStorage` allows you to store key/value pairs of strings in the browser, file-storage allows you to store key/value pairs of files on the server.

```shellscript
npm i @mjackson/file-storage
npm i @remix-run/file-storage
```

[See the `file-storage` docs for more information][file-storage]
Expand All @@ -103,7 +103,7 @@ npm i @mjackson/file-storage
Create a file that exports a `LocalFileStorage` instance to be used by different routes.

```ts filename=avatar-storage.server.ts
import { LocalFileStorage } from "@mjackson/file-storage/local";
import { LocalFileStorage } from "@remix-run/file-storage/local";

export const fileStorage = new LocalFileStorage(
"./uploads/avatars",
Expand All @@ -122,7 +122,7 @@ Update the form's `action` to store files in the `fileStorage` instance.
import {
type FileUpload,
parseFormData,
} from "@mjackson/form-data-parser";
} from "@remix-run/form-data-parser";
import {
fileStorage,
getStorageKey,
Expand Down Expand Up @@ -212,8 +212,7 @@ export async function loader({ params }: Route.LoaderArgs) {
}
```

[remix-the-web]: https://github.com/mjackson/remix-the-web
[form-data-parser]: https://github.com/mjackson/remix-the-web/tree/main/packages/form-data-parser
[file-storage]: https://github.com/mjackson/remix-the-web/tree/main/packages/file-storage
[form-data-parser]: https://www.npmjs.com/package/@remix-run/form-data-parser
[file-storage]: https://www.npmjs.com/package/@remix-run/file-storage
[file]: https://developer.mozilla.org/en-US/docs/Web/API/File
[resource-route]: ../how-to/resource-routes
8 changes: 4 additions & 4 deletions docs/how-to/react-server-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ The following naming conventions have been chosen for familiarity and simplicity

See the relevant bundler documentation below for specific code examples for each of the following entry points.

These examples all use [express][express] and [@mjackson/node-fetch-server][node-fetch-server] for the server and request handling.
These examples all use [express][express] and [@remix-run/node-fetch-server][node-fetch-server] for the server and request handling.

**Routes**

Expand Down Expand Up @@ -332,7 +332,7 @@ To configure Parcel, add the following to your `package.json`:
"source": "src/entry.rsc.tsx",
"scopeHoist": false,
"includeNodeModules": {
"@mjackson/node-fetch-server": false,
"@remix-run/node-fetch-server": false,
"compression": false,
"express": false
}
Expand Down Expand Up @@ -425,7 +425,7 @@ export async function generateHTML(
The following is a simplified example of a Parcel RSC Server.

```tsx filename=src/entry.rsc.tsx
import { createRequestListener } from "@mjackson/node-fetch-server";
import { createRequestListener } from "@remix-run/node-fetch-server";
import express from "express";
import { unstable_matchRSCServerRequest as matchRSCServerRequest } from "react-router";
import {
Expand Down Expand Up @@ -781,6 +781,6 @@ createFromReadableStream<RSCServerPayload>(
[get-rsc-stream]: ../api/rsc/getRSCStream
[rsc-hydrated-router]: ../api/rsc/RSCHydratedRouter
[express]: https://expressjs.com/
[node-fetch-server]: https://github.com/mjackson/remix-the-web/tree/main/packages/node-fetch-server
[node-fetch-server]: https://www.npmjs.com/package/@remix-run/node-fetch-server
[parcel-rsc-template]: https://github.com/remix-run/react-router-templates/tree/main/unstable_rsc-parcel
[vite-rsc-template]: https://github.com/remix-run/react-router-templates/tree/main/unstable_rsc-vite
2 changes: 1 addition & 1 deletion integration/helpers/rsc-parcel-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"typescript": "^5.1.6"
},
"dependencies": {
"@mjackson/node-fetch-server": "0.6.1",
"@parcel/runtime-rsc": "2.15.0",
"@remix-run/node-fetch-server": "^0.8.0",
"cross-env": "^7.0.3",
"express": "^4.21.2",
"react": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/rsc-parcel-framework/start.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { createRequestListener } = require("@mjackson/node-fetch-server");
const { createRequestListener } = require("@remix-run/node-fetch-server");
const express = require("express");
const reactRouterRequestHandler =
require("./build/server/index.js").requestHandler;
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/rsc-parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"url": "^0.11.0"
},
"dependencies": {
"@mjackson/node-fetch-server": "0.6.1",
"@parcel/runtime-rsc": "2.15.0",
"@remix-run/node-fetch-server": "^0.8.0",
"cross-env": "^7.0.3",
"express": "^4.21.2",
"react": "^19.1.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/rsc-parcel/src/server.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parseArgs } from "node:util";
import { createRequestListener } from "@mjackson/node-fetch-server";
import { createRequestListener } from "@remix-run/node-fetch-server";
import express from "express";
import { unstable_matchRSCServerRequest as matchRSCServerRequest } from "react-router";
import {
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/rsc-vite-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"vite-tsconfig-paths": "^4.2.1"
},
"dependencies": {
"@mjackson/node-fetch-server": "0.6.1",
"@remix-run/node-fetch-server": "^0.8.0",
"compression": "^1.8.0",
"express": "^4.21.2",
"react": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/rsc-vite-framework/start.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createRequestListener } from "@mjackson/node-fetch-server";
import { createRequestListener } from "@remix-run/node-fetch-server";
import express from "express";
import reactRouterRequestHandler from "./build/server/index.js";

Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/rsc-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"vite": "^6.2.0"
},
"dependencies": {
"@mjackson/node-fetch-server": "0.6.1",
"@remix-run/node-fetch-server": "^0.8.0",
"compression": "^1.8.0",
"cross-env": "^7.0.3",
"express": "^4.21.2",
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/rsc-vite/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parseArgs } from "node:util";
import { createRequestListener } from "@mjackson/node-fetch-server";
import { createRequestListener } from "@remix-run/node-fetch-server";
import compression from "compression";
import express from "express";

Expand Down
2 changes: 1 addition & 1 deletion packages/react-router-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
}
},
"dependencies": {
"@mjackson/node-fetch-server": "^0.2.0"
"@remix-run/node-fetch-server": "^0.8.0"
},
"devDependencies": {
"react-router": "workspace:*",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router-node/server.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import type { RequestListener } from "node:http";

import type { ClientAddress } from "@remix-run/node-fetch-server";
import { createRequestListener as createRequestListener_ } from "@remix-run/node-fetch-server";
import type {
AppLoadContext,
ServerBuild,
UNSAFE_MiddlewareEnabled,
unstable_RouterContextProvider,
} from "react-router";
import { createRequestHandler } from "react-router";
import type { ClientAddress } from "@mjackson/node-fetch-server";
import { createRequestListener as createRequestListener_ } from "@mjackson/node-fetch-server";

type MaybePromise<T> = T | Promise<T>;

Expand Down
2 changes: 1 addition & 1 deletion playground/rsc-parcel-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"parcel-config-react-router-experimental": "1.0.25"
},
"dependencies": {
"@mjackson/node-fetch-server": "0.6.1",
"@parcel/runtime-rsc": "2.15.0",
"@remix-run/node-fetch-server": "^0.8.0",
"express": "^4.21.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion playground/rsc-parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"url": "^0.11.0"
},
"dependencies": {
"@mjackson/node-fetch-server": "0.6.1",
"@parcel/runtime-rsc": "2.15.0",
"@remix-run/node-fetch-server": "^0.8.0",
"express": "^4.21.2",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
6 changes: 3 additions & 3 deletions playground/rsc-parcel/src/entry.ssr.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createRequestListener } from "@mjackson/node-fetch-server";
import { createRequestListener } from "@remix-run/node-fetch-server";
import express from "express";
// @ts-expect-error - no types
import { renderToReadableStream as renderHTMLToReadableStream } from "react-dom/server.edge" assert { env: "react-client" };
Expand Down Expand Up @@ -28,11 +28,11 @@ app.use(
bootstrapScriptContent: (
fetchServer as unknown as { bootstrapScript: string }
).bootstrapScript,
}
},
);
},
});
})
}),
);

const server = app.listen(3000);
Expand Down
2 changes: 1 addition & 1 deletion playground/rsc-vite-framework/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"vite": "^6.2.0"
},
"dependencies": {
"@mjackson/node-fetch-server": "0.6.1",
"@remix-run/node-fetch-server": "^0.8.0",
"compression": "^1.8.0",
"express": "^4.21.2",
"react": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion playground/rsc-vite-framework/start.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createRequestListener } from "@mjackson/node-fetch-server";
import { createRequestListener } from "@remix-run/node-fetch-server";
import express from "express";
import reactRouterRequestHandler from "./build/server/index.js";

Expand Down
2 changes: 1 addition & 1 deletion playground/rsc-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"vite": "^6.2.0"
},
"dependencies": {
"@mjackson/node-fetch-server": "0.6.1",
"@remix-run/node-fetch-server": "^0.8.0",
"compression": "^1.8.0",
"express": "^4.21.2",
"react": "^19.0.0",
Expand Down
2 changes: 1 addition & 1 deletion playground/rsc-vite/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parseArgs } from "node:util";
import { createRequestListener } from "@mjackson/node-fetch-server";
import { createRequestListener } from "@remix-run/node-fetch-server";
import compression from "compression";
import express from "express";

Expand Down
Loading
Loading