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
cbb858f0
Unverified
Commit
cbb858f0
authored
Feb 25, 2026
by
Niklas Mischkulnig
Committed by
GitHub
Feb 25, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Turbopack: emit env_diff span attribute for update (#90466)
it already existed for `.create()`, but not `.update()`
parent
782f1662
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
121 additions
and
105 deletions
+121
-105
project.rs
crates/next-api/src/project.rs
+121
-105
No files found.
crates/next-api/src/project.rs
View file @
cbb858f0
...
@@ -608,121 +608,137 @@ impl ProjectContainer {
...
@@ -608,121 +608,137 @@ impl ProjectContainer {
.await
.await
}
}
#[tracing
::
instrument(level
=
"info"
,
name
=
"update project options"
,
skip_all)]
pub
async
fn
update
(
self
:
Vc
<
Self
>
,
options
:
PartialProjectOptions
)
->
Result
<
()
>
{
pub
async
fn
update
(
self
:
Vc
<
Self
>
,
options
:
PartialProjectOptions
)
->
Result
<
()
>
{
let
PartialProjectOptions
{
let
span
=
tracing
::
info_span!
(
root_path
,
"update project options"
,
project_path
,
project_name
=
%
self
.await
?
.name
,
next_config
,
env_diff
=
Empty
env
,
);
define_env
,
let
span_clone
=
span
.clone
();
watch
,
async
move
{
dev
,
let
PartialProjectOptions
{
encryption_key
,
root_path
,
build_id
,
project_path
,
preview_props
,
next_config
,
browserslist_query
,
env
,
no_mangling
,
define_env
,
write_routes_hashes_manifest
,
watch
,
debug_build_paths
,
dev
,
}
=
options
;
encryption_key
,
build_id
,
let
resolved_self
=
self
.to_resolved
()
.await
?
;
preview_props
,
let
this
=
resolved_self
.await
?
;
browserslist_query
,
no_mangling
,
let
mut
new_options
=
this
write_routes_hashes_manifest
,
.options_state
debug_build_paths
,
.get
()
}
=
options
;
.clone
()
.context
(
"ProjectContainer need to be initialized with initialize()"
)
?
;
let
resolved_self
=
self
.to_resolved
()
.await
?
;
let
this
=
resolved_self
.await
?
;
let
mut
new_options
=
this
.options_state
.get
()
.clone
()
.context
(
"ProjectContainer need to be initialized with initialize()"
)
?
;
if
let
Some
(
root_path
)
=
root_path
{
if
let
Some
(
root_path
)
=
root_path
{
new_options
.root_path
=
root_path
;
new_options
.root_path
=
root_path
;
}
}
if
let
Some
(
project_path
)
=
project_path
{
if
let
Some
(
project_path
)
=
project_path
{
new_options
.project_path
=
project_path
;
new_options
.project_path
=
project_path
;
}
}
if
let
Some
(
next_config
)
=
next_config
{
if
let
Some
(
next_config
)
=
next_config
{
new_options
.next_config
=
next_config
;
new_options
.next_config
=
next_config
;
}
}
if
let
Some
(
env
)
=
env
{
if
let
Some
(
env
)
=
env
{
new_options
.env
=
env
;
new_options
.env
=
env
;
}
}
if
let
Some
(
define_env
)
=
define_env
{
if
let
Some
(
define_env
)
=
define_env
{
new_options
.define_env
=
define_env
;
new_options
.define_env
=
define_env
;
}
}
if
let
Some
(
watch
)
=
watch
{
if
let
Some
(
watch
)
=
watch
{
new_options
.watch
=
watch
;
new_options
.watch
=
watch
;
}
}
if
let
Some
(
dev
)
=
dev
{
if
let
Some
(
dev
)
=
dev
{
new_options
.dev
=
dev
;
new_options
.dev
=
dev
;
}
}
if
let
Some
(
encryption_key
)
=
encryption_key
{
if
let
Some
(
encryption_key
)
=
encryption_key
{
new_options
.encryption_key
=
encryption_key
;
new_options
.encryption_key
=
encryption_key
;
}
}
if
let
Some
(
build_id
)
=
build_id
{
if
let
Some
(
build_id
)
=
build_id
{
new_options
.build_id
=
build_id
;
new_options
.build_id
=
build_id
;
}
}
if
let
Some
(
preview_props
)
=
preview_props
{
if
let
Some
(
preview_props
)
=
preview_props
{
new_options
.preview_props
=
preview_props
;
new_options
.preview_props
=
preview_props
;
}
}
if
let
Some
(
browserslist_query
)
=
browserslist_query
{
if
let
Some
(
browserslist_query
)
=
browserslist_query
{
new_options
.browserslist_query
=
browserslist_query
;
new_options
.browserslist_query
=
browserslist_query
;
}
}
if
let
Some
(
no_mangling
)
=
no_mangling
{
if
let
Some
(
no_mangling
)
=
no_mangling
{
new_options
.no_mangling
=
no_mangling
;
new_options
.no_mangling
=
no_mangling
;
}
}
if
let
Some
(
write_routes_hashes_manifest
)
=
write_routes_hashes_manifest
{
if
let
Some
(
write_routes_hashes_manifest
)
=
write_routes_hashes_manifest
{
new_options
.write_routes_hashes_manifest
=
write_routes_hashes_manifest
;
new_options
.write_routes_hashes_manifest
=
write_routes_hashes_manifest
;
}
}
if
let
Some
(
debug_build_paths
)
=
debug_build_paths
{
if
let
Some
(
debug_build_paths
)
=
debug_build_paths
{
new_options
.debug_build_paths
=
Some
(
debug_build_paths
);
new_options
.debug_build_paths
=
Some
(
debug_build_paths
);
}
}
// TODO: Handle mode switch, should prevent mode being switched.
// TODO: Handle mode switch, should prevent mode being switched.
let
watch
=
new_options
.watch
;
let
watch
=
new_options
.watch
;
let
project
=
project_operation
(
resolved_self
)
let
project
=
project_operation
(
resolved_self
)
.resolve_strongly_consistent
()
.resolve_strongly_consistent
()
.await
?
;
.await
?
;
let
prev_project_fs
=
project_fs_operation
(
project
)
let
prev_project_fs
=
project_fs_operation
(
project
)
.read_strongly_consistent
()
.read_strongly_consistent
()
.await
?
;
.await
?
;
let
prev_output_fs
=
output_fs_operation
(
project
)
let
prev_output_fs
=
output_fs_operation
(
project
)
.read_strongly_consistent
()
.read_strongly_consistent
()
.await
?
;
.await
?
;
this
.options_state
.set
(
Some
(
new_options
));
if
let
Some
(
old_options
)
=
&*
this
.options_state
.get_untracked
()
{
let
project
=
project_operation
(
resolved_self
)
span
.record
(
.resolve_strongly_consistent
()
"env_diff"
,
.await
?
;
define_env_diff_report
(
&
old_options
.define_env
,
&
new_options
.define_env
)
let
project_fs
=
project_fs_operation
(
project
)
.as_str
(),
.read_strongly_consistent
()
);
.await
?
;
}
let
output_fs
=
output_fs_operation
(
project
)
this
.options_state
.set
(
Some
(
new_options
));
.read_strongly_consistent
()
let
project
=
project_operation
(
resolved_self
)
.await
?
;
.resolve_strongly_consistent
()
.await
?
;
let
project_fs
=
project_fs_operation
(
project
)
.read_strongly_consistent
()
.await
?
;
let
output_fs
=
output_fs_operation
(
project
)
.read_strongly_consistent
()
.await
?
;
if
!
ReadRef
::
ptr_eq
(
&
prev_project_fs
,
&
project_fs
)
{
if
!
ReadRef
::
ptr_eq
(
&
prev_project_fs
,
&
project_fs
)
{
if
watch
.enable
{
if
watch
.enable
{
// TODO stop watching: prev_project_fs.stop_watching()?;
// TODO stop watching: prev_project_fs.stop_watching()?;
project_fs
project_fs
.start_watching_with_invalidation_reason
(
watch
.poll_interval
)
.start_watching_with_invalidation_reason
(
watch
.poll_interval
)
.await
?
;
.await
?
;
}
else
{
}
else
{
project_fs
.invalidate_with_reason
(|
path
|
invalidation
::
Initialize
{
project_fs
.invalidate_with_reason
(|
path
|
invalidation
::
Initialize
{
// this path is just used for display purposes
// this path is just used for display purposes
path
:
RcStr
::
from
(
path
.to_string_lossy
()),
});
}
}
if
!
ReadRef
::
ptr_eq
(
&
prev_output_fs
,
&
output_fs
)
{
prev_output_fs
.invalidate_with_reason
(|
path
|
invalidation
::
Initialize
{
path
:
RcStr
::
from
(
path
.to_string_lossy
()),
path
:
RcStr
::
from
(
path
.to_string_lossy
()),
});
});
}
}
}
if
!
ReadRef
::
ptr_eq
(
&
prev_output_fs
,
&
output_fs
)
{
prev_output_fs
.invalidate_with_reason
(|
path
|
invalidation
::
Initialize
{
path
:
RcStr
::
from
(
path
.to_string_lossy
()),
});
}
Ok
(())
Ok
(())
}
.instrument
(
span_clone
)
.await
}
}
}
}
...
...
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