Skip to content

Commit

Permalink
refactor(turbo-tasks): Codemod/migrate all ResolvedVc casting callsit…
Browse files Browse the repository at this point in the history
…es to use the new synchronous APIs (#75547)

This is a follow-up to #75055.

After #75055, the async methods are just facades around the synchronous versions, to avoid breaking the API.

I made this PR using:

```
sg run -p 'ResolvedVc::try_sidecast::<$$$TY>($$$ARGS).await?' -r 'ResolvedVc::try_sidecast_sync::<$$$TY>($$$ARGS)' -U
sg run -p 'ResolvedVc::try_sidecast($$$ARGS).await?' -r 'ResolvedVc::try_sidecast_sync($$$ARGS)' -U
sg run -p 'ResolvedVc::try_downcast::<$$$TY>($$$ARGS).await?' -r 'ResolvedVc::try_downcast_sync::<$$$TY>($$$ARGS)' -U
sg run -p 'ResolvedVc::try_downcast($$$ARGS).await?' -r 'ResolvedVc::try_downcast_sync($$$ARGS)' -U
sg run -p 'ResolvedVc::try_downcast_type::<$$$TY>($$$ARGS).await?' -r 'ResolvedVc::try_downcast_type_sync::<$$$TY>($$$ARGS)' -U
sg run -p 'ResolvedVc::try_downcast_type($$$ARGS).await?' -r 'ResolvedVc::try_downcast_type_sync($$$ARGS)' -U
```

Delete the implementation of the non-sync methods, and then:

```
sg run -p 'ResolvedVc::try_sidecast_sync' -r 'ResolvedVc::try_sidecast' -U
sg run -p 'ResolvedVc::try_downcast_sync' -r 'ResolvedVc::try_downcast' -U
sg run -p 'ResolvedVc::try_downcast_type_sync' -r 'ResolvedVc::try_downcast_type' -U
```

Then rename the methods implementations in `resolved.rs` to match.
  • Loading branch information
bgw authored Feb 3, 2025
1 parent f412666 commit aa9ded6
Show file tree
Hide file tree
Showing 61 changed files with 87 additions and 190 deletions.
2 changes: 0 additions & 2 deletions crates/next-api/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1635,7 +1635,6 @@ impl AppEndpoint {
.await?
.clone_value();
let evaluatable = ResolvedVc::try_sidecast(app_entry.rsc_entry)
.await?
.context("Entry module must be evaluatable")?;
evaluatable_assets.push(evaluatable);
evaluatable_assets.push(server_action_manifest_loader);
Expand Down Expand Up @@ -1677,7 +1676,6 @@ impl AppEndpoint {
.iter()
.map(|m| async move {
Ok(*ResolvedVc::try_downcast::<Box<dyn ChunkableModule>>(*m)
.await?
.context("Expected server utils to be chunkable")?)
})
.try_join()
Expand Down
6 changes: 3 additions & 3 deletions crates/next-api/src/client_references.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub async fn map_client_references(
let module = node.module;

if let Some(client_reference_module) =
ResolvedVc::try_downcast_type_sync::<EcmascriptClientReferenceModule>(module)
ResolvedVc::try_downcast_type::<EcmascriptClientReferenceModule>(module)
{
Ok(Some((
module,
Expand All @@ -49,7 +49,7 @@ pub async fn map_client_references(
},
)))
} else if let Some(client_reference_module) =
ResolvedVc::try_downcast_type_sync::<CssClientReferenceModule>(module)
ResolvedVc::try_downcast_type::<CssClientReferenceModule>(module)
{
Ok(Some((
module,
Expand All @@ -58,7 +58,7 @@ pub async fn map_client_references(
)),
)))
} else if let Some(server_component) =
ResolvedVc::try_downcast_type_sync::<NextServerComponentModule>(module)
ResolvedVc::try_downcast_type::<NextServerComponentModule>(module)
{
Ok(Some((
module,
Expand Down
4 changes: 2 additions & 2 deletions crates/next-api/src/dynamic_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ pub async fn map_next_dynamic(graph: Vc<SingleModuleGraph>) -> Result<Vc<Dynamic
.is_some_and(|layer| &**layer == "app-client" || &**layer == "client")
{
if let Some(dynamic_entry_module) =
ResolvedVc::try_downcast_type::<NextDynamicEntryModule>(*module).await?
ResolvedVc::try_downcast_type::<NextDynamicEntryModule>(*module)
{
return Ok(Some((
*module,
Expand All @@ -143,7 +143,7 @@ pub async fn map_next_dynamic(graph: Vc<SingleModuleGraph>) -> Result<Vc<Dynamic
// TODO add this check once these modules have the correct layer
// if layer.is_some_and(|layer| &**layer == "app-rsc") {
if let Some(client_reference_module) =
ResolvedVc::try_downcast_type::<EcmascriptClientReferenceModule>(*module).await?
ResolvedVc::try_downcast_type::<EcmascriptClientReferenceModule>(*module)
{
return Ok(Some((
*module,
Expand Down
7 changes: 3 additions & 4 deletions crates/next-api/src/instrumentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,12 @@ impl InstrumentationEndpoint {
.await?
.clone_value();

let Some(module) =
ResolvedVc::try_downcast::<Box<dyn EcmascriptChunkPlaceable>>(module).await?
let Some(module) = ResolvedVc::try_downcast::<Box<dyn EcmascriptChunkPlaceable>>(module)
else {
bail!("Entry module must be evaluatable");
};

let Some(evaluatable) = ResolvedVc::try_sidecast(module).await? else {
let Some(evaluatable) = ResolvedVc::try_sidecast(module) else {
bail!("Entry module must be evaluatable");
};
evaluatable_assets.push(evaluatable);
Expand All @@ -155,7 +154,7 @@ impl InstrumentationEndpoint {
let userland_module = self.core_modules().await?.userland_module;
let module_graph = this.project.module_graph(*userland_module);

let Some(module) = ResolvedVc::try_downcast(userland_module).await? else {
let Some(module) = ResolvedVc::try_downcast(userland_module) else {
bail!("Entry module must be evaluatable");
};

Expand Down
1 change: 0 additions & 1 deletion crates/next-api/src/pages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,6 @@ impl PageEndpoint {
if is_edge {
let mut evaluatable_assets = edge_runtime_entries.await?.clone_value();
let evaluatable = ResolvedVc::try_sidecast(ssr_module)
.await?
.context("could not process page loader entry module")?;
evaluatable_assets.push(evaluatable);

Expand Down
2 changes: 1 addition & 1 deletion crates/next-api/src/versioned_content_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ impl VersionedContentMap {
};

if let Some(generate_source_map) =
ResolvedVc::try_sidecast::<Box<dyn GenerateSourceMap>>(*asset).await?
ResolvedVc::try_sidecast::<Box<dyn GenerateSourceMap>>(*asset)
{
Ok(if let Some(section) = section {
generate_source_map.by_section(section)
Expand Down
2 changes: 1 addition & 1 deletion crates/next-api/src/webpack_stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ where
continue;
};

if let Some(chunk) = ResolvedVc::try_downcast_type::<EcmascriptDevChunk>(*asset).await? {
if let Some(chunk) = ResolvedVc::try_downcast_type::<EcmascriptDevChunk>(*asset) {
let chunk_ident = normalize_client_path(&chunk.ident().path().await?.path);
chunks.push(WebpackStatsChunk {
size: asset_len,
Expand Down
1 change: 0 additions & 1 deletion crates/next-core/src/bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ pub async fn bootstrap(
.await?;

let asset = ResolvedVc::try_sidecast::<Box<dyn EvaluatableAsset>>(asset)
.await?
.context("internal module must be evaluatable")?;

Ok(*asset)
Expand Down
4 changes: 1 addition & 3 deletions crates/next-core/src/next_client/runtime_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ impl RuntimeEntry {

let mut runtime_entries = Vec::with_capacity(modules.len());
for &module in &modules {
if let Some(entry) =
ResolvedVc::try_downcast::<Box<dyn EvaluatableAsset>>(module).await?
{
if let Some(entry) = ResolvedVc::try_downcast::<Box<dyn EvaluatableAsset>>(module) {
runtime_entries.push(entry);
} else {
bail!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ impl Transition for NextCssClientReferenceTransition {
return Ok(ProcessResult::Ignore.cell());
};

let client_module = ResolvedVc::try_sidecast_sync::<Box<dyn CssChunkPlaceable>>(module)
let client_module = ResolvedVc::try_sidecast::<Box<dyn CssChunkPlaceable>>(module)
.context("css client asset is not css chunk placeable")?;

Ok(ProcessResult::Module(ResolvedVc::upcast(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ impl Transition for NextEcmascriptClientReferenceTransition {
};

let Some(client_module) =
ResolvedVc::try_sidecast::<Box<dyn EcmascriptChunkPlaceable>>(client_module).await?
ResolvedVc::try_sidecast::<Box<dyn EcmascriptChunkPlaceable>>(client_module)
else {
bail!("client asset is not ecmascript chunk placeable");
};

let Some(ssr_module) =
ResolvedVc::try_sidecast::<Box<dyn EcmascriptChunkPlaceable>>(ssr_module).await?
ResolvedVc::try_sidecast::<Box<dyn EcmascriptChunkPlaceable>>(ssr_module)
else {
bail!("SSR asset is not ecmascript chunk placeable");
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ pub async fn client_reference_graph(
Ok(VisitClientReferenceNode {
state: if let Some(server_component) =
ResolvedVc::try_downcast_type::<NextServerComponentModule>(module)
.await?
{
VisitClientReferenceNodeState::InServerComponent {
server_component,
Expand Down Expand Up @@ -416,7 +415,6 @@ impl Visit<VisitClientReferenceNode> for VisitClientReference {
.map(|module| async move {
if let Some(client_reference_module) =
ResolvedVc::try_downcast_type::<EcmascriptClientReferenceModule>(*module)
.await?
{
return Ok(VisitClientReferenceNode {
state: node.state,
Expand All @@ -433,7 +431,7 @@ impl Visit<VisitClientReferenceNode> for VisitClientReference {
}

if let Some(client_reference_module) =
ResolvedVc::try_downcast_type::<CssClientReferenceModule>(*module).await?
ResolvedVc::try_downcast_type::<CssClientReferenceModule>(*module)
{
return Ok(VisitClientReferenceNode {
state: node.state,
Expand All @@ -450,7 +448,7 @@ impl Visit<VisitClientReferenceNode> for VisitClientReference {
}

if let Some(server_component_asset) =
ResolvedVc::try_downcast_type::<NextServerComponentModule>(*module).await?
ResolvedVc::try_downcast_type::<NextServerComponentModule>(*module)
{
return Ok(VisitClientReferenceNode {
state: VisitClientReferenceNodeState::InServerComponent {
Expand All @@ -463,10 +461,7 @@ impl Visit<VisitClientReferenceNode> for VisitClientReference {
});
}

if ResolvedVc::try_downcast_type::<NextServerUtilityModule>(*module)
.await?
.is_some()
{
if ResolvedVc::try_downcast_type::<NextServerUtilityModule>(*module).is_some() {
return Ok(VisitClientReferenceNode {
state: VisitClientReferenceNodeState::InServerUtil,
ty: VisitClientReferenceNodeType::ServerUtilEntry(
Expand Down
1 change: 0 additions & 1 deletion crates/next-core/src/next_dynamic/dynamic_transition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ impl Transition for NextDynamicTransition {
Some(client_module) => {
let Some(client_module) =
ResolvedVc::try_sidecast::<Box<dyn EcmascriptChunkPlaceable>>(*client_module)
.await?
else {
bail!("not an ecmascript client_module");
};
Expand Down
2 changes: 1 addition & 1 deletion crates/next-core/src/next_dynamic/visit_dynamic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl Visit<VisitDynamicNode> for VisitDynamic {

let referenced_modules = referenced_modules.iter().map(|module| async move {
if let Some(next_dynamic_module) =
ResolvedVc::try_downcast_type::<NextDynamicEntryModule>(*module).await?
ResolvedVc::try_downcast_type::<NextDynamicEntryModule>(*module)
{
return Ok(VisitDynamicNode::Dynamic(
next_dynamic_module,
Expand Down
3 changes: 1 addition & 2 deletions crates/next-core/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,7 @@ async fn parse_route_matcher_from_js_value(
pub async fn parse_config_from_source(
module: ResolvedVc<Box<dyn Module>>,
) -> Result<Vc<NextSourceConfig>> {
if let Some(ecmascript_asset) =
ResolvedVc::try_sidecast::<Box<dyn EcmascriptParsable>>(module).await?
if let Some(ecmascript_asset) = ResolvedVc::try_sidecast::<Box<dyn EcmascriptParsable>>(module)
{
if let ParseResult::Ok {
program: Program::Module(module_ast),
Expand Down
4 changes: 2 additions & 2 deletions turbopack/crates/turbo-tasks-testing/tests/resolved_vc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ async fn test_sidecast() -> Result<()> {
run(&REGISTRATION, || async {
let concrete_value = ImplementsAandB.resolved_cell();
let as_a = ResolvedVc::upcast::<Box<dyn TraitA>>(concrete_value);
let as_b = ResolvedVc::try_sidecast_sync::<Box<dyn TraitB>>(as_a);
let as_b = ResolvedVc::try_sidecast::<Box<dyn TraitB>>(as_a);
assert!(as_b.is_some());
let as_c = ResolvedVc::try_sidecast_sync::<Box<dyn TraitC>>(as_a);
let as_c = ResolvedVc::try_sidecast::<Box<dyn TraitC>>(as_a);
assert!(as_c.is_none());
Ok(())
})
Expand Down
55 changes: 5 additions & 50 deletions turbopack/crates/turbo-tasks/src/vc/resolved.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use crate::{
debug::{ValueDebug, ValueDebugFormat, ValueDebugFormatString},
trace::{TraceRawVcs, TraceRawVcsContext},
vc::Vc,
ResolveTypeError, Upcast, VcRead, VcTransparentRead, VcValueTrait, VcValueType,
Upcast, VcRead, VcTransparentRead, VcValueTrait, VcValueType,
};

/// A "subtype" (via [`Deref`]) of [`Vc`] that represents a specific [`Vc::cell`]/`.cell()` or
Expand Down Expand Up @@ -211,31 +211,13 @@ impl<T> ResolvedVc<T>
where
T: VcValueTrait + ?Sized,
{
/// Attempts to sidecast the given `Vc<Box<dyn T>>` to a `Vc<Box<dyn K>>`.
///
/// Returns `None` if the underlying value type does not implement `K`.
///
/// **Note:** if the trait `T` is required to implement `K`, use [`ResolvedVc::upcast`] instead.
/// This provides stronger guarantees, removing the need for a [`Result`] return type.
///
/// See also: [`Vc::try_resolve_sidecast`].
pub async fn try_sidecast<K>(this: Self) -> Result<Option<ResolvedVc<K>>, ResolveTypeError>
where
K: VcValueTrait + ?Sized,
{
// TODO: Expose a synchronous API instead of this async one that returns `Result<Option<_>>`
Ok(Self::try_sidecast_sync(this))
}

/// Attempts to sidecast the given `ResolvedVc<Box<dyn T>>` to a `ResolvedVc<Box<dyn K>>`.
///
/// Returns `None` if the underlying value type does not implement `K`.
///
/// **Note:** if the trait `T` is required to implement `K`, use [`ResolvedVc::upcast`] instead.
/// This provides stronger guarantees, removing the need for a [`Result`] return type.
///
/// See also: [`Vc::try_resolve_sidecast`].
pub fn try_sidecast_sync<K>(this: Self) -> Option<ResolvedVc<K>>
pub fn try_sidecast<K>(this: Self) -> Option<ResolvedVc<K>>
where
K: VcValueTrait + ?Sized,
{
Expand All @@ -258,47 +240,20 @@ where
/// Returns `None` if the underlying value type is not a `K`.
///
/// See also: [`Vc::try_resolve_downcast`].
pub async fn try_downcast<K>(this: Self) -> Result<Option<ResolvedVc<K>>, ResolveTypeError>
where
K: Upcast<T> + VcValueTrait + ?Sized,
{
// TODO: Expose a synchronous API instead of this async one that returns `Result<Option<_>>`
Ok(Self::try_downcast_sync(this))
}

/// Attempts to downcast the given `ResolvedVc<Box<dyn T>>` to a `ResolvedVc<K>`, where `K`
/// is of the form `Box<dyn L>`, and `L` is a value trait.
///
/// Returns `None` if the underlying value type is not a `K`.
///
/// See also: [`Vc::try_resolve_downcast`].
pub fn try_downcast_sync<K>(this: Self) -> Option<ResolvedVc<K>>
pub fn try_downcast<K>(this: Self) -> Option<ResolvedVc<K>>
where
K: Upcast<T> + VcValueTrait + ?Sized,
{
// this is just a more type-safe version of a sidecast
Self::try_sidecast_sync(this)
}

/// Attempts to downcast the given `Vc<Box<dyn T>>` to a `Vc<K>`, where `K` is a value type.
///
/// Returns `None` if the underlying value type is not a `K`.
///
/// See also: [`Vc::try_resolve_downcast_type`].
pub async fn try_downcast_type<K>(this: Self) -> Result<Option<ResolvedVc<K>>, ResolveTypeError>
where
K: Upcast<T> + VcValueType,
{
// TODO: Expose a synchronous API instead of this async one that returns `Result<Option<_>>`
Ok(Self::try_downcast_type_sync(this))
Self::try_sidecast(this)
}

/// Attempts to downcast the given `Vc<Box<dyn T>>` to a `Vc<K>`, where `K` is a value type.
///
/// Returns `None` if the underlying value type is not a `K`.
///
/// See also: [`Vc::try_resolve_downcast_type`].
pub fn try_downcast_type_sync<K>(this: Self) -> Option<ResolvedVc<K>>
pub fn try_downcast_type<K>(this: Self) -> Option<ResolvedVc<K>>
where
K: Upcast<T> + VcValueType,
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ impl EcmascriptDevEvaluateChunk {
move |entry| async move {
if let Some(placeable) =
ResolvedVc::try_sidecast::<Box<dyn EcmascriptChunkPlaceable>>(*entry)
.await?
{
Ok(Some(
placeable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ impl EcmascriptDevChunkListContent {
for (chunk_path, chunk_content) in &self.chunks_contents {
if let Some(mergeable) =
ResolvedVc::try_sidecast::<Box<dyn MergeableVersionedContent>>(*chunk_content)
.await?
{
let merger = mergeable.get_merger().resolve().await?;
by_merger.entry(merger).or_default().push(*chunk_content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub(super) async fn update_chunk_list(

for (chunk_path, chunk_content) in &content.chunks_contents {
if let Some(mergeable) =
ResolvedVc::try_sidecast::<Box<dyn MergeableVersionedContent>>(*chunk_content).await?
ResolvedVc::try_sidecast::<Box<dyn MergeableVersionedContent>>(*chunk_content)
{
let merger = mergeable.get_merger().to_resolved().await?;
by_merger.entry(merger).or_default().push(*chunk_content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl VersionedContentMerger for EcmascriptDevChunkContentMerger {
.iter()
.map(|content| async move {
if let Some(content) =
ResolvedVc::try_downcast_type::<EcmascriptDevChunkContent>(*content).await?
ResolvedVc::try_downcast_type::<EcmascriptDevChunkContent>(*content)
{
Ok(content)
} else {
Expand Down
4 changes: 1 addition & 3 deletions turbopack/crates/turbopack-cli-utils/src/runtime_entry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,7 @@ impl RuntimeEntry {

let mut runtime_entries = Vec::with_capacity(modules.len());
for &module in &modules {
if let Some(entry) =
ResolvedVc::try_sidecast::<Box<dyn EvaluatableAsset>>(module).await?
{
if let Some(entry) = ResolvedVc::try_sidecast::<Box<dyn EvaluatableAsset>>(module) {
runtime_entries.push(entry);
} else {
bail!(
Expand Down
2 changes: 1 addition & 1 deletion turbopack/crates/turbopack-cli/src/build/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ async fn build_internal(
.map(|entry_module| async move {
Ok(
if let Some(ecmascript) =
ResolvedVc::try_sidecast::<Box<dyn EvaluatableAsset>>(entry_module).await?
ResolvedVc::try_sidecast::<Box<dyn EvaluatableAsset>>(entry_module)
{
match target {
Target::Browser => {
Expand Down
Loading

1 comment on commit aa9ded6

@ijjk
Copy link
Member

@ijjk ijjk commented on aa9ded6 Feb 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stats from current release

Default Build (Increase detected ⚠️)
General
vercel/next.js canary v15.1.6 vercel/next.js canary Change
buildDuration 14.6s 16.6s ⚠️ +2.1s
buildDurationCached 14.6s 12.3s N/A
nodeModulesSize 407 MB 391 MB N/A
nextStartRea..uration (ms) 414ms 401ms N/A
Client Bundles (main, webpack) Overall increase ⚠️
vercel/next.js canary v15.1.6 vercel/next.js canary Change
1187-HASH.js gzip 50.4 kB 54 kB ⚠️ +3.57 kB
8276.HASH.js gzip 169 B 168 B N/A
8377-HASH.js gzip 5.38 kB 5.46 kB N/A
bccd1874-HASH.js gzip 53 kB 52.9 kB N/A
framework-HASH.js gzip 57.5 kB 57.5 kB N/A
main-app-HASH.js gzip 232 B 241 B N/A
main-HASH.js gzip 33.8 kB 34.4 kB ⚠️ +653 B
webpack-HASH.js gzip 1.71 kB 1.71 kB N/A
Overall change 84.2 kB 88.4 kB ⚠️ +4.22 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary v15.1.6 vercel/next.js canary Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Overall change 39.4 kB 39.4 kB
Client Pages
vercel/next.js canary v15.1.6 vercel/next.js canary Change
_app-HASH.js gzip 193 B 193 B
_error-HASH.js gzip 193 B 193 B
amp-HASH.js gzip 512 B 510 B N/A
css-HASH.js gzip 343 B 342 B N/A
dynamic-HASH.js gzip 1.84 kB 1.84 kB
edge-ssr-HASH.js gzip 265 B 265 B
head-HASH.js gzip 363 B 362 B N/A
hooks-HASH.js gzip 393 B 392 B N/A
image-HASH.js gzip 4.52 kB 4.58 kB N/A
index-HASH.js gzip 268 B 268 B
link-HASH.js gzip 2.35 kB 2.35 kB
routerDirect..HASH.js gzip 328 B 328 B
script-HASH.js gzip 397 B 397 B
withRouter-HASH.js gzip 323 B 326 B N/A
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 5.94 kB 5.94 kB
Client Build Manifests
vercel/next.js canary v15.1.6 vercel/next.js canary Change
_buildManifest.js gzip 747 B 747 B
Overall change 747 B 747 B
Rendered Page Sizes
vercel/next.js canary v15.1.6 vercel/next.js canary Change
index.html gzip 522 B 522 B
link.html gzip 537 B 538 B N/A
withRouter.html gzip 518 B 520 B N/A
Overall change 522 B 522 B
Edge SSR bundle Size Overall increase ⚠️
vercel/next.js canary v15.1.6 vercel/next.js canary Change
edge-ssr.js gzip 128 kB 129 kB ⚠️ +1.15 kB
page.js gzip 203 kB 210 kB ⚠️ +6.97 kB
Overall change 331 kB 339 kB ⚠️ +8.13 kB
Middleware size Overall increase ⚠️
vercel/next.js canary v15.1.6 vercel/next.js canary Change
middleware-b..fest.js gzip 666 B 666 B
middleware-r..fest.js gzip 155 B 156 B N/A
middleware.js gzip 31 kB 31.3 kB ⚠️ +294 B
edge-runtime..pack.js gzip 844 B 844 B
Overall change 32.5 kB 32.8 kB ⚠️ +294 B
Next Runtimes Overall increase ⚠️
vercel/next.js canary v15.1.6 vercel/next.js canary Change
523-experime...dev.js gzip 322 B N/A N/A
523.runtime.dev.js gzip 314 B N/A N/A
app-page-exp...dev.js gzip 322 kB 385 kB ⚠️ +62.7 kB
app-page-exp..prod.js gzip 127 kB 132 kB ⚠️ +5.2 kB
app-page-tur..prod.js gzip 140 kB 145 kB ⚠️ +5.13 kB
app-page-tur..prod.js gzip 135 kB 141 kB ⚠️ +5.81 kB
app-page.run...dev.js gzip 313 kB 372 kB ⚠️ +59.6 kB
app-page.run..prod.js gzip 123 kB 128 kB ⚠️ +5.59 kB
app-route-ex...dev.js gzip 37.1 kB 39.3 kB ⚠️ +2.12 kB
app-route-ex..prod.js gzip 25.2 kB 25.6 kB ⚠️ +426 B
app-route-tu..prod.js gzip 25.2 kB 25.6 kB ⚠️ +427 B
app-route-tu..prod.js gzip 25 kB 25.4 kB ⚠️ +415 B
app-route.ru...dev.js gzip 38.8 kB 40.8 kB ⚠️ +2.06 kB
app-route.ru..prod.js gzip 25 kB 25.4 kB ⚠️ +416 B
pages-api-tu..prod.js gzip 9.56 kB 9.69 kB ⚠️ +121 B
pages-api.ru...dev.js gzip 11.4 kB 11.8 kB ⚠️ +329 B
pages-api.ru..prod.js gzip 9.56 kB 9.68 kB ⚠️ +121 B
pages-turbo...prod.js gzip 21.3 kB 21.9 kB ⚠️ +557 B
pages.runtim...dev.js gzip 27.1 kB 31.5 kB ⚠️ +4.41 kB
pages.runtim..prod.js gzip 21.3 kB 21.9 kB ⚠️ +556 B
server.runti..prod.js gzip 916 kB 60.2 kB N/A
dist_client_...dev.js gzip N/A 356 B N/A
dist_client_...dev.js gzip N/A 349 B N/A
Overall change 1.44 MB 1.59 MB ⚠️ +156 kB
build cache Overall increase ⚠️
vercel/next.js canary v15.1.6 vercel/next.js canary Change
0.pack gzip 2.03 MB 2.1 MB ⚠️ +69.2 kB
index.pack gzip 72 kB 74.6 kB ⚠️ +2.66 kB
Overall change 2.11 MB 2.18 MB ⚠️ +71.8 kB
Diff details
Diff for page.js

Diff too large to display

Diff for middleware.js

Diff too large to display

Diff for edge-ssr.js

Diff too large to display

Diff for image-HASH.js
@@ -1,7 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [2983],
   {
-    /***/ 3705: /***/ (
+    /***/ 8255: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
@@ -9,7 +9,7 @@
       (window.__NEXT_P = window.__NEXT_P || []).push([
         "/image",
         function () {
-          return __webpack_require__(8448);
+          return __webpack_require__(8926);
         },
       ]);
       if (false) {
@@ -18,7 +18,7 @@
       /***/
     },
 
-    /***/ 7342: /***/ (module, exports, __webpack_require__) => {
+    /***/ 4369: /***/ (module, exports, __webpack_require__) => {
       "use strict";
       /* __next_internal_client_entry_do_not_use__  cjs */
       Object.defineProperty(exports, "__esModule", {
@@ -40,17 +40,17 @@
         __webpack_require__(6049)
       );
       const _head = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(7196)
+        __webpack_require__(956)
       );
-      const _getimgprops = __webpack_require__(2661);
-      const _imageconfig = __webpack_require__(72);
-      const _imageconfigcontextsharedruntime = __webpack_require__(6386);
-      const _warnonce = __webpack_require__(4496);
-      const _routercontextsharedruntime = __webpack_require__(6443);
+      const _getimgprops = __webpack_require__(485);
+      const _imageconfig = __webpack_require__(4664);
+      const _imageconfigcontextsharedruntime = __webpack_require__(1250);
+      const _warnonce = __webpack_require__(1648);
+      const _routercontextsharedruntime = __webpack_require__(907);
       const _imageloader = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(3433)
+        __webpack_require__(6489)
       );
-      const _usemergedref = __webpack_require__(1942);
+      const _usemergedref = __webpack_require__(5942);
       // This is replaced by webpack define plugin
       const configEnv = {
         deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
@@ -377,7 +377,7 @@
       /***/
     },
 
-    /***/ 1942: /***/ (module, exports, __webpack_require__) => {
+    /***/ 5942: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -391,22 +391,39 @@
       });
       const _react = __webpack_require__(8101);
       function useMergedRef(refA, refB) {
-        const cleanupA = (0, _react.useRef)(() => {});
-        const cleanupB = (0, _react.useRef)(() => {});
-        return (0, _react.useMemo)(() => {
-          if (!refA || !refB) {
-            return refA || refB;
-          }
-          return (current) => {
+        const cleanupA = (0, _react.useRef)(null);
+        const cleanupB = (0, _react.useRef)(null);
+        // NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.
+        // (this happens often if the user doesn't pass a ref to Link/Form/Image)
+        // But this can cause us to leak a cleanup-ref into user code (e.g. via `<Link legacyBehavior>`),
+        // and the user might pass that ref into ref-merging library that doesn't support cleanup refs
+        // (because it hasn't been updated for React 19)
+        // which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.
+        // So in practice, it's safer to be defensive and always wrap the ref, even on React 19.
+        return (0, _react.useCallback)(
+          (current) => {
             if (current === null) {
-              cleanupA.current();
-              cleanupB.current();
+              const cleanupFnA = cleanupA.current;
+              if (cleanupFnA) {
+                cleanupA.current = null;
+                cleanupFnA();
+              }
+              const cleanupFnB = cleanupB.current;
+              if (cleanupFnB) {
+                cleanupB.current = null;
+                cleanupFnB();
+              }
             } else {
-              cleanupA.current = applyRef(refA, current);
-              cleanupB.current = applyRef(refB, current);
+              if (refA) {
+                cleanupA.current = applyRef(refA, current);
+              }
+              if (refB) {
+                cleanupB.current = applyRef(refB, current);
+              }
             }
-          };
-        }, [refA, refB]);
+          },
+          [refA, refB]
+        );
       }
       function applyRef(refA, current) {
         if (typeof refA === "function") {
@@ -438,7 +455,7 @@
       /***/
     },
 
-    /***/ 2661: /***/ (
+    /***/ 485: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -454,9 +471,9 @@
           return getImgProps;
         },
       });
-      const _warnonce = __webpack_require__(4496);
-      const _imageblursvg = __webpack_require__(4796);
-      const _imageconfig = __webpack_require__(72);
+      const _warnonce = __webpack_require__(1648);
+      const _imageblursvg = __webpack_require__(4812);
+      const _imageconfig = __webpack_require__(4664);
       const VALID_LOADING_VALUES =
         /* unused pure expression or super */ null && [
           "lazy",
@@ -629,8 +646,15 @@
           };
         }
         if (typeof defaultLoader === "undefined") {
-          throw new Error(
-            "images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"
+          throw Object.defineProperty(
+            new Error(
+              "images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"
+            ),
+            "__NEXT_ERROR_CODE",
+            {
+              value: "E163",
+              enumerable: false,
+            }
           );
         }
         let loader = rest.loader || defaultLoader;
@@ -642,11 +666,18 @@
         const isDefaultLoader = "__next_img_default" in loader;
         if (isDefaultLoader) {
           if (config.loader === "custom") {
-            throw new Error(
-              'Image with src "' +
-                src +
-                '" is missing "loader" prop.' +
-                "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader"
+            throw Object.defineProperty(
+              new Error(
+                'Image with src "' +
+                  src +
+                  '" is missing "loader" prop.' +
+                  "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader"
+              ),
+              "__NEXT_ERROR_CODE",
+              {
+                value: "E252",
+                enumerable: false,
+              }
             );
           }
         } else {
@@ -697,15 +728,29 @@
         if (isStaticImport(src)) {
           const staticImageData = isStaticRequire(src) ? src.default : src;
           if (!staticImageData.src) {
-            throw new Error(
-              "An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received " +
-                JSON.stringify(staticImageData)
+            throw Object.defineProperty(
+              new Error(
+                "An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received " +
+                  JSON.stringify(staticImageData)
+              ),
+              "__NEXT_ERROR_CODE",
+              {
+                value: "E460",
+                enumerable: false,
+              }
             );
           }
           if (!staticImageData.height || !staticImageData.width) {
-            throw new Error(
-              "An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received " +
-                JSON.stringify(staticImageData)
+            throw Object.defineProperty(
+              new Error(
+                "An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received " +
+                  JSON.stringify(staticImageData)
+              ),
+              "__NEXT_ERROR_CODE",
+              {
+                value: "E48",
+                enumerable: false,
+              }
             );
           }
           blurWidth = staticImageData.blurWidth;
@@ -836,7 +881,7 @@
       /***/
     },
 
-    /***/ 4796: /***/ (__unused_webpack_module, exports) => {
+    /***/ 4812: /***/ (__unused_webpack_module, exports) => {
       "use strict";
       /**
        * A shared function, used on both client and server, to generate a SVG blur placeholder.
@@ -891,7 +936,7 @@
       /***/
     },
 
-    /***/ 1969: /***/ (
+    /***/ 8273: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -918,10 +963,10 @@
         },
       });
       const _interop_require_default = __webpack_require__(173);
-      const _getimgprops = __webpack_require__(2661);
-      const _imagecomponent = __webpack_require__(7342);
+      const _getimgprops = __webpack_require__(485);
+      const _imagecomponent = __webpack_require__(4369);
       const _imageloader = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(3433)
+        __webpack_require__(6489)
       );
       function getImageProps(imgProps) {
         const { props } = (0, _getimgprops.getImgProps)(imgProps, {
@@ -953,7 +998,7 @@
       /***/
     },
 
-    /***/ 3433: /***/ (__unused_webpack_module, exports) => {
+    /***/ 6489: /***/ (__unused_webpack_module, exports) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -1000,7 +1045,7 @@
       /***/
     },
 
-    /***/ 8448: /***/ (
+    /***/ 8926: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -1017,8 +1062,8 @@
 
       // EXTERNAL MODULE: ./node_modules/.pnpm/[email protected]/node_modules/react/jsx-runtime.js
       var jsx_runtime = __webpack_require__(5105);
-      // EXTERNAL MODULE: ./node_modules/.pnpm/next@[email protected][email protected][email protected]/node_modules/next/image.js
-      var next_image = __webpack_require__(8140);
+      // EXTERNAL MODULE: ./node_modules/.pnpm/next@[email protected][email protected][email protected]/node_modules/next/image.js
+      var next_image = __webpack_require__(5434);
       var image_default = /*#__PURE__*/ __webpack_require__.n(next_image); // ./pages/nextjs.png
       /* harmony default export */ const nextjs = {
         src: "/_next/static/media/nextjs.cae0b805.png",
@@ -1048,12 +1093,12 @@
       /***/
     },
 
-    /***/ 8140: /***/ (
+    /***/ 5434: /***/ (
       module,
       __unused_webpack_exports,
       __webpack_require__
     ) => {
-      module.exports = __webpack_require__(1969);
+      module.exports = __webpack_require__(8273);
 
       /***/
     },
@@ -1063,7 +1108,7 @@
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(3705)
+      __webpack_exec__(8255)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for link-HASH.js
@@ -1,7 +1,7 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [4672],
   {
-    /***/ 3679: /***/ (
+    /***/ 6613: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
@@ -9,7 +9,7 @@
       (window.__NEXT_P = window.__NEXT_P || []).push([
         "/link",
         function () {
-          return __webpack_require__(8562);
+          return __webpack_require__(2488);
         },
       ]);
       if (false) {
@@ -18,7 +18,7 @@
       /***/
     },
 
-    /***/ 7597: /***/ (module, exports, __webpack_require__) => {
+    /***/ 58: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -30,7 +30,7 @@
           return getDomainLocale;
         },
       });
-      const _normalizetrailingslash = __webpack_require__(4858);
+      const _normalizetrailingslash = __webpack_require__(8650);
       const basePath =
         /* unused pure expression or super */ null && (false || "");
       function getDomainLocale(path, locale, locales, domainLocales) {
@@ -54,7 +54,7 @@
       /***/
     },
 
-    /***/ 3000: /***/ (module, exports, __webpack_require__) => {
+    /***/ 9400: /***/ (module, exports, __webpack_require__) => {
       "use strict";
       /* __next_internal_client_entry_do_not_use__  cjs */
       Object.defineProperty(exports, "__esModule", {
@@ -71,16 +71,16 @@
       const _react = /*#__PURE__*/ _interop_require_default._(
         __webpack_require__(8101)
       );
-      const _resolvehref = __webpack_require__(9978);
-      const _islocalurl = __webpack_require__(1762);
-      const _formaturl = __webpack_require__(9835);
-      const _utils = __webpack_require__(4781);
-      const _addlocale = __webpack_require__(5244);
-      const _routercontextsharedruntime = __webpack_require__(6443);
-      const _useintersection = __webpack_require__(1587);
-      const _getdomainlocale = __webpack_require__(7597);
-      const _addbasepath = __webpack_require__(7439);
-      const _usemergedref = __webpack_require__(1942);
+      const _resolvehref = __webpack_require__(5066);
+      const _islocalurl = __webpack_require__(5266);
+      const _formaturl = __webpack_require__(4507);
+      const _utils = __webpack_require__(3085);
+      const _addlocale = __webpack_require__(8172);
+      const _routercontextsharedruntime = __webpack_require__(907);
+      const _useintersection = __webpack_require__(9347);
+      const _getdomainlocale = __webpack_require__(58);
+      const _addbasepath = __webpack_require__(943);
+      const _usemergedref = __webpack_require__(5942);
       const prefetched = new Set();
       function prefetch(router, href, as, options) {
         if (false) {
@@ -433,7 +433,7 @@
       /***/
     },
 
-    /***/ 1587: /***/ (module, exports, __webpack_require__) => {
+    /***/ 9347: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -446,7 +446,7 @@
         },
       });
       const _react = __webpack_require__(8101);
-      const _requestidlecallback = __webpack_require__(7512);
+      const _requestidlecallback = __webpack_require__(5832);
       const hasIntersectionObserver =
         typeof IntersectionObserver === "function";
       const observers = new Map();
@@ -559,7 +559,7 @@
       /***/
     },
 
-    /***/ 1942: /***/ (module, exports, __webpack_require__) => {
+    /***/ 5942: /***/ (module, exports, __webpack_require__) => {
       "use strict";
 
       Object.defineProperty(exports, "__esModule", {
@@ -573,22 +573,39 @@
       });
       const _react = __webpack_require__(8101);
       function useMergedRef(refA, refB) {
-        const cleanupA = (0, _react.useRef)(() => {});
-        const cleanupB = (0, _react.useRef)(() => {});
-        return (0, _react.useMemo)(() => {
-          if (!refA || !refB) {
-            return refA || refB;
-          }
-          return (current) => {
+        const cleanupA = (0, _react.useRef)(null);
+        const cleanupB = (0, _react.useRef)(null);
+        // NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.
+        // (this happens often if the user doesn't pass a ref to Link/Form/Image)
+        // But this can cause us to leak a cleanup-ref into user code (e.g. via `<Link legacyBehavior>`),
+        // and the user might pass that ref into ref-merging library that doesn't support cleanup refs
+        // (because it hasn't been updated for React 19)
+        // which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.
+        // So in practice, it's safer to be defensive and always wrap the ref, even on React 19.
+        return (0, _react.useCallback)(
+          (current) => {
             if (current === null) {
-              cleanupA.current();
-              cleanupB.current();
+              const cleanupFnA = cleanupA.current;
+              if (cleanupFnA) {
+                cleanupA.current = null;
+                cleanupFnA();
+              }
+              const cleanupFnB = cleanupB.current;
+              if (cleanupFnB) {
+                cleanupB.current = null;
+                cleanupFnB();
+              }
             } else {
-              cleanupA.current = applyRef(refA, current);
-              cleanupB.current = applyRef(refB, current);
+              if (refA) {
+                cleanupA.current = applyRef(refA, current);
+              }
+              if (refB) {
+                cleanupB.current = applyRef(refB, current);
+              }
             }
-          };
-        }, [refA, refB]);
+          },
+          [refA, refB]
+        );
       }
       function applyRef(refA, current) {
         if (typeof refA === "function") {
@@ -620,7 +637,7 @@
       /***/
     },
 
-    /***/ 8562: /***/ (
+    /***/ 2488: /***/ (
       __unused_webpack_module,
       __webpack_exports__,
       __webpack_require__
@@ -635,7 +652,7 @@
       /* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ =
         __webpack_require__(5105);
       /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1__ =
-        __webpack_require__(4101);
+        __webpack_require__(4779);
       /* harmony import */ var next_link__WEBPACK_IMPORTED_MODULE_1___default =
         /*#__PURE__*/ __webpack_require__.n(
           next_link__WEBPACK_IMPORTED_MODULE_1__
@@ -666,12 +683,12 @@
       /***/
     },
 
-    /***/ 4101: /***/ (
+    /***/ 4779: /***/ (
       module,
       __unused_webpack_exports,
       __webpack_require__
     ) => {
-      module.exports = __webpack_require__(3000);
+      module.exports = __webpack_require__(9400);
 
       /***/
     },
@@ -681,7 +698,7 @@
     /******/ var __webpack_exec__ = (moduleId) =>
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(0, [636, 6593, 8792], () =>
-      __webpack_exec__(3679)
+      __webpack_exec__(6613)
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for 1187-HASH.js

Diff too large to display

Diff for 8377-HASH.js
@@ -1,8 +1,8 @@
 "use strict";
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
-  [8377],
+  [2727],
   {
-    /***/ 8377: /***/ (module, exports, __webpack_require__) => {
+    /***/ 2727: /***/ (module, exports, __webpack_require__) => {
       /* __next_internal_client_entry_do_not_use__  cjs */
       Object.defineProperty(exports, "__esModule", {
         value: true,
@@ -13,27 +13,27 @@
           return Image;
         },
       });
-      const _interop_require_default = __webpack_require__(2952);
-      const _interop_require_wildcard = __webpack_require__(333);
-      const _jsxruntime = __webpack_require__(3094);
+      const _interop_require_default = __webpack_require__(384);
+      const _interop_require_wildcard = __webpack_require__(4261);
+      const _jsxruntime = __webpack_require__(7048);
       const _react = /*#__PURE__*/ _interop_require_wildcard._(
-        __webpack_require__(1446)
+        __webpack_require__(228)
       );
       const _reactdom = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(8307)
+        __webpack_require__(9221)
       );
       const _head = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(8050)
+        __webpack_require__(1116)
       );
-      const _getimgprops = __webpack_require__(3201);
-      const _imageconfig = __webpack_require__(6678);
-      const _imageconfigcontextsharedruntime = __webpack_require__(578);
-      const _warnonce = __webpack_require__(1971);
-      const _routercontextsharedruntime = __webpack_require__(7795);
+      const _getimgprops = __webpack_require__(5763);
+      const _imageconfig = __webpack_require__(6224);
+      const _imageconfigcontextsharedruntime = __webpack_require__(6720);
+      const _warnonce = __webpack_require__(894);
+      const _routercontextsharedruntime = __webpack_require__(9093);
       const _imageloader = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(1315)
+        __webpack_require__(2809)
       );
-      const _usemergedref = __webpack_require__(592);
+      const _usemergedref = __webpack_require__(1329);
       // This is replaced by webpack define plugin
       const configEnv = {
         deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
@@ -361,7 +361,7 @@
       /***/
     },
 
-    /***/ 592: /***/ (module, exports, __webpack_require__) => {
+    /***/ 1329: /***/ (module, exports, __webpack_require__) => {
       Object.defineProperty(exports, "__esModule", {
         value: true,
       });
@@ -371,24 +371,41 @@
           return useMergedRef;
         },
       });
-      const _react = __webpack_require__(1446);
+      const _react = __webpack_require__(228);
       function useMergedRef(refA, refB) {
-        const cleanupA = (0, _react.useRef)(() => {});
-        const cleanupB = (0, _react.useRef)(() => {});
-        return (0, _react.useMemo)(() => {
-          if (!refA || !refB) {
-            return refA || refB;
-          }
-          return (current) => {
+        const cleanupA = (0, _react.useRef)(null);
+        const cleanupB = (0, _react.useRef)(null);
+        // NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.
+        // (this happens often if the user doesn't pass a ref to Link/Form/Image)
+        // But this can cause us to leak a cleanup-ref into user code (e.g. via `<Link legacyBehavior>`),
+        // and the user might pass that ref into ref-merging library that doesn't support cleanup refs
+        // (because it hasn't been updated for React 19)
+        // which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.
+        // So in practice, it's safer to be defensive and always wrap the ref, even on React 19.
+        return (0, _react.useCallback)(
+          (current) => {
             if (current === null) {
-              cleanupA.current();
-              cleanupB.current();
+              const cleanupFnA = cleanupA.current;
+              if (cleanupFnA) {
+                cleanupA.current = null;
+                cleanupFnA();
+              }
+              const cleanupFnB = cleanupB.current;
+              if (cleanupFnB) {
+                cleanupB.current = null;
+                cleanupFnB();
+              }
             } else {
-              cleanupA.current = applyRef(refA, current);
-              cleanupB.current = applyRef(refB, current);
+              if (refA) {
+                cleanupA.current = applyRef(refA, current);
+              }
+              if (refB) {
+                cleanupB.current = applyRef(refB, current);
+              }
             }
-          };
-        }, [refA, refB]);
+          },
+          [refA, refB]
+        );
       }
       function applyRef(refA, current) {
         if (typeof refA === "function") {
@@ -420,7 +437,7 @@
       /***/
     },
 
-    /***/ 5318: /***/ (
+    /***/ 272: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -434,9 +451,9 @@
           return AmpStateContext;
         },
       });
-      const _interop_require_default = __webpack_require__(2952);
+      const _interop_require_default = __webpack_require__(384);
       const _react = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(1446)
+        __webpack_require__(228)
       );
       const AmpStateContext = _react.default.createContext({});
       if (false) {
@@ -445,7 +462,7 @@
       /***/
     },
 
-    /***/ 1210: /***/ (__unused_webpack_module, exports) => {
+    /***/ 1467: /***/ (__unused_webpack_module, exports) => {
       Object.defineProperty(exports, "__esModule", {
         value: true,
       });
@@ -467,7 +484,7 @@
       /***/
     },
 
-    /***/ 3201: /***/ (
+    /***/ 5763: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -481,9 +498,9 @@
           return getImgProps;
         },
       });
-      const _warnonce = __webpack_require__(1971);
-      const _imageblursvg = __webpack_require__(3482);
-      const _imageconfig = __webpack_require__(6678);
+      const _warnonce = __webpack_require__(894);
+      const _imageblursvg = __webpack_require__(5868);
+      const _imageconfig = __webpack_require__(6224);
       const VALID_LOADING_VALUES =
         /* unused pure expression or super */ null && [
           "lazy",
@@ -656,8 +673,15 @@
           };
         }
         if (typeof defaultLoader === "undefined") {
-          throw new Error(
-            "images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"
+          throw Object.defineProperty(
+            new Error(
+              "images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"
+            ),
+            "__NEXT_ERROR_CODE",
+            {
+              value: "E163",
+              enumerable: false,
+            }
           );
         }
         let loader = rest.loader || defaultLoader;
@@ -669,11 +693,18 @@
         const isDefaultLoader = "__next_img_default" in loader;
         if (isDefaultLoader) {
           if (config.loader === "custom") {
-            throw new Error(
-              'Image with src "' +
-                src +
-                '" is missing "loader" prop.' +
-                "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader"
+            throw Object.defineProperty(
+              new Error(
+                'Image with src "' +
+                  src +
+                  '" is missing "loader" prop.' +
+                  "\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader"
+              ),
+              "__NEXT_ERROR_CODE",
+              {
+                value: "E252",
+                enumerable: false,
+              }
             );
           }
         } else {
@@ -724,15 +755,29 @@
         if (isStaticImport(src)) {
           const staticImageData = isStaticRequire(src) ? src.default : src;
           if (!staticImageData.src) {
-            throw new Error(
-              "An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received " +
-                JSON.stringify(staticImageData)
+            throw Object.defineProperty(
+              new Error(
+                "An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received " +
+                  JSON.stringify(staticImageData)
+              ),
+              "__NEXT_ERROR_CODE",
+              {
+                value: "E460",
+                enumerable: false,
+              }
             );
           }
           if (!staticImageData.height || !staticImageData.width) {
-            throw new Error(
-              "An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received " +
-                JSON.stringify(staticImageData)
+            throw Object.defineProperty(
+              new Error(
+                "An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received " +
+                  JSON.stringify(staticImageData)
+              ),
+              "__NEXT_ERROR_CODE",
+              {
+                value: "E48",
+                enumerable: false,
+              }
             );
           }
           blurWidth = staticImageData.blurWidth;
@@ -863,8 +908,8 @@
       /***/
     },
 
-    /***/ 8050: /***/ (module, exports, __webpack_require__) => {
-      /* provided dependency */ var process = __webpack_require__(6611);
+    /***/ 1116: /***/ (module, exports, __webpack_require__) => {
+      /* provided dependency */ var process = __webpack_require__(9829);
       /* __next_internal_client_entry_do_not_use__  cjs */
       Object.defineProperty(exports, "__esModule", {
         value: true,
@@ -885,19 +930,19 @@
           return defaultHead;
         },
       });
-      const _interop_require_default = __webpack_require__(2952);
-      const _interop_require_wildcard = __webpack_require__(333);
-      const _jsxruntime = __webpack_require__(3094);
+      const _interop_require_default = __webpack_require__(384);
+      const _interop_require_wildcard = __webpack_require__(4261);
+      const _jsxruntime = __webpack_require__(7048);
       const _react = /*#__PURE__*/ _interop_require_wildcard._(
-        __webpack_require__(1446)
+        __webpack_require__(228)
       );
       const _sideeffect = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(4607)
+        __webpack_require__(4101)
       );
-      const _ampcontextsharedruntime = __webpack_require__(5318);
-      const _headmanagercontextsharedruntime = __webpack_require__(7060);
-      const _ampmode = __webpack_require__(1210);
-      const _warnonce = __webpack_require__(1971);
+      const _ampcontextsharedruntime = __webpack_require__(272);
+      const _headmanagercontextsharedruntime = __webpack_require__(1790);
+      const _ampmode = __webpack_require__(1467);
+      const _warnonce = __webpack_require__(894);
       function defaultHead(inAmpMode) {
         if (inAmpMode === void 0) inAmpMode = false;
         const head = [
@@ -1081,7 +1126,7 @@
       /***/
     },
 
-    /***/ 3482: /***/ (__unused_webpack_module, exports) => {
+    /***/ 5868: /***/ (__unused_webpack_module, exports) => {
       /**
        * A shared function, used on both client and server, to generate a SVG blur placeholder.
        */
@@ -1135,7 +1180,7 @@
       /***/
     },
 
-    /***/ 578: /***/ (
+    /***/ 6720: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -1149,11 +1194,11 @@
           return ImageConfigContext;
         },
       });
-      const _interop_require_default = __webpack_require__(2952);
+      const _interop_require_default = __webpack_require__(384);
       const _react = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(1446)
+        __webpack_require__(228)
       );
-      const _imageconfig = __webpack_require__(6678);
+      const _imageconfig = __webpack_require__(6224);
       const ImageConfigContext = _react.default.createContext(
         _imageconfig.imageConfigDefault
       );
@@ -1163,7 +1208,7 @@
       /***/
     },
 
-    /***/ 6678: /***/ (__unused_webpack_module, exports) => {
+    /***/ 6224: /***/ (__unused_webpack_module, exports) => {
       Object.defineProperty(exports, "__esModule", {
         value: true,
       });
@@ -1212,7 +1257,7 @@
       /***/
     },
 
-    /***/ 1315: /***/ (__unused_webpack_module, exports) => {
+    /***/ 2809: /***/ (__unused_webpack_module, exports) => {
       Object.defineProperty(exports, "__esModule", {
         value: true,
       });
@@ -1257,7 +1302,7 @@
       /***/
     },
 
-    /***/ 7795: /***/ (
+    /***/ 9093: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -1271,9 +1316,9 @@
           return RouterContext;
         },
       });
-      const _interop_require_default = __webpack_require__(2952);
+      const _interop_require_default = __webpack_require__(384);
       const _react = /*#__PURE__*/ _interop_require_default._(
-        __webpack_require__(1446)
+        __webpack_require__(228)
       );
       const RouterContext = _react.default.createContext(null);
       if (false) {
@@ -1282,7 +1327,7 @@
       /***/
     },
 
-    /***/ 4607: /***/ (
+    /***/ 4101: /***/ (
       __unused_webpack_module,
       exports,
       __webpack_require__
@@ -1296,7 +1341,7 @@
           return SideEffect;
         },
       });
-      const _react = __webpack_require__(1446);
+      const _react = __webpack_require__(228);
       const isServer = typeof window === "undefined";
       const useClientOnlyLayoutEffect = isServer
         ? () => {}
Diff for bccd1874-HASH.js

Diff too large to display

Diff for main-HASH.js

Diff too large to display

Diff for main-app-HASH.js
@@ -1,46 +1,49 @@
 (self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([
   [4977],
   {
-    /***/ 382: /***/ (
+    /***/ 199: /***/ (
       __unused_webpack_module,
       __unused_webpack_exports,
       __webpack_require__
     ) => {
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 9656, 23)
+        __webpack_require__.t.bind(__webpack_require__, 2273, 23)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 5220, 23)
+        __webpack_require__.t.bind(__webpack_require__, 1646, 23)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 6780, 23)
+        __webpack_require__.t.bind(__webpack_require__, 5802, 23)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 2020, 23)
+        __webpack_require__.t.bind(__webpack_require__, 6022, 23)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 589, 23)
+        __webpack_require__.t.bind(__webpack_require__, 3071, 23)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 9341, 23)
+        __webpack_require__.t.bind(__webpack_require__, 8099, 23)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 9497, 23)
+        __webpack_require__.t.bind(__webpack_require__, 1167, 23)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 7112, 23)
+        __webpack_require__.t.bind(__webpack_require__, 2618, 23)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 2962, 23)
+        __webpack_require__.bind(__webpack_require__, 5968)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 3017, 23)
+        __webpack_require__.t.bind(__webpack_require__, 4667, 23)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 7272, 23)
+        __webpack_require__.t.bind(__webpack_require__, 587, 23)
       );
       Promise.resolve(/* import() eager */).then(
-        __webpack_require__.t.bind(__webpack_require__, 4194, 23)
+        __webpack_require__.t.bind(__webpack_require__, 3110, 23)
+      );
+      Promise.resolve(/* import() eager */).then(
+        __webpack_require__.t.bind(__webpack_require__, 2032, 23)
       );
 
       /***/
@@ -52,8 +55,8 @@
       __webpack_require__((__webpack_require__.s = moduleId));
     /******/ __webpack_require__.O(
       0,
-      [7629, 1187],
-      () => (__webpack_exec__(7241), __webpack_exec__(382))
+      [1758, 9920],
+      () => (__webpack_exec__(8183), __webpack_exec__(199))
     );
     /******/ var __webpack_exports__ = __webpack_require__.O();
     /******/ _N_E = __webpack_exports__;
Diff for 523-experime..ntime.dev.js
deleted
Diff for 523.runtime.dev.js
deleted
Diff for app-page-exp..ntime.dev.js
failed to diff
Diff for app-page-exp..time.prod.js

Diff too large to display

Diff for app-page-tur..time.prod.js

Diff too large to display

Diff for app-page-tur..time.prod.js

Diff too large to display

Diff for app-page.runtime.dev.js
failed to diff
Diff for app-page.runtime.prod.js

Diff too large to display

Diff for app-route-ex..ntime.dev.js

Diff too large to display

Diff for app-route-ex..time.prod.js

Diff too large to display

Diff for app-route-tu..time.prod.js

Diff too large to display

Diff for app-route-tu..time.prod.js

Diff too large to display

Diff for app-route.runtime.dev.js

Diff too large to display

Diff for app-route.ru..time.prod.js

Diff too large to display

Diff for dist_client_..ntime.dev.js
@@ -0,0 +1,4 @@
+"use strict";exports.id="dist_client_dev_noop-turbopack-hmr_js",exports.ids=["dist_client_dev_noop-turbopack-hmr_js"],exports.modules={"./dist/client/dev/noop-turbopack-hmr.js":/*!***********************************************!*\
+  !*** ./dist/client/dev/noop-turbopack-hmr.js ***!
+  \***********************************************/(module,exports1)=>{function connect(){}Object.defineProperty(exports1,"__esModule",{value:!0}),Object.defineProperty(exports1,"connect",{enumerable:!0,get:function(){return connect}}),("function"==typeof exports1.default||"object"==typeof exports1.default&&null!==exports1.default)&&void 0===exports1.default.__esModule&&(Object.defineProperty(exports1.default,"__esModule",{value:!0}),Object.assign(exports1.default,exports1),module.exports=exports1.default)}};
+//# sourceMappingURL=dist_client_dev_noop-turbopack-hmr_js-experimental.runtime.dev.js.map
\ No newline at end of file
Diff for dist_client_..ntime.dev.js
@@ -0,0 +1,4 @@
+"use strict";exports.id="dist_client_dev_noop-turbopack-hmr_js",exports.ids=["dist_client_dev_noop-turbopack-hmr_js"],exports.modules={"./dist/client/dev/noop-turbopack-hmr.js":/*!***********************************************!*\
+  !*** ./dist/client/dev/noop-turbopack-hmr.js ***!
+  \***********************************************/(module,exports1)=>{function connect(){}Object.defineProperty(exports1,"__esModule",{value:!0}),Object.defineProperty(exports1,"connect",{enumerable:!0,get:function(){return connect}}),("function"==typeof exports1.default||"object"==typeof exports1.default&&null!==exports1.default)&&void 0===exports1.default.__esModule&&(Object.defineProperty(exports1.default,"__esModule",{value:!0}),Object.assign(exports1.default,exports1),module.exports=exports1.default)}};
+//# sourceMappingURL=dist_client_dev_noop-turbopack-hmr_js.runtime.dev.js.map
\ No newline at end of file
Diff for pages-api-tu..time.prod.js

Diff too large to display

Diff for pages-api.runtime.dev.js

Diff too large to display

Diff for pages-api.ru..time.prod.js

Diff too large to display

Diff for pages-turbo...time.prod.js

Diff too large to display

Diff for pages.runtime.dev.js

Diff too large to display

Diff for pages.runtime.prod.js

Diff too large to display

Diff for server.runtime.prod.js
failed to diff

Please sign in to comment.