-
-
Notifications
You must be signed in to change notification settings - Fork 746
fix: missing type of http proxy middleware options #12188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
✅ Deploy Preview for rspack canceled.
|
There was a problem hiding this 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
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