Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use @remix-run/node-fetch-server in dev server#33

Merged
ScriptedAlchemy merged 3 commits intomainfrom
fix/pr-28-use-remix-node-fetch-server
Feb 3, 2026
Merged

Use @remix-run/node-fetch-server in dev server#33
ScriptedAlchemy merged 3 commits intomainfrom
fix/pr-28-use-remix-node-fetch-server

Conversation

@ScriptedAlchemy
Copy link
Collaborator

@ScriptedAlchemy ScriptedAlchemy commented Feb 3, 2026

Implements the intent of #28 on top of current main by switching the internal dev-server middleware request listener to use @remix-run/node-fetch-server directly (instead of going through @react-router/node's wrapper).

Notes:

  • This reduces our direct usage of @mjackson/node-fetch-server, but React Router's @react-router/node still depends on it transitively as of v7.13.0.
  • pnpm test passes and pnpm build succeeds.

@gemini-code-assist
Copy link

Summary of Changes

Hello @ScriptedAlchemy, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the development server's request handling mechanism to leverage @remix-run/node-fetch-server directly. This change modernizes the middleware by moving away from a deprecated dependency, aligning with efforts to streamline the server architecture and improve maintainability. The core functionality of the dev server remains consistent, but its underlying implementation for request processing is updated for better future compatibility.

Highlights

  • Dev Server Middleware Update: The internal development server middleware has been updated to directly use @remix-run/node-fetch-server for its request listener, reducing reliance on the deprecated @mjackson/node-fetch-server package.
  • Dependency Management: The @remix-run/node-fetch-server package has been added as a new dependency, and the pnpm-lock.yaml file has been updated to reflect this change, along with adjustments to express sub-dependency versions for @react-router/express.
  • Request Handling Logic: The createDevServerMiddleware function now imports createRequestHandler from react-router and createRequestListener from @remix-run/node-fetch-server, using them together to process requests without an explicit loadContext.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • package.json
    • Added @remix-run/node-fetch-server as a new dependency.
    • Reordered @rstest/core and @rstest/coverage-istanbul within devDependencies.
  • pnpm-lock.yaml
    • Added a new entry for @remix-run/node-fetch-server.
    • Adjusted the express sub-dependency versions for @react-router/express in different dependency trees.
  • src/dev-server.ts
    • Modified the createDevServerMiddleware function to import createRequestHandler from react-router and createRequestListener from @remix-run/node-fetch-server.
    • Replaced the direct use of createRequestListener({ build }) with a new approach that wraps createRequestHandler(build) within createRequestListener.
    • Added comments explaining the rationale behind using the modern request listener and the handling of loadContext.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request successfully updates the dev server to use @remix-run/node-fetch-server, moving away from a deprecated package. The changes in src/dev-server.ts are well-reasoned. I've suggested a small improvement to make the dynamic imports more robust. Otherwise, the changes look good.

Comment on lines 40 to 43
const [{ createRequestHandler }, { createRequestListener }] = await Promise.all([
import('react-router'),
import('@remix-run/node-fetch-server'),
]);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This destructuring is a bit fragile as it relies on the order of modules in Promise.all. If someone accidentally reorders the imports, it could lead to a runtime error. A safer approach is to destructure in separate steps to make the code more robust and maintainable.

Suggested change
const [{ createRequestHandler }, { createRequestListener }] = await Promise.all([
import('react-router'),
import('@remix-run/node-fetch-server'),
]);
const [reactRouter, remixNodeFetchServer] = await Promise.all([
import('react-router'),
import('@remix-run/node-fetch-server'),
]);
const { createRequestHandler } = reactRouter;
const { createRequestListener } = remixNodeFetchServer;

@ScriptedAlchemy ScriptedAlchemy merged commit 4b933d0 into main Feb 3, 2026
4 checks passed
@ScriptedAlchemy ScriptedAlchemy deleted the fix/pr-28-use-remix-node-fetch-server branch February 3, 2026 01:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant