Skip to content

Commit 57e3543

Browse files
authored
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
1 parent 2a515a3 commit 57e3543

File tree

4 files changed

+38
-12
lines changed

4 files changed

+38
-12
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ jobs:
221221
if: github.event.pull_request.draft == false
222222
name: Playwright Tests
223223
runs-on: blacksmith-8vcpu-ubuntu-2404
224+
timeout-minutes: 45
224225
strategy:
225226
matrix:
226227
platform:
@@ -286,15 +287,6 @@ jobs:
286287
args: "--all --tests",
287288
platform: "desktop",
288289
}
289-
- {
290-
target: x86_64-apple-darwin,
291-
os: macos-13,
292-
toolchain: "1.88.0",
293-
cross: false,
294-
command: "test",
295-
args: "--all --tests",
296-
platform: "desktop",
297-
}
298290
- {
299291
target: aarch64-apple-ios,
300292
os: macos-latest,

packages/fullstack-core/src/loader.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ impl<T> Readable for Loader<T> {
238238
where
239239
T: 'static,
240240
{
241-
Ok(self.peek_unchecked())
241+
Ok(self.read_value.peek_unchecked())
242242
}
243243

244244
fn subscribers(&self) -> Subscribers
@@ -263,7 +263,8 @@ where
263263
T: Clone + IntoDynNode + PartialEq + 'static,
264264
{
265265
fn into_dyn_node(self) -> dioxus_core::DynamicNode {
266-
self().into_dyn_node()
266+
let t: T = self();
267+
t.into_dyn_node()
267268
}
268269
}
269270

packages/fullstack-macro/src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1396,6 +1396,7 @@ enum Method {
13961396
Connect(Ident),
13971397
Options(Ident),
13981398
Trace(Ident),
1399+
Patch(Ident),
13991400
}
14001401

14011402
impl ToTokens for Method {
@@ -1408,7 +1409,8 @@ impl ToTokens for Method {
14081409
| Self::Head(ident)
14091410
| Self::Connect(ident)
14101411
| Self::Options(ident)
1411-
| Self::Trace(ident) => {
1412+
| Self::Trace(ident)
1413+
| Self::Patch(ident) => {
14121414
ident.to_tokens(tokens);
14131415
}
14141416
}
@@ -1444,6 +1446,7 @@ impl Method {
14441446
Self::Connect(span) => Ident::new("connect", span.span()),
14451447
Self::Options(span) => Ident::new("options", span.span()),
14461448
Self::Trace(span) => Ident::new("trace", span.span()),
1449+
Self::Patch(span) => Ident::new("patch", span.span()),
14471450
}
14481451
}
14491452

@@ -1457,6 +1460,7 @@ impl Method {
14571460
"CONNECT" => Self::Connect(Ident::new("CONNECT", Span::call_site())),
14581461
"OPTIONS" => Self::Options(Ident::new("OPTIONS", Span::call_site())),
14591462
"TRACE" => Self::Trace(Ident::new("TRACE", Span::call_site())),
1463+
"PATCH" => Self::Patch(Ident::new("PATCH", Span::call_site())),
14601464
_ => panic!("expected one of (GET, POST, PUT, DELETE, HEAD, CONNECT, OPTIONS, TRACE)"),
14611465
}
14621466
}

packages/fullstack/tests/compile-test.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,3 +342,32 @@ mod input_types {
342342
Ok(())
343343
}
344344
}
345+
346+
mod handlers {
347+
use super::*;
348+
349+
#[get("/handlers/get")]
350+
async fn handle_get() -> Result<String> {
351+
Ok("handled get".to_string())
352+
}
353+
354+
#[post("/handlers/post")]
355+
async fn handle_post() -> Result<String> {
356+
Ok("handled post".to_string())
357+
}
358+
359+
#[put("/handlers/put")]
360+
async fn handle_put() -> Result<String> {
361+
Ok("handled put".to_string())
362+
}
363+
364+
#[patch("/handlers/patch")]
365+
async fn handle_patch() -> Result<String> {
366+
Ok("handled patch".to_string())
367+
}
368+
369+
#[delete("/handlers/delete")]
370+
async fn handle_delete() -> Result<String> {
371+
Ok("handled delete".to_string())
372+
}
373+
}

0 commit comments

Comments
 (0)