Skip to content

Conversation

@GiveMe-A-Name
Copy link
Member

@GiveMe-A-Name GiveMe-A-Name commented Jul 24, 2025

Summary

Lazy compilation middleware should apply devServer headers configuration to support user set Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Allow-Headers headers to avoid tigger CORS.

Related links

fix: #10044

Checklist

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

Copilot AI review requested due to automatic review settings July 24, 2025 06:47
@GiveMe-A-Name GiveMe-A-Name requested a review from hardfist as a code owner July 24, 2025 06:47
@netlify
Copy link

netlify bot commented Jul 24, 2025

Deploy Preview for rspack canceled.

Name Link
🔨 Latest commit 19f5d6f
🔍 Latest deploy log https://app.netlify.com/projects/rspack/deploys/6891bbd590ddb20008cc6ed1

@github-actions github-actions bot added the release: bug fix release: bug related release(mr only) label Jul 24, 2025
@GiveMe-A-Name GiveMe-A-Name requested a review from JSerFeng July 24, 2025 06:47
@github-actions github-actions bot added the team The issue/pr is created by the member of Rspack. label Jul 24, 2025
@GiveMe-A-Name GiveMe-A-Name removed the request for review from hardfist July 24, 2025 06:48
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 fixes CORS issues in the lazy compilation middleware by adding necessary Access-Control headers to match webpack's lazy compilation backend implementation.

  • Consolidates header setting into a single writeHead call with CORS headers
  • Adds Access-Control-Allow-Origin, Access-Control-Allow-Methods, and Access-Control-Allow-Headers headers with wildcard values

@GiveMe-A-Name GiveMe-A-Name changed the title fix: update response headers in lazy compilation middleware fix: update response headers in lazy compilation middleware to avoid CORS Jul 24, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jul 24, 2025

📦 Binary Size-limit

Comparing 19f5d6f to refactor: native watcher to make codes clear (#11282) by qixuan

🙈 Size remains the same at 50.32MB

@JSerFeng
Copy link
Contributor

It's not safe to use cors: '*', it's strange that dev server should already set cors headers as expected, is that lazy compile middleware run before that 🤔

@GiveMe-A-Name GiveMe-A-Name marked this pull request as draft July 24, 2025 07:20
@codspeed-hq
Copy link

codspeed-hq bot commented Jul 24, 2025

CodSpeed Performance Report

Merging #11157 will not alter performance

Comparing fix/lazy-compiler-backend (19f5d6f) with main (f50011a)1

🎉 Hooray! codspeed-rust just leveled up to 2.7.2!

A heads-up, this is a breaking change and it might affect your current performance baseline a bit. But here's the exciting part - it's packed with new, cool features and promises improved result stability 🥳!
Curious about what's new? Visit our releases page to delve into all the awesome details about this new version.

Summary

✅ 17 untouched benchmarks

Footnotes

  1. No successful run was found on main (a618407) during the generation of this report, so f50011a was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@GiveMe-A-Name GiveMe-A-Name force-pushed the fix/lazy-compiler-backend branch from ae1e062 to 2d7e0a9 Compare August 5, 2025 07:03
@GiveMe-A-Name GiveMe-A-Name force-pushed the fix/lazy-compiler-backend branch from 2d7e0a9 to 19f5d6f Compare August 5, 2025 08:07
@GiveMe-A-Name GiveMe-A-Name changed the title fix: update response headers in lazy compilation middleware to avoid CORS fix: update lazy compilation middleware order to apply devServer Middleware Aug 5, 2025
@GiveMe-A-Name GiveMe-A-Name marked this pull request as ready for review August 5, 2025 08:09
@GiveMe-A-Name GiveMe-A-Name merged commit 3a57c47 into main Aug 5, 2025
46 checks passed
@GiveMe-A-Name GiveMe-A-Name deleted the fix/lazy-compiler-backend branch August 5, 2025 08:35
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]: devServer.headers are not added to experiments.lazyCompilation middlewar

3 participants