Fix base path on web and fullstack (#3247)
* Create a crate for constant serialization of config structs for manganis * use SerializeConst for the image asset builder * switch to a declarative macro for assets * clean up asset macro a bit * add serializable options for each asset type * serialize const vec * Add unique path formatting * implement the new manganis macro * optimize assets in the CLI * Fix clippy * Fix assets with dioxus formattable * reduce fuzzing test limits * use the new syntax in examples * fix formatting * Final doc and test pass on const-serialize * fix avif support * Fix manganis doc tests * cache asset optimization * Split out asset and bundled asset * make hash pointer width independent * remove const serialize cargo lock * Fix manganis macro docs * all tests passing * add constvec::is_empty method to fix clippy lint * remove nasm feature * simplify test_rsplit_once test so typos passes * fix range syntax for stable * revert example change from clippy fix * remove dioxus-static-site-generation workspace dependency * always accept unix paths * fix windows path seperator * fix folder asset hash * Optimize assets in a blocking task * Fix asset options docs * Document Asset and BundledAsset * move manganis back into it's own folder * simplify the linker macro a bit * add more docs to AssetParser expansion * fix manganis core doc test * add image format helpers * Fill in new cargo.tomls * fix folders with explicit options * Split by both unix and windows path separators and take the smallest one * fix string length * Fix base path on web and fullstack * Fix assets with base path * fix fullstack base route with trailing slash * fix clippy
This commit is contained in:
1 parent
1e8693a0e8
commit
3d62fbf021
20 files changed
+254
-41
No files matched your search
@@ -29,6 +29,7 @@ dioxus-ssr = { workspace = true, optional = true }
|
||||
manganis = { workspace = true, features = ["dioxus"], optional = true }
|
||||
|
||||
serde = { version = "1.0.136", optional = true }
|
||||
dioxus-cli-config = { workspace = true, optional = true }
|
||||
|
||||
[target.'cfg(not(any(target_arch = "wasm32", target_os = "ios", target_os = "android")))'.dependencies]
|
||||
dioxus-devtools = { workspace = true, optional = true }
|
||||
@@ -53,7 +54,7 @@ router = ["dep:dioxus-router"]
|
||||
fullstack = ["dep:dioxus-fullstack", "dioxus-config-macro/fullstack", "dep:serde"]
|
||||
desktop = ["dep:dioxus-desktop", "dioxus-fullstack?/desktop", "dioxus-config-macro/desktop"]
|
||||
mobile = ["dep:dioxus-mobile", "dioxus-fullstack?/mobile", "dioxus-config-macro/mobile"]
|
||||
web = ["dep:dioxus-web", "dioxus-fullstack?/web", "dioxus-config-macro/web"]
|
||||
web = ["dep:dioxus-web", "dioxus-fullstack?/web", "dioxus-config-macro/web", "dioxus-cli-config", "dioxus-cli-config/web"]
|
||||
ssr = ["dep:dioxus-ssr", "dioxus-config-macro/ssr"]
|
||||
liveview = ["dep:dioxus-liveview", "dioxus-config-macro/liveview"]
|
||||
server = ["dioxus-fullstack?/axum", "dioxus-fullstack?/server", "ssr", "dioxus-liveview?/axum"]
|
||||
|
||||
@@ -274,6 +274,19 @@ fn web_launch(
|
||||
.unwrap_or_default()
|
||||
.hydrate(true);
|
||||
|
||||
// If there is a base path set, call server functions from that base path
|
||||
if let Some(base_path) = dioxus_cli_config::web_base_path() {
|
||||
let base_path = base_path.trim_matches('/');
|
||||
crate::prelude::server_fn::client::set_server_url(
|
||||
format!(
|
||||
"{}/{}",
|
||||
crate::prelude::server_fn::client::get_server_url(),
|
||||
base_path
|
||||
)
|
||||
.leak(),
|
||||
);
|
||||
}
|
||||
|
||||
let factory = move || {
|
||||
let mut vdom = dioxus_core::VirtualDom::new(root);
|
||||
for context in contexts {
|
||||
|
||||
Reference in new issue
Block a user