🐛 (web): HttpRequest clona ahora las extensiones
Documenta el nuevo comportamiento y aprovecha para pulir varios comentarios y restringir visibilidad de símbolos internos.
This commit is contained in:
parent
370bc8ee47
commit
6f82da220b
11 changed files with 55 additions and 56 deletions
|
|
@ -119,7 +119,7 @@ impl JavaScript {
|
|||
/// Equivale a `<script>...</script>`. El parámetro `name` se usa como identificador interno del
|
||||
/// script.
|
||||
///
|
||||
/// La función *closure* recibirá el [`Context`] por si se necesita durante el renderizado.
|
||||
/// La función closure recibirá el [`Context`] por si se necesita durante el renderizado.
|
||||
pub fn inline<F>(name: impl Into<CowStr>, f: F) -> Self
|
||||
where
|
||||
F: Fn(&mut Context) -> String + Send + Sync + 'static,
|
||||
|
|
@ -139,7 +139,7 @@ impl JavaScript {
|
|||
///
|
||||
/// En condiciones normales, los scripts con `defer` se ejecutan antes de `DOMContentLoaded`.
|
||||
///
|
||||
/// La función *closure* recibirá el [`Context`] por si se necesita durante el renderizado.
|
||||
/// La función closure recibirá el [`Context`] por si se necesita durante el renderizado.
|
||||
pub fn on_load<F>(name: impl Into<CowStr>, f: F) -> Self
|
||||
where
|
||||
F: Fn(&mut Context) -> String + Send + Sync + 'static,
|
||||
|
|
@ -153,11 +153,11 @@ impl JavaScript {
|
|||
/// Crea un **script embebido** con un **handler asíncrono**.
|
||||
///
|
||||
/// El código se envuelve en un `addEventListener('DOMContentLoaded',async()=>{...})`, que
|
||||
/// emplea una función `async` para que el cuerpo devuelto por la función *closure* pueda usar
|
||||
/// emplea una función `async` para que el cuerpo devuelto por la función closure pueda usar
|
||||
/// `await`. Ideal para hidratar la interfaz, cargar módulos dinámicos o realizar lecturas
|
||||
/// iniciales.
|
||||
///
|
||||
/// La función *closure* recibirá el [`Context`] por si se necesita durante el renderizado.
|
||||
/// La función closure recibirá el [`Context`] por si se necesita durante el renderizado.
|
||||
pub fn on_load_async<F>(name: impl Into<CowStr>, f: F) -> Self
|
||||
where
|
||||
F: Fn(&mut Context) -> String + Send + Sync + 'static,
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ use crate::{AutoDefault, CowStr, Weight, util};
|
|||
// Informa al navegador de la naturaleza del recurso para que pueda asignarle la prioridad correcta
|
||||
// y aplicar la política de caché adecuada.
|
||||
#[derive(AutoDefault, Clone, Copy, Debug, PartialEq)]
|
||||
pub(crate) enum AsType {
|
||||
enum AsType {
|
||||
// Fuente web (`@font-face`). Implica `crossorigin` automático.
|
||||
#[default]
|
||||
Font,
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ impl StyleSheet {
|
|||
/// Equivale a `<style>...</style>`. El parámetro `name` se usa como identificador interno del
|
||||
/// recurso.
|
||||
///
|
||||
/// La función *closure* recibirá el [`Context`] por si se necesita durante el renderizado.
|
||||
/// La función closure recibirá el [`Context`] por si se necesita durante el renderizado.
|
||||
pub fn inline<F>(name: impl Into<CowStr>, f: F) -> Self
|
||||
where
|
||||
F: Fn(&mut Context) -> String + Send + Sync + 'static,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue