🎨 Convierte el ciclo de renderizado en async
`prepare()` de `Component`, `render()` de `Region` y `Template`, y la implementación de `ComponentRender` pasan a ser funciones async. Se actualizan todos los componentes base, helpers, tests y ejemplos.
This commit is contained in:
parent
9acd8cc51a
commit
9354894b3a
48 changed files with 436 additions and 365 deletions
|
|
@ -5,6 +5,7 @@ include_locales!(LOC from "examples/locale");
|
|||
|
||||
struct FormControls;
|
||||
|
||||
#[async_trait]
|
||||
impl Extension for FormControls {
|
||||
fn dependencies(&self) -> Vec<ExtensionRef> {
|
||||
vec![&pagetop_aliner::Aliner, &pagetop_bootsier::Bootsier]
|
||||
|
|
@ -297,6 +298,7 @@ async fn form_controls(request: HttpRequest) -> Result<Markup, ErrorPage> {
|
|||
),
|
||||
)
|
||||
.render()
|
||||
.await
|
||||
}
|
||||
|
||||
fn form_lists() -> Form {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ use pagetop::prelude::*;
|
|||
|
||||
struct HelloName;
|
||||
|
||||
#[async_trait]
|
||||
impl Extension for HelloName {
|
||||
fn configure_router(&self, router: Router) -> Router {
|
||||
router.route("/hello/{name}", web::get(hello_name))
|
||||
|
|
@ -19,6 +20,7 @@ async fn hello_name(
|
|||
}
|
||||
}))
|
||||
.render()
|
||||
.await
|
||||
}
|
||||
|
||||
#[pagetop::main]
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ use pagetop::prelude::*;
|
|||
|
||||
struct HelloWorld;
|
||||
|
||||
#[async_trait]
|
||||
impl Extension for HelloWorld {
|
||||
fn configure_router(&self, router: Router) -> Router {
|
||||
router.route("/", web::get(hello_world))
|
||||
|
|
@ -16,6 +17,7 @@ async fn hello_world(request: HttpRequest) -> Result<Markup, ErrorPage> {
|
|||
}
|
||||
}))
|
||||
.render()
|
||||
.await
|
||||
}
|
||||
|
||||
#[pagetop::main]
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ include_locales!(LOC from "examples/locale");
|
|||
|
||||
struct IntroColors;
|
||||
|
||||
#[async_trait]
|
||||
impl Extension for IntroColors {
|
||||
fn configure_router(&self, router: Router) -> Router {
|
||||
router.route("/", web::get(intro_colors))
|
||||
|
|
@ -74,6 +75,7 @@ async fn intro_colors(request: HttpRequest) -> Result<Markup, ErrorPage> {
|
|||
),
|
||||
)
|
||||
.render()
|
||||
.await
|
||||
}
|
||||
|
||||
#[pagetop::main]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue