Skip to content

Conversation

@LingyuCoder
Copy link
Contributor

Summary

fix #10748

Port types of HttpProxyMiddlewareOptions and HttpProxyServerOptions

Related links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copilot AI review requested due to automatic review settings November 13, 2025 08:55
@netlify
Copy link

netlify bot commented Nov 13, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit e056ba7
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6915a0f7d316d000076a8307

@github-actions github-actions bot added release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack. labels Nov 13, 2025
Copy link
Contributor

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 adds proper TypeScript type definitions for HTTP proxy middleware options to fix issue #10748. Previously, the proxy configuration used a generic [key: string]: any catch-all type, which provided no type safety. This change ports comprehensive type definitions from the http-proxy-middleware library.

Key changes:

  • Replaced generic object type with structured HttpProxyMiddlewareOptions interface in ProxyConfigArrayItem
  • Added detailed interfaces for HttpProxyMiddlewareOptions, HttpProxyServerOptions, and related callback types
  • Imported necessary Node.js built-in module types (http, net, stream, url) to support the new type definitions

Reviewed Changes

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

File Description
packages/rspack/src/config/devServer.ts Added imports for Node.js built-in types and replaced generic proxy configuration type with comprehensive type definitions including interfaces for proxy middleware options, server options, callbacks, and target configurations
packages/rspack/etc/core.api.md Updated API documentation to reflect new exported types and interfaces for proxy configuration, including all callback types and supporting interfaces

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

@LingyuCoder LingyuCoder enabled auto-merge (squash) November 13, 2025 09:10
hardfist
hardfist previously approved these changes Nov 13, 2025
@github-actions
Copy link
Contributor

📦 Binary Size-limit

Comparing e056ba7 to fix: should transform output.path while emitting assets (#12181) by harpsealjs

🙈 Size remains the same at 48.10MB

@codspeed-hq
Copy link

codspeed-hq bot commented Nov 13, 2025

CodSpeed Performance Report

Merging #12188 will not alter performance

Comparing fix/dev-server-proxy-type (e056ba7) with main (b20fd92)

Summary

✅ 17 untouched

@LingyuCoder LingyuCoder merged commit b4c08a1 into main Nov 13, 2025
44 checks passed
@LingyuCoder LingyuCoder deleted the fix/dev-server-proxy-type branch November 13, 2025 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: bug fix release: bug related release(mr only) team The issue/pr is created by the member of Rspack.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Rspack 1.3.6 RspackOptions type no longer has onProxyRes in devServer.proxy config

3 participants