Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
72c775c9
Commit
72c775c9
authored
Sep 22, 2025
by
Benjamin Woodruff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Draft: Port #84070 (react compiler anonymous function naming) to Rust
parent
b8531670
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
2 deletions
+9
-2
next_config.rs
crates/next-core/src/next_config.rs
+2
-0
babel.rs
crates/next-core/src/next_shared/webpack_rules/babel.rs
+7
-2
No files found.
crates/next-core/src/next_config.rs
View file @
72c775c9
...
@@ -772,6 +772,8 @@ pub struct ReactCompilerOptions {
...
@@ -772,6 +772,8 @@ pub struct ReactCompilerOptions {
pub
compilation_mode
:
ReactCompilerCompilationMode
,
pub
compilation_mode
:
ReactCompilerCompilationMode
,
#[serde(default)]
#[serde(default)]
pub
panic_threshold
:
ReactCompilerPanicThreshold
,
pub
panic_threshold
:
ReactCompilerPanicThreshold
,
#[serde(default)]
pub
enable_name_anonymous_functions
:
Option
<
bool
>
,
}
}
#[derive(
#[derive(
...
...
crates/next-core/src/next_shared/webpack_rules/babel.rs
View file @
72c775c9
...
@@ -149,11 +149,16 @@ pub async fn get_babel_loader_rules(
...
@@ -149,11 +149,16 @@ pub async fn get_babel_loader_rules(
&&
let
Some
(
babel_plugin_path
)
=
&&
let
Some
(
babel_plugin_path
)
=
resolve_babel_plugin_react_compiler
(
next_config
,
project_path
)
.await
?
resolve_babel_plugin_react_compiler
(
next_config
,
project_path
)
.await
?
{
{
let
react_compiler_options
=
react_compiler_options
.await
?
;
let
mut
react_compiler_options
=
react_compiler_options
.owned
()
.await
?
;
react_compiler_options
.enable_name_anonymous_functions
.get_or_insert_with
(||
{
builtin_conditions
.contains
(
&
WebpackLoaderBuiltinCondition
::
Development
)
});
let
react_compiler_plugins
=
let
react_compiler_plugins
=
serde_json
::
Value
::
Array
(
vec!
[
serde_json
::
Value
::
Array
(
vec!
[
serde_json
::
Value
::
Array
(
vec!
[
serde_json
::
Value
::
Array
(
vec!
[
serde_json
::
Value
::
String
(
babel_plugin_path
.into_owned
()),
serde_json
::
Value
::
String
(
babel_plugin_path
.into_owned
()),
serde_json
::
to_value
(
&
*
react_compiler_options
)
serde_json
::
to_value
(
&
react_compiler_options
)
.expect
(
"react compiler options JSON serialization should never fail"
),
.expect
(
"react compiler options JSON serialization should never fail"
),
])]);
])]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment