dillon1000/react

Commit

Improve MergeConsecutiveScopes

Rewrites the core logic of MergeConsecutiveScopes to be easier to follow and fix 
bugs. We now do a two-pass approach: 

* First we iterate block instructions to identify scopes which can be merged, 
without actually merging the instructions themselves. 

* Then we iterate again, copying instructions from the block either into the new 
output block, or into their merged scope, as appropriate. 

I think the simplicity here is worth the performance cost, and we can always 
revisit later as necessary.
Browse files
Changed paths3 files
First-parent comparison
M compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/MergeConsecutiveScopes.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/ReactiveScopes/PrintReactiveFunction.ts ModifiedM compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/merge-consecutive-scopes-objects.expect.md Modified
Patch

Files changed

Rendering syntax-highlighted changes…