Skip to content

Comments

fix: allow resolving package?query#fragment for packages with exports field#655

Merged
graphite-app[bot] merged 1 commit intomainfrom
08-20-fix_allow_resolving_package_query_fragment_for_packages_with_exports_field
Aug 20, 2025
Merged

fix: allow resolving package?query#fragment for packages with exports field#655
graphite-app[bot] merged 1 commit intomainfrom
08-20-fix_allow_resolving_package_query_fragment_for_packages_with_exports_field

Conversation

@sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented Aug 20, 2025

Resolving package?query#fragment to packages with exports field is allowed in Vite to allow things like css-package?url, wasm-package?init. This was not allowed by oxc-resolver and this PR allows that.

The current behavior of oxc-resolver comes from this change in enhanced-resolve (webpack/enhanced-resolve#225). This PR adds tests that disallows pkg?foo but allows pkg/nested?foo.
This current behavior doesn't make sense to me. Both pkg?foo and pkg/nested?foo are not allowed by Node and I don't find a reason to treat them differently.

fixes vitejs/rolldown-vite#382
refs 97dfb1a

Copy link
Member Author

sapphi-red commented Aug 20, 2025


How to use the Graphite Merge Queue

Add the label merge to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov
Copy link

codecov bot commented Aug 20, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.95%. Comparing base (6f7e505) to head (c635417).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #655      +/-   ##
==========================================
- Coverage   94.97%   94.95%   -0.02%     
==========================================
  Files          12       12              
  Lines        2824     2816       -8     
==========================================
- Hits         2682     2674       -8     
  Misses        142      142              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 20, 2025

CodSpeed Performance Report

Merging #655 will not alter performance

Comparing 08-20-fix_allow_resolving_package_query_fragment_for_packages_with_exports_field (c635417) with 08-20-test_make_tests_pass_on_windows (6f7e505)

Summary

✅ 3 untouched benchmarks

@sapphi-red sapphi-red marked this pull request as ready for review August 20, 2025 10:52
@Boshen Boshen self-assigned this Aug 20, 2025
@Boshen Boshen added the merge label Aug 20, 2025
Copy link
Member

Boshen commented Aug 20, 2025

Merge activity

…ts field (#655)

Resolving `package?query#fragment` to packages with exports field is allowed in Vite to allow things like `css-package?url`, `wasm-package?init`. This was not allowed by oxc-resolver and this PR allows that.

The current behavior of oxc-resolver comes from this change in enhanced-resolve (webpack/enhanced-resolve#225). This PR adds tests that disallows `pkg?foo` but allows `pkg/nested?foo`.
This current behavior doesn't make sense to me. Both `pkg?foo` and `pkg/nested?foo` are not allowed by Node and I don't find a reason to treat them differently.

fixes vitejs/rolldown-vite#382
refs 97dfb1a
@graphite-app graphite-app bot force-pushed the 08-20-test_make_tests_pass_on_windows branch from 921171e to 6f7e505 Compare August 20, 2025 15:22
@graphite-app graphite-app bot force-pushed the 08-20-fix_allow_resolving_package_query_fragment_for_packages_with_exports_field branch from 23eeae2 to c635417 Compare August 20, 2025 15:23
@graphite-app graphite-app bot removed the merge label Aug 20, 2025
Base automatically changed from 08-20-test_make_tests_pass_on_windows to main August 20, 2025 15:26
@graphite-app graphite-app bot merged commit c635417 into main Aug 20, 2025
15 checks passed
@graphite-app graphite-app bot deleted the 08-20-fix_allow_resolving_package_query_fragment_for_packages_with_exports_field branch August 20, 2025 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

?url suffix not working with native plugin

2 participants