Files
react/compiler/forget
Joe Savona 329809de81 Dramatically simplify InlineUseMemo
I realized a wayyyy simpler approach to inlining a lambda: wrap it in a labeled 
block. The transformation is roughly as follows: 

```javascript 

// Before 

const x = useMemo(() => { 

if (a) { 

return b; 

} 

return c; 

}, [a, b, c]); 

return x; 

// After 

let x; 

label: { 

if (a) { 

x = b; 

break label; 

} 

x = c; 

break label; 

} 

return x; 

``` 

The key to making this work is fixing up some edge cases in labeled blocks, 
hence the previous PRs.
2023-05-17 15:55:51 -07:00
..
2023-05-02 09:33:19 -07:00
2023-05-17 14:39:29 -04:00
2023-05-11 13:39:58 -06:00
2023-05-17 15:55:51 -07:00
2022-12-22 10:23:11 -08:00
2022-11-17 10:31:34 -05:00
2024-03-25 10:39:47 +00:00
2024-03-25 10:39:47 +00:00
2024-03-25 10:39:47 +00:00
2024-03-25 10:39:47 +00:00
2023-05-08 12:10:43 -07:00
2024-03-25 10:39:47 +00:00
2023-01-19 18:39:14 +00:00
2023-05-08 12:10:43 -07:00

React Forget

React Forget is an experimental Babel plugin to automatically memoize React Hooks and Components.

Development

# tsc --watch
$ yarn dev

# in another terminal window
$ yarn test --watch

Notes

An overview of the implementation can be found in the Architecture Overview.

This transform

Scaffolding

Reference