From 57e3543c6475b5f6af066774d2152a6dd6351196 Mon Sep 17 00:00:00 2001 From: Jonathan Kelley Date: Tue, 11 Nov 2025 12:37:19 -0300 Subject: [PATCH] fix a few small bugs (#4955) * add `Patch` endpoint * fix stack overflow on loader * add timeout to playwright * 45 min * remove macos x86 from runners --- .github/workflows/main.yml | 10 +------- packages/fullstack-core/src/loader.rs | 5 ++-- packages/fullstack-macro/src/lib.rs | 6 ++++- packages/fullstack/tests/compile-test.rs | 29 ++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d71838d8a..215ee2015 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -221,6 +221,7 @@ jobs: if: github.event.pull_request.draft == false name: Playwright Tests runs-on: blacksmith-8vcpu-ubuntu-2404 + timeout-minutes: 45 strategy: matrix: platform: @@ -286,15 +287,6 @@ jobs: args: "--all --tests", platform: "desktop", } - - { - target: x86_64-apple-darwin, - os: macos-13, - toolchain: "1.88.0", - cross: false, - command: "test", - args: "--all --tests", - platform: "desktop", - } - { target: aarch64-apple-ios, os: macos-latest, diff --git a/packages/fullstack-core/src/loader.rs b/packages/fullstack-core/src/loader.rs index 8a4a6b23a..a1c84df52 100644 --- a/packages/fullstack-core/src/loader.rs +++ b/packages/fullstack-core/src/loader.rs @@ -238,7 +238,7 @@ impl Readable for Loader { where T: 'static, { - Ok(self.peek_unchecked()) + Ok(self.read_value.peek_unchecked()) } fn subscribers(&self) -> Subscribers @@ -263,7 +263,8 @@ where T: Clone + IntoDynNode + PartialEq + 'static, { fn into_dyn_node(self) -> dioxus_core::DynamicNode { - self().into_dyn_node() + let t: T = self(); + t.into_dyn_node() } } diff --git a/packages/fullstack-macro/src/lib.rs b/packages/fullstack-macro/src/lib.rs index 675a19406..a60e1aa5f 100644 --- a/packages/fullstack-macro/src/lib.rs +++ b/packages/fullstack-macro/src/lib.rs @@ -1396,6 +1396,7 @@ enum Method { Connect(Ident), Options(Ident), Trace(Ident), + Patch(Ident), } impl ToTokens for Method { @@ -1408,7 +1409,8 @@ impl ToTokens for Method { | Self::Head(ident) | Self::Connect(ident) | Self::Options(ident) - | Self::Trace(ident) => { + | Self::Trace(ident) + | Self::Patch(ident) => { ident.to_tokens(tokens); } } @@ -1444,6 +1446,7 @@ impl Method { Self::Connect(span) => Ident::new("connect", span.span()), Self::Options(span) => Ident::new("options", span.span()), Self::Trace(span) => Ident::new("trace", span.span()), + Self::Patch(span) => Ident::new("patch", span.span()), } } @@ -1457,6 +1460,7 @@ impl Method { "CONNECT" => Self::Connect(Ident::new("CONNECT", Span::call_site())), "OPTIONS" => Self::Options(Ident::new("OPTIONS", Span::call_site())), "TRACE" => Self::Trace(Ident::new("TRACE", Span::call_site())), + "PATCH" => Self::Patch(Ident::new("PATCH", Span::call_site())), _ => panic!("expected one of (GET, POST, PUT, DELETE, HEAD, CONNECT, OPTIONS, TRACE)"), } } diff --git a/packages/fullstack/tests/compile-test.rs b/packages/fullstack/tests/compile-test.rs index 0534f6967..edf48a449 100644 --- a/packages/fullstack/tests/compile-test.rs +++ b/packages/fullstack/tests/compile-test.rs @@ -342,3 +342,32 @@ mod input_types { Ok(()) } } + +mod handlers { + use super::*; + + #[get("/handlers/get")] + async fn handle_get() -> Result { + Ok("handled get".to_string()) + } + + #[post("/handlers/post")] + async fn handle_post() -> Result { + Ok("handled post".to_string()) + } + + #[put("/handlers/put")] + async fn handle_put() -> Result { + Ok("handled put".to_string()) + } + + #[patch("/handlers/patch")] + async fn handle_patch() -> Result { + Ok("handled patch".to_string()) + } + + #[delete("/handlers/delete")] + async fn handle_delete() -> Result { + Ok("handled delete".to_string()) + } +}