From 2c2e46085e55da8d3610902de7c6e0270f063e41 Mon Sep 17 00:00:00 2001 From: arctic_hen7 Date: Tue, 15 Feb 2022 20:01:21 +1100 Subject: [PATCH] fix: fixed actix web beta issues Fixes #125. --- examples/basic/.perseus/server/Cargo.toml | 6 ++++-- packages/perseus-actix-web/Cargo.toml | 7 ++++--- packages/perseus/src/html_shell.rs | 3 +-- packages/perseus/src/server/build_error_page.rs | 3 +-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/examples/basic/.perseus/server/Cargo.toml b/examples/basic/.perseus/server/Cargo.toml index eac17858f9..b4e174c928 100644 --- a/examples/basic/.perseus/server/Cargo.toml +++ b/examples/basic/.perseus/server/Cargo.toml @@ -13,7 +13,9 @@ perseus = { path = "../../../../packages/perseus", features = [ "server-side" ] perseus-actix-web = { path = "../../../../packages/perseus-actix-web", optional = true } perseus-warp = { path = "../../../../packages/perseus-warp", optional = true } perseus-engine = { path = "../" } -actix-web = { version = "=4.0.0-beta.15", optional = true } +actix-web = { version = "=4.0.0-rc.3", optional = true } +actix-http = { version = "=3.0.0-rc.2", optional = true } # Without this, Actix can introduce breaking changes in a dependency tree +# actix-router = { version = "=0.5.0-rc.3", optional = true } futures = "0.3" warp = { package = "warp-fix-171", version = "0.3", optional = true } # TODO Choose features here @@ -21,7 +23,7 @@ tokio = { version = "1", optional = true, features = [ "macros", "rt-multi-threa # This binary can use any of the server integrations [features] -integration-actix-web = [ "perseus-actix-web", "actix-web" ] +integration-actix-web = [ "perseus-actix-web", "actix-web", "actix-http" ] integration-warp = [ "perseus-warp", "warp", "tokio" ] default = [ "integration-warp" ] diff --git a/packages/perseus-actix-web/Cargo.toml b/packages/perseus-actix-web/Cargo.toml index 119c210888..8aa62a0a51 100644 --- a/packages/perseus-actix-web/Cargo.toml +++ b/packages/perseus-actix-web/Cargo.toml @@ -15,9 +15,10 @@ categories = ["wasm", "web-programming::http-server", "development-tools", "asyn [dependencies] perseus = { path = "../perseus", version = "0.3.2" } -actix-web = "=4.0.0-beta.15" -actix-http = "=3.0.0-beta.16" # Without this, Actix can introduce breaking changes in a dependency tree -actix-files = "=0.6.0-beta.10" +actix-web = "=4.0.0-rc.3" +actix-http = "=3.0.0-rc.2" # Without this, Actix can introduce breaking changes in a dependency tree +# actix-router = "=0.5.0-rc.3" +actix-files = "=0.6.0-beta.16" urlencoding = "2.1" serde = "1" serde_json = "1" diff --git a/packages/perseus/src/html_shell.rs b/packages/perseus/src/html_shell.rs index ce4713cab1..7ef5523222 100644 --- a/packages/perseus/src/html_shell.rs +++ b/packages/perseus/src/html_shell.rs @@ -91,8 +91,7 @@ pub fn interpolate_page_data(html_shell: &str, page_data: &PageData, root_id: &s let html_replacement = format!( // We give the content a specific ID so that it can be deleted if an error page needs to be rendered on the client-side "{}
{}
", - &html_to_replace_double, - &page_data.content + &html_to_replace_double, &page_data.content ); // Now interpolate that HTML into the HTML shell html_with_state diff --git a/packages/perseus/src/server/build_error_page.rs b/packages/perseus/src/server/build_error_page.rs index 6fcc63b47c..677018dfab 100644 --- a/packages/perseus/src/server/build_error_page.rs +++ b/packages/perseus/src/server/build_error_page.rs @@ -43,8 +43,7 @@ pub fn build_error_page( let html_replacement = format!( // We give the content a specific ID so that it can be hydrated properly "{}
{}
", - &html_to_replace_double, - &error_html + &html_to_replace_double, &error_html ); // Now interpolate that HTML into the HTML shell html_with_declaration