fix: missing type of http proxy middleware options#12188
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this comment.
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
HttpProxyMiddlewareOptionsinterface inProxyConfigArrayItem - 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.
📦 Binary Size-limit
🙈 Size remains the same at 48.10MB |
CodSpeed Performance ReportMerging #12188 will not alter performanceComparing Summary
|
Summary
fix #10748
Port types of HttpProxyMiddlewareOptions and HttpProxyServerOptions
Related links
Checklist