1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
//! The Leptos layer: how a description renders — in text, attributes and
//! props — together with the catalog of the request or of the page, the live
//! locale switch, `<html lang dir>`, the page's i18n components and the
//! reader's time zone for dates.
//!
//! # Modes and Leptos lines
//!
//! An application turns on exactly one mode — `ssr` in the server's build,
//! `hydrate` in the client's (`csr` for a client-only application) — and a
//! Leptos line: `leptos` (Leptos 0.9, the default line) or `leptos-0-8`. It
//! writes the line once, on its `mf2` dependency, and the mode where it
//! writes Leptos's own:
//!
//! ```toml
//! [dependencies]
//! mf2 = { version = "2", features = ["leptos"] }
//!
//! [features]
//! ssr = ["leptos/ssr", "mf2/ssr"]
//! hydrate = ["leptos/hydrate", "mf2/hydrate"]
//! ```
//!
//! The modes exclude each other, so this documentation shows one: **`ssr`,
//! on Leptos 0.9**. The client modes add:
//!
//! | Mode | Adds |
//! |---|---|
//! | `hydrate` or `csr` | the active catalog's change notifier: `changed`, `set_active`, `track_locale`; the boot and the locale switch: `catalog_url`, `document_locale`, `load_page_catalog`, `preload_locale`, `set_document_lang`, `set_locale` |
//! | `hydrate` | `hydrate_body`, `hydrate_lazy`, `hydrate_islands`, `wait_for_catalog`; [`islands_gate!`] expands to the islands' gate (with `ssr`, to nothing) |
//! | `csr` | `client_locale`, `load_client_catalog`, `mount_to_body` |
//!
//! and lack what only a server has: [`RequestI18n`], [`catalog`],
//! [`default_catalog`], [`provide_locale`], [`provide_locale_in_zone`],
//! [`request_time_zone`].
//!
//! `static-locale` makes a switch a navigation (for islands), and
//! `mark-fallback-lang` marks text borrowed from a fallback language with
//! its own `lang`.
//!
//! # Importing from here
//!
//! Import items from `mf2::leptos` (`use mf2::leptos::{LocaleSwitcher,
//! LocaleOption};`) or write their full paths. Never `use mf2::leptos;` in a
//! module that also uses the `leptos` crate: the module's name would then
//! shadow the crate's in every bare path of that module.
//!
//! Client-path code: `forbid(unsafe_code)`, no `core::fmt`, no panicking
//! operation.
// Where the catalog lives, and how a description is formatted from it.
pub
pub
pub
// The client's boot and switch.
pub
pub
/// Everything that names tachys, in one module for every supported line.
pub
/// The names the page carries, shared by the shell, the boot and
/// `mf2::axum`: the wire between them, not an application's.
pub
pub
pub
pub
pub
pub use ;
/// The view closure a rich call site writes, and the flat handler
/// conformance L6 compares against `expParts`.
pub use ;
/// A signal as an argument, read when the message formats.
pub use ;
/// [`lookup_locale`] over a reader's list: what `mf2::axum` negotiates each
/// source's candidates with.
pub use best_locale;
/// What an application installs once, and what it can ask about the build.
pub use ;
/// Whether [`install`] ran, and ran more than once: for the library's tests.
pub use ;
pub use crateLoadError;
/// The catalog a render reads, and what can go wrong loading one.
pub use ;
/// The table of catalogs the server serves, which `mf2::axum` installs and
/// reads.
pub use ;
/// The server's catalogs and per-request locale.
pub use ;
/// The reader's time zone: whether a name the browser or the `mf2_tz`
/// cookie gave can be used.
pub use reader_time_zone;
/// The client's active catalog and its change notifier.
pub use ;
/// The client's boot and locale switch.
pub use ;
/// Booting a client-only application: the locale from storage, then
/// `navigator.languages`, then the default; the catalog from the index.
pub use ;
/// Booting an application that hydrates, in each of its three shapes: a
/// whole page, a page with code-split routes, and a page of islands.
pub use ;
/// What [`islands_gate!`] expands to names these, so that an application
/// needs no direct dependency on them.
/// Exports the island [`IslandsGate`] renders, in the application's crate
/// (this one forbids the `unsafe` a `#[wasm_bindgen]` export expands to).
/// Write it once, beside the `hydrate` entry point:
///
/// ```ignore
/// mf2::leptos::islands_gate!();
/// ```
///
/// It expands to nothing in a server build.
pub use crate__islands_gate as islands_gate;
/// How many nodes follow the locale — the number the browser checks read to
/// know that hydration finished and that dropped nodes freed their slots.
pub use live_nodes;
/// What the four call-site types have in common, which is what the
/// rendering is written against.
pub use ;
/// The retained view state of a rendered description.
pub use ;