Skip to content

Conversation

@mdevils
Copy link
Contributor

@mdevils mdevils commented May 23, 2025

Summary

This is a follow-up refactoring after discussion here: #6053 (comment)

What was done:

  1. React component detection / info gathering logic was abstracted and shared at react::components mod.
  2. JsExport::get_exported_items was improved to return proper values in all cases, not just in a few pre-selected ones.
  3. noNestedComponentDefinitions and useComponentExportOnlyModules were simplified.
  4. Some seemingly incorrect useComponentExportOnlyModules tests were removed.

Please take a look, @dyc3.

Test Plan

Tests are included

@github-actions github-actions bot added A-Linter Area: linter A-Parser Area: parser L-JavaScript Language: JavaScript and super languages labels May 23, 2025
@codspeed-hq
Copy link

codspeed-hq bot commented May 23, 2025

CodSpeed Performance Report

Merging #6124 will improve performances by 7.16%

Comparing mdevils:refactor/reuse-react-component-logic (93484bc) with main (d4f58b5)

Summary

⚡ 1 improvements
✅ 94 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
js_analyzer[index_3894593175024091846.js] 49.4 ms 46.1 ms +7.16%

Copy link
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mdevils
Copy link
Contributor Author

mdevils commented May 24, 2025

My next steps would be fixing these issues related to useHookAtTopLevel rule: #6110, #6093.

@dyc3 dyc3 merged commit 5aecb1d into biomejs:main May 24, 2025
15 checks passed
@mdevils mdevils deleted the refactor/reuse-react-component-logic branch May 29, 2025 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter A-Parser Area: parser L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants