Files
react/compiler/forget
Mofei Zhang a65e9cd1f1 [devx] emit calls to makeReadOnly for debugging
--- 

Emit calls to makeReadOnly for memoized values. 

```js 

function MyComponent() { 

let x; 

if (c_0) { 

x = // ... (recompute x) 

$[0] = __DEV__ ? makeReadOnly(x, "MyComponent") : x; 

} else { 

x = $[0] 

} 

} 

``` 

- import source / specifier should be configurable, as 

- we'll likely want to add gk gating to `makeReadOnly` itself to reduce codesize 
bloat 

- each Forget project needs different logging and filter configurations 

- codegen function name as an argument for easier debugging 

- only freeze memoized outputs
2023-06-05 14:46:58 -04:00
..
2023-05-02 09:33:19 -07:00
2023-06-02 13:06:36 -04:00
2022-12-22 10:23:11 -08:00
2023-06-02 13:06:36 -04: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
2023-06-05 13:35:39 -04:00
2024-03-25 10:39:47 +00:00
2023-06-05 13:35:39 -04: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