From f5caa1296298980740dbc0a43c145f7f58acd623 Mon Sep 17 00:00:00 2001 From: Lauren Tan Date: Mon, 21 Jul 2025 17:26:54 -0400 Subject: [PATCH] [compiler] Fix misleading code example When the compiler bails out on code, it leaves it untouched and unoptimized, so it's always safe for the compiler to bailout. `panicThreshold` in most cases should be kept as `'none'` unless you want to fail the build on these safe bailouts. It's really only useful during dev when you're working on increasing the coverage of the compiler on your codebase. I think having it shown here is confusing so I'm opting to just remove it for this particular code example. --- src/content/learn/react-compiler/incremental-adoption.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/content/learn/react-compiler/incremental-adoption.md b/src/content/learn/react-compiler/incremental-adoption.md index 38ffa224ba0..3d616822afa 100644 --- a/src/content/learn/react-compiler/incremental-adoption.md +++ b/src/content/learn/react-compiler/incremental-adoption.md @@ -101,8 +101,7 @@ module.exports = { test: './src/experimental/**/*.{js,jsx,ts,tsx}', plugins: [ ['babel-plugin-react-compiler', { - compilationMode: 'annotation', // Only compile "use memo" components - panicThreshold: 'none' // More permissive for experimental code + // options ... }] ] }, @@ -110,7 +109,7 @@ module.exports = { test: './src/production/**/*.{js,jsx,ts,tsx}', plugins: [ ['babel-plugin-react-compiler', { - panicThreshold: 'critical_errors' // Stricter for production code + // options ... }] ] }