Skip to content

Commit fbc8628

Browse files
Deprecate redundant render_app_async_stream_with_context method
1 parent cddb24e commit fbc8628

File tree

1 file changed

+4
-27
lines changed

1 file changed

+4
-27
lines changed

integrations/axum/src/lib.rs

Lines changed: 4 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ where
684684
additional_context.clone(),
685685
app_fn.clone(),
686686
);
687-
let asyn = render_app_async_stream_with_context(
687+
let asyn = render_app_async_with_context(
688688
additional_context.clone(),
689689
app_fn.clone(),
690690
);
@@ -1059,6 +1059,7 @@ where
10591059
feature = "tracing",
10601060
tracing::instrument(level = "trace", fields(error), skip_all)
10611061
)]
1062+
#[deprecated = "Use `render_app_async_with_context` instead"]
10621063
pub fn render_app_async_stream_with_context<IV>(
10631064
additional_context: impl Fn() + 'static + Clone + Send + Sync,
10641065
app_fn: impl Fn() -> IV + Clone + Send + Sync + 'static,
@@ -1071,19 +1072,7 @@ pub fn render_app_async_stream_with_context<IV>(
10711072
where
10721073
IV: IntoView + 'static,
10731074
{
1074-
handle_response(additional_context, app_fn, |app, chunks, _supports_ooo| {
1075-
Box::pin(async move {
1076-
let app = if cfg!(feature = "islands-router") {
1077-
app.to_html_stream_in_order_branching()
1078-
} else {
1079-
app.to_html_stream_in_order()
1080-
};
1081-
let app = app.collect::<String>().await;
1082-
let chunks = chunks();
1083-
Box::pin(once(async move { app }).chain(chunks))
1084-
as PinnedStream<String>
1085-
})
1086-
})
1075+
render_app_async_with_context(additional_context, app_fn)
10871076
}
10881077

10891078
/// Returns an Axum [Handler](axum::handler::Handler) that listens for a `GET` request and tries
@@ -2059,19 +2048,7 @@ where
20592048
},
20602049
move || shell(options),
20612050
req,
2062-
|app, chunks, _supports_ooo| {
2063-
Box::pin(async move {
2064-
let app = if cfg!(feature = "islands-router") {
2065-
app.to_html_stream_in_order_branching()
2066-
} else {
2067-
app.to_html_stream_in_order()
2068-
};
2069-
let app = app.collect::<String>().await;
2070-
let chunks = chunks();
2071-
Box::pin(once(async move { app }).chain(chunks))
2072-
as PinnedStream<String>
2073-
})
2074-
},
2051+
async_stream_builder,
20752052
)
20762053
.await;
20772054

0 commit comments

Comments
 (0)