Skip to content

refactor: bundle http-proxy-middleware#180

Merged
chenjiahan merged 2 commits intomainfrom
neverland/feat-bundle-http-proxy-middleware
Apr 1, 2026
Merged

refactor: bundle http-proxy-middleware#180
chenjiahan merged 2 commits intomainfrom
neverland/feat-bundle-http-proxy-middleware

Conversation

@chenjiahan
Copy link
Copy Markdown
Member

@chenjiahan chenjiahan commented Apr 1, 2026

Summary

This PR bundles http-proxy-middleware into the server build instead of treating it as a runtime external. It also narrows the internal proxy middleware typing so the lazy-loaded middleware and websocket upgrade path stay compatible after bundling.

@chenjiahan chenjiahan changed the title refactor: Bundle HTTP proxy middleware refactor: bundle http-proxy-middleware Apr 1, 2026
@chenjiahan chenjiahan marked this pull request as ready for review April 1, 2026 08:35
Copilot AI review requested due to automatic review settings April 1, 2026 08:35
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the server build/package setup so http-proxy-middleware is bundled into the server output (rather than treated as a runtime external), while adjusting the internal proxy middleware typing to stay compatible with the lazy-loaded middleware and WebSocket upgrade handling.

Changes:

  • Bundle http-proxy-middleware by removing it from server externals and moving it from dependencies to devDependencies.
  • Switch proxy loading from require('http-proxy-middleware') to a lazy await import('http-proxy-middleware') to align with bundling/code-splitting.
  • Narrow internal proxy middleware types to connect-next’s NextHandleFunction and adjust related casts for the websocket-upgrade path.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/types.ts Stops importing/re-exporting http-proxy-middleware’s RequestHandler type from the shared internal types module.
src/server.ts Lazily imports http-proxy-middleware and updates internal proxy/websocket proxy typing to NextHandleFunction.
rslib.config.ts Removes http-proxy-middleware from the server bundle externals so it will be bundled.
package.json Moves http-proxy-middleware from dependencies to devDependencies to reflect bundling.
pnpm-lock.yaml Lockfile update reflecting the dependency move.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

@chenjiahan chenjiahan merged commit af0a8d5 into main Apr 1, 2026
7 checks passed
@chenjiahan chenjiahan deleted the neverland/feat-bundle-http-proxy-middleware branch April 1, 2026 08:48
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