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

feat: throw recursion error when resolving cursed browser fields #16

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");

Copy link
Member Author

Boshen commented Dec 8, 2023

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

Copy link

codspeed-hq bot commented Dec 8, 2023

CodSpeed Performance Report

Merging #16 will degrade performances by 31.63%

⚠️ No base runs were found

Falling back to comparing 12-08-perf_remove_allocations_and_hashing_from_browser_field_lookup (3aa21e2) with main (409f096)

Summary

❌ 2 regressions

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main 12-08-perf_remove_allocations_and_hashing_from_browser_field_lookup Change
resolver[single-thread] 1.9 ms 2.8 ms -31.63%
resolver[multi-thread] 2.1 ms 3 ms -29.89%

Copy link

codecov bot commented Dec 8, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (009927b) 94.09% compared to head (3aa21e2) 94.06%.
Report is 2 commits behind head on main.

Files Patch % Lines
src/package_json.rs 94.73% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #16      +/-   ##
==========================================
- Coverage   94.09%   94.06%   -0.04%     
==========================================
  Files          11       11              
  Lines        2253     2257       +4     
==========================================
+ Hits         2120     2123       +3     
- Misses        133      134       +1     

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

@Boshen Boshen force-pushed the 12-08-perf_remove_allocations_and_hashing_from_browser_field_lookup branch from c19a88f to f38e398 Compare December 8, 2023 07:01
@Boshen Boshen force-pushed the 12-08-perf_remove_allocations_and_hashing_from_browser_field_lookup branch from f38e398 to 3aa21e2 Compare December 8, 2023 07:05
@Boshen Boshen changed the title feat: throw recursion error when resolving recursed browser fields feat: throw recursion error when resolving cursed browser fields Dec 8, 2023
@Boshen Boshen closed this Dec 8, 2023
@Boshen Boshen deleted the 12-08-perf_remove_allocations_and_hashing_from_browser_field_lookup branch December 8, 2023 08:33
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