Skip to content

Commit

Permalink
fix: fixed actix web beta issues
Browse files Browse the repository at this point in the history
Fixes #125.
  • Loading branch information
arctic-hen7 committed Feb 15, 2022
1 parent ceca773 commit 2c2e460
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
6 changes: 4 additions & 2 deletions examples/basic/.perseus/server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,17 @@ 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
tokio = { version = "1", optional = true, features = [ "macros", "rt-multi-thread" ] } # We don't need this for Actix Web

# 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" ]
Expand Down
7 changes: 4 additions & 3 deletions packages/perseus-actix-web/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions packages/perseus/src/html_shell.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
"{}<div id=\"__perseus_content_initial\" class=\"__perseus_content\">{}</div>",
&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
Expand Down
3 changes: 1 addition & 2 deletions packages/perseus/src/server/build_error_page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
"{}<div id=\"__perseus_content_initial\" class=\"__perseus_content\">{}</div>",
&html_to_replace_double,
&error_html
&html_to_replace_double, &error_html
);
// Now interpolate that HTML into the HTML shell
html_with_declaration
Expand Down

0 comments on commit 2c2e460

Please sign in to comment.