Skip to content

feat: migrate from connect to connect-next#144

Merged
chenjiahan merged 1 commit into
mainfrom
connect_next_0309
Mar 9, 2026
Merged

feat: migrate from connect to connect-next#144
chenjiahan merged 1 commit into
mainfrom
connect_next_0309

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

Replace unmaintained connect package with connect-next, an actively maintained fork with modern dependencies.

Update imports, types, and tests accordingly. This provides better long-term maintenance and compatibility with newer Node.js versions.

Copilot AI review requested due to automatic review settings March 9, 2026 13:07
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 updates the project's underlying middleware framework from the unmaintained connect package to its actively developed fork, connect-next. This change enhances the project's stability and future compatibility by leveraging a more modern and supported dependency. The migration involved updating package dependencies, modifying import statements, adjusting type definitions, and updating relevant documentation and test snapshots to reflect the new integration.

Highlights

  • Dependency Migration: Migrated the project's core connect dependency to connect-next, an actively maintained fork, to ensure better long-term maintenance and compatibility with modern Node.js versions.
  • Documentation Update: Updated the migration guide to reflect that the default app now utilizes connect-next instead of the unmaintained connect package.
  • Codebase Refactoring: Adjusted imports, type definitions, and test configurations across the codebase to align with the new connect-next dependency.

🧠 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
  • docs/migrate-v1-to-v2.md
    • Updated the heading 'Default app now uses connect' to 'Default app now uses connect-next'.
    • Modified the descriptive text to highlight connect-next as an actively maintained fork with fewer dependencies.
  • package.json
    • Removed @types/connect from dev dependencies.
    • Removed connect from dependencies.
    • Added connect-next with version ^4.0.0 to dependencies.
  • pnpm-lock.yaml
    • Removed @types/connect entry from the lockfile.
    • Removed connect entry and its associated transitive dependencies (debug, finalhandler, parseurl, utils-merge).
    • Added connect-next entry with its updated dependencies (debug, finalhandler, parseurl).
    • Removed outdated encodeurl@1.0.2, finalhandler@1.1.2, on-finished@2.3.0, and utils-merge@1.0.1 entries, reflecting dependency tree changes.
  • rslib.config.ts
    • Removed connect from the externals configuration in the build setup.
  • src/server.ts
    • Refactored getConnect to dynamically import connect-next using await import('connect-next').
    • Updated the invocation of getConnect to (await getConnect())() to handle the asynchronous import.
  • src/types.ts
    • Changed the import source for ConnectApplication and ConnectIncomingMessage from connect to connect-next.
  • tests/e2e/snapshots/app.test.js.snap
    • Updated all snapshot test descriptions to reflect the change from 'connect (async)' to 'connect-next (async)' and 'connect' to 'connect-next'.
  • tests/e2e/app.test.js
    • Introduced a createConnectNextApp helper function for dynamically importing and initializing connect-next.
    • Replaced direct require('connect')() calls with createConnectNextApp or async () => createConnectNextApp() in the apps test array.
Activity
  • No specific human activity (comments, reviews) recorded for this pull request yet.
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.

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

Copy link
Copy Markdown
Contributor

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 migrates the project from the unmaintained connect package to its actively maintained fork, connect-next. The changes are well-contained and correctly update dependencies, type definitions, documentation, and tests. This is a valuable update for the project's long-term maintainability. I have one minor suggestion regarding the build configuration to ensure connect-next is handled consistently with other external dependencies.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Migrates @rspack/dev-server from the unmaintained connect package to connect-next for the default middleware app, updating runtime loading, exported types, and e2e test coverage to match.

Changes:

  • Replace connect with connect-next in the dev server default app creation and in exported public types.
  • Update e2e app-matrix tests + snapshots to cover connect-next.
  • Update docs and dependency/lockfile entries to remove connect / @types/connect and add connect-next.

Reviewed changes

Copilot reviewed 7 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/e2e/app.test.js Switch test app variants from connect to connect-next via dynamic import factory.
tests/e2e/snapshots/app.test.js.snap Snapshot key updates reflecting connect-next naming.
src/types.ts Public type imports now come from connect-next.
src/server.ts Default app loader now dynamically imports connect-next and awaits it during setup.
rslib.config.ts Removes connect from externals (needs connect-next decision).
package.json Swap connect for connect-next dependency; drop @types/connect.
pnpm-lock.yaml Lock updates for dependency swap.
docs/migrate-v1-to-v2.md Migration guide updated to reference connect-next as default app.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

rslib.config.ts:16

  • connect was removed from the externals list, but connect-next is now a runtime dependency loaded in src/server.ts. If the intent is to keep connect-next as an external runtime dependency (same as the previous connect behavior), add a corresponding connect-next: 'commonjs connect-next' entry here; otherwise the server bundle may start inlining it inconsistently with prior releases.
      output: {
        externals: {
          'connect-history-api-fallback':
            'commonjs connect-history-api-fallback',
          'webpack-dev-middleware': 'commonjs webpack-dev-middleware',
          'http-proxy-middleware': 'commonjs http-proxy-middleware',
          'serve-static': 'commonjs serve-static',
          'serve-index': 'commonjs serve-index',

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/server.ts
Comment thread tests/e2e/app.test.js
@chenjiahan chenjiahan merged commit b3a9c58 into main Mar 9, 2026
7 checks passed
@chenjiahan chenjiahan deleted the connect_next_0309 branch March 9, 2026 13:18
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.

2 participants