Skip to content

Conversation

Boshen
Copy link
Member

@Boshen Boshen commented Jul 3, 2025

The current manifest file (.pnp.cjs) lookup technique does not work when enableGlobalCache is set to true, which is the default behavior for yarn.

Instead, we try and find the closest pnp maniest from cwd.

This will break the multi-project case mentioned in https://yarnpkg.com/advanced/pnp-spec#find_pnp_manifest, but I think this is an acceptable trade off.

For napi, I set process.env.OXC_RESOLVER_YARN_PNP in napi/index.js so the Rust side can enable yarn pnp accordingly.

Copy link

graphite-app bot commented Jul 3, 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.

Copy link

codecov bot commented Jul 3, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.27%. Comparing base (5271786) to head (0ddf4a2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #586      +/-   ##
==========================================
- Coverage   93.29%   93.27%   -0.03%     
==========================================
  Files          14       14              
  Lines        2761     2750      -11     
==========================================
- Hits         2576     2565      -11     
  Misses        185      185              

☔ 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.

Copy link

codspeed-hq bot commented Jul 3, 2025

CodSpeed Performance Report

Merging #586 will not alter performance

Comparing 07-03-feat_resolver_pass_in_yarn_manifest_file_instead_of_look_up (0ddf4a2) with main (5271786)

Summary

✅ 3 untouched benchmarks

@JounQin
Copy link
Contributor

JounQin commented Jul 3, 2025

The current manifest file (.pnp.cjs) lookup technique does not work when enableGlobalCache is set to true, which is the default behavior for yarn.

It's supported by using roots option which is used by jest via unrs-resolver.

But maybe I misunderstood what's roots used for?

@Boshen
Copy link
Member Author

Boshen commented Jul 4, 2025

The current manifest file (.pnp.cjs) lookup technique does not work when enableGlobalCache is set to true, which is the default behavior for yarn.

It's supported by using roots option which is used by jest via unrs-resolver.

But maybe I misunderstood what's roots used for?

roots is the wrong option. I'm trying to get pnp to work without any configurations. I've already talked to arcanis, and we agreed that the current approach is not optimal, hence this PR.

Also, the current approach is not performant nor memory usage friendly.

@Boshen Boshen force-pushed the 07-03-feat_resolver_pass_in_yarn_manifest_file_instead_of_look_up branch from 7c627a2 to 7445f00 Compare July 4, 2025 05:41
@Boshen Boshen marked this pull request as ready for review July 4, 2025 05:41
@Boshen Boshen force-pushed the 07-03-feat_resolver_pass_in_yarn_manifest_file_instead_of_look_up branch 2 times, most recently from 4166318 to ff1a918 Compare July 4, 2025 05:50
The current manifest file (`.pnp.cjs`) lookup technique does not work when
`enableGlobalCache` is set to `true`, which is the default behaviour.

Instead, we try and find the closest pnp maniest from cwd.

This will break the multi-project case mentioned in https://yarnpkg.com/advanced/pnp-spec#find_pnp_manifest,
but I think this is an acceptable trade off.
@Boshen Boshen force-pushed the 07-03-feat_resolver_pass_in_yarn_manifest_file_instead_of_look_up branch from ff1a918 to 0ddf4a2 Compare July 4, 2025 05:51
@Boshen Boshen merged commit 6130546 into main Jul 4, 2025
18 checks passed
@Boshen Boshen deleted the 07-03-feat_resolver_pass_in_yarn_manifest_file_instead_of_look_up branch July 4, 2025 05:54
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.

2 participants