Skip to content
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

throw recursion error when resolving cursed browser fields #17

Merged
merged 1 commit into from
Dec 8, 2023

Conversation

Boshen
Copy link
Member

@Boshen Boshen commented Dec 8, 2023

From webpack test suite: https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/test/cases/resolving/browser-field/index.js#L40-L43

Given node_modules/recursive-file/package.json:

{
	"browser": {
		"a.js": "./a",
		"./b.js": "./b",
		"c.js": "./d.js",
		"./d.js": "./c.js"
	}
}

The following snippet should all throw recursion error.

require("recursive-file/a");
require("recursive-file/b");
require("recursive-file/c");
require("recursive-file/d");

Caveat:

require("module-c") should resolve to browser-module/node_modules/module-c.js given

https://github.com/oxc-project/oxc_resolver/blob/2baf418ab6f8c4cc5073d71dc9a628c43f1a0165/fixtures/enhanced_resolve/test/fixtures/browser-module/package.json#L7

Copy link
Member Author

Boshen commented Dec 8, 2023

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@Boshen Boshen changed the title feat: throw recursion error when resolving recursed browser fields throw recursion error when resolving recursed browser fields Dec 8, 2023
@Boshen Boshen changed the title throw recursion error when resolving recursed browser fields throw recursion error when resolving cursed browser fields Dec 8, 2023
Copy link

codecov bot commented Dec 8, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (009927b) 94.09% compared to head (dbdc251) 94.11%.
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #17      +/-   ##
==========================================
+ Coverage   94.09%   94.11%   +0.01%     
==========================================
  Files          11       11              
  Lines        2253     2259       +6     
==========================================
+ Hits         2120     2126       +6     
  Misses        133      133              

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

Copy link

codspeed-hq bot commented Dec 8, 2023

CodSpeed Performance Report

Merging #17 will not alter performance

⚠️ No base runs were found

Falling back to comparing resolve-browser-field (dbdc251) with main (409f096)

Summary

✅ 2 untouched benchmarks

@Boshen Boshen merged commit 1d69609 into main Dec 8, 2023
19 checks passed
@Boshen Boshen deleted the resolve-browser-field branch December 8, 2023 08:04
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.

1 participant