PubTrivia has had this in its Next config since the first week:
const nextConfig = { // Enable React Compiler for automatic memoization reactCompiler : true , . . .
Enter fullscreen mode
Exit fullscreen mode
One line, a devDependency on babel-plugin-react-compiler , and then nobody ever looked at what it did. The whole pitch of the compiler is that you stop thinking about memoisation, so not thinking about it felt like compliance. This week I went and audited it from both ends: the output in the deployed JavaScript, and the compiler's own log over the source.
What is in the shipped bundle
Compiled output is easy to spot. A compiled function opens with a call into the compiler runtime and compares each cached slot against a sentinel:
function a ( e ) { let i , n , a = ( 0 , r . c ) ( 6 ) , { size : s , label : l , className : o , children : c } = e ; return a [ 0 ] === Symbol . for ( "react.memo_cache_sentinel" ) ?…