dillon1000/react

Commit

[Fresh] Make transform resilient to plugin order (#15883)

* Run Fresh tests in two modes: with and without destructuring

Destructuring transform messes up the way we collect signatures for Hooks. This adds failing tests.

* Extract collecting calls to Hooks into a separate visitor

This introduces a bit of a perf penalty but makes our plugin resilient to presence of destructuring transform and their order. Fixes new tests.

* Inline some logic into the call visitor
Browse files
Changed paths2 files
First-parent comparison
M packages/react-fresh/src/ReactFreshBabelPlugin.js ModifiedM packages/react-fresh/src/__tests__/ReactFreshIntegration-test.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…