switch to a Document trait and introduce Script/Head/Style/Meta components (#2635)

* switch to a Document trait and introduce Script/Head/Style/Meta components

* Fix desktop title

* Insert special elements into the head during the inital SSR render

* Make all head component attributes optional

* hydrate head elements

* improve the server streaming head warning

* Document fullstack head hydration approach

* deduplicate head elements by href

* move Link into head::Link

* document head components

* add meta and title examples

* Fix a few doc examples

* fix formatting

* Add title to playwright tests

* serde is optional on web, but it is enabled by hydrate

* remove leftover console log
This commit is contained in:
Evan Almloff authored and GitHub committed 2024-07-17 20:54:03 -05:00
1 parent a490a94ae5
commit 176e67e5b7
65 files changed
+1703 -495

No files matched your search

+7
View File
@@ -30,12 +30,17 @@ members = [
"packages/fullstack",
"packages/server-macro",
"packages/static-generation",
"packages/lazy-js-bundle",
# Fullstack examples
"packages/fullstack/examples/axum-hello-world",
"packages/fullstack/examples/axum-router",
"packages/fullstack/examples/axum-streaming",
"packages/fullstack/examples/axum-desktop",
"packages/fullstack/examples/axum-auth",
"packages/fullstack/examples/hackernews",
# Static generation examples
"packages/static-generation/examples/simple",
"packages/static-generation/examples/router",
"packages/static-generation/examples/github-pages",
@@ -85,6 +90,7 @@ dioxus-hot-reload = { path = "packages/hot-reload", version = "0.5.0" }
dioxus-fullstack = { path = "packages/fullstack", version = "0.5.0" }
dioxus-static-site-generation = { path = "packages/static-generation", version = "0.5.0" }
dioxus_server_macro = { path = "packages/server-macro", version = "0.5.0", default-features = false }
lazy-js-bundle = { path = "packages/lazy-js-bundle", version = "0.5.0" }
tracing = "0.1.37"
tracing-futures = "0.2.5"
toml = "0.8"
@@ -173,6 +179,7 @@ reqwest = { version = "0.11.9", features = ["json"], optional = true }
http-range = { version = "0.1.5", optional = true }
ciborium = { version = "0.2.1", optional = true }
base64 = { version = "0.21.0", optional = true }
tracing-subscriber = "0.3.17"
[dev-dependencies]
dioxus = { workspace = true, features = ["router"] }