Skip to content

feat: custom prefix for lazy compilation#10147

Merged
JSerFeng merged 5 commits intoweb-infra-dev:mainfrom
dgaponov:feat/custom-prefix-for-lazy-compilation
Apr 25, 2025
Merged

feat: custom prefix for lazy compilation#10147
JSerFeng merged 5 commits intoweb-infra-dev:mainfrom
dgaponov:feat/custom-prefix-for-lazy-compilation

Conversation

@dgaponov
Copy link
Contributor

Summary

This PR adds a new option to customize the URL prefix used for lazy compilation endpoints. Currently, the lazy compilation middleware uses a hardcoded /lazy-compilation-using- prefix for its endpoints, without any way to customize it.

This change adds a new prefix option to the LazyCompilationOptions type, allowing users to specify a custom prefix. When this option is provided, the middleware will use the custom prefix instead of the default one. This is particularly useful for:

  1. Avoiding URL routing conflicts in complex setups
  2. Integrating with existing systems that have specific URL requirements
  3. Keeping consistent URL patterns across different parts of an application

The implementation maintains backward compatibility by using the default prefix when the custom prefix isn't specified.

Checklist

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

- Added new `prefix` option to LazyCompilationOptions to customize lazy compilation endpoint URL
- Modified middleware to use the custom prefix if provided, with fallback to default prefix
- Updated documentation for both English and Chinese versions
- Created e2e tests to verify both custom and default prefix functionality

This change allows users to customize the URL endpoint for lazy compilation,
which is useful for avoiding routing conflicts or integrating with existing systems
that have specific URL requirements.
@CLAassistant
Copy link

CLAassistant commented Apr 23, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the release: feature release: feature related release(mr only) label Apr 23, 2025
@netlify
Copy link

netlify bot commented Apr 23, 2025

Deploy Preview for rspack ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 29f8eb3
🔍 Latest deploy log https://app.netlify.com/sites/rspack/deploys/6809f941ff218e0008df5284
😎 Deploy Preview https://deploy-preview-10147--rspack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@chenjiahan chenjiahan requested a review from JSerFeng April 23, 2025 23:42
@codspeed-hq
Copy link

codspeed-hq bot commented Apr 24, 2025

CodSpeed Performance Report

Merging #10147 will not alter performance

Comparing dgaponov:feat/custom-prefix-for-lazy-compilation (29f8eb3) with main (f5e46dc)

🎉 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

✅ 11 untouched benchmarks

@JSerFeng
Copy link
Contributor

Please don't forget to modify the config in zod as well

Co-authored-by: Fy <1114550440@qq.com>
@JSerFeng
Copy link
Contributor

LGTM, thank you !

@dgaponov dgaponov requested a review from JSerFeng April 24, 2025 09:38
@JSerFeng JSerFeng merged commit 7896253 into web-infra-dev:main Apr 25, 2025
30 checks passed
@renovate renovate bot mentioned this pull request May 8, 2025
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release: feature release: feature related release(mr only)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants