Skip to content

Commit 834e451

Browse files
authored
Deprecate SsrHtmlTag component (#210)
1 parent 1754c66 commit 834e451

File tree

9 files changed

+235
-125
lines changed

9 files changed

+235
-125
lines changed

.pre-commit-config.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ repos:
5353
clippy::uninlined_format_args,
5454
-D,
5555
clippy::semicolon_if_nothing_returned,
56+
-A,
57+
deprecated,
5658
]
5759
- id: clippy
5860
alias: clippy-hydrate
@@ -75,6 +77,8 @@ repos:
7577
clippy::uninlined_format_args,
7678
-D,
7779
clippy::semicolon_if_nothing_returned,
80+
-A,
81+
deprecated,
7882
]
7983
- id: clippy
8084
alias: clippy-ssr-actix
@@ -99,6 +103,8 @@ repos:
99103
clippy::uninlined_format_args,
100104
-D,
101105
clippy::semicolon_if_nothing_returned,
106+
-A,
107+
deprecated,
102108
]
103109
- id: clippy
104110
alias: clippy-ssr-axum
@@ -123,6 +129,8 @@ repos:
123129
clippy::uninlined_format_args,
124130
-D,
125131
clippy::semicolon_if_nothing_returned,
132+
-A,
133+
deprecated,
126134
]
127135
- repo: https://github.com/mondeja/rust-pc-hooks
128136
rev: v1.1.0

CHANGELOG.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# CHANGELOG
22

3-
## Unreleased - [0.1.14]
3+
## 2024-08-14 - [0.1.14]
4+
5+
### Enhancements
6+
7+
- Deprecate `SsrHtmlTag` component. The `sync_html_tag_lang` and
8+
`sync_html_tag_dir` parameters of `leptos_fluent!` macro are enough to sync
9+
the `<html>` tag attributes with the current language and direction on SSR.
10+
Will be removed on v0.2.
411

512
## 2024-08-11 - [0.1.13]
613

@@ -450,7 +457,7 @@ version to `0.1` during installation.
450457

451458
- Added all ISO-639-1 and ISO-639-2 languages.
452459

453-
[0.1.14]: https://github.com/mondeja/leptos-fluent/compare/v0.1.13...master
460+
[0.1.14]: https://github.com/mondeja/leptos-fluent/compare/v0.1.13...v0.1.14
454461
[0.1.13]: https://github.com/mondeja/leptos-fluent/compare/v0.1.12...v0.1.13
455462
[0.1.12]: https://github.com/mondeja/leptos-fluent/compare/v0.1.11...v0.1.12
456463
[0.1.11]: https://github.com/mondeja/leptos-fluent/compare/v0.1.10...v0.1.11

Cargo.lock

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

book/src/faqs.md

-25
Original file line numberDiff line numberDiff line change
@@ -132,30 +132,6 @@ fn render_language(lang: &'static Language) -> impl IntoView {
132132
}
133133
```
134134

135-
### How to change `<html>` attributes on SSR
136-
137-
Use the component [`leptos_fluent::SsrHtmlTag`]:
138-
139-
```rust
140-
use leptos::*;
141-
use leptos_fluent::{leptos_fluent, SsrHtmlTag};
142-
143-
#[component]
144-
pub fn App() -> impl IntoView {
145-
leptos_fluent! {{
146-
// ...
147-
}};
148-
149-
view! {
150-
<SsrHtmlTag/>
151-
<LanguageSelector/>
152-
}
153-
}
154-
155-
#[component]
156-
fn LanguageSelector() -> impl IntoView { ... }
157-
```
158-
159135
### How to get values of `leptos_fluent!` macro at runtime?
160136

161137
Use `provide_meta_context` at the macro initialization and get them
@@ -184,6 +160,5 @@ leptos_fluent! {{
184160

185161
[configuration conditional checks]: https://doc.rust-lang.org/rust-by-example/attribute/cfg.html
186162
[`<For/>`]: https://docs.rs/leptos/latest/leptos/fn.For.html
187-
[`leptos_fluent::SsrHtmlTag`]: https://docs.rs/leptos-fluent/latest/leptos_fluent/fn.SsrHtmlTag.html
188163
[`leptos_fluent::Language`]: https://docs.rs/leptos-fluent/latest/leptos_fluent/struct.Language.html
189164
[`I18n`]: https://docs.rs/leptos-fluent/latest/leptos_fluent/struct.I18n.html

examples/ssr-hydrate-axum/src/app.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use fluent_templates::once_cell::sync::Lazy;
33
use fluent_templates::static_loader;
44
use fluent_templates::StaticLoader;
55
use leptos::*;
6-
use leptos_fluent::{expect_i18n, leptos_fluent, move_tr, tr, SsrHtmlTag};
6+
use leptos_fluent::{expect_i18n, leptos_fluent, move_tr, tr};
77
use leptos_meta::*;
88
use leptos_router::*;
99

@@ -18,7 +18,6 @@ pub static COMPOUND: &[&Lazy<StaticLoader>] = &[&TRANSLATIONS, &TRANSLATIONS];
1818

1919
#[component]
2020
pub fn App() -> impl IntoView {
21-
provide_meta_context();
2221
leptos_fluent! {{
2322
translations: [TRANSLATIONS, TRANSLATIONS] + COMPOUND,
2423
locales: "./locales",
@@ -45,7 +44,6 @@ pub fn App() -> impl IntoView {
4544
}};
4645

4746
view! {
48-
<SsrHtmlTag/>
4947
<Title text=move || tr!("welcome-to-leptos")/>
5048

5149
// content for this welcome page

leptos-fluent-macros/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "leptos-fluent-macros"
33
description = "Macros for leptos-fluent"
44
edition.workspace = true
5-
version = "0.1.13"
5+
version = "0.1.14"
66
license = "MIT"
77
documentation.workspace = true
88
repository.workspace = true

0 commit comments

Comments
 (0)