Skip to content

Commit f6568e9

Browse files
committed
feat: added support for wasm engines
BREAKING CHANGE: all target-gates should switch to `#[cfg(engine)]` and `#[cfg(client)]`, rather than using `target_arch` BREAKING CHANGE: removed nnow obsolete `#[perseus::engine]` and `#[perseus::browser]` macros
1 parent 5efcad4 commit f6568e9

File tree

100 files changed

+611
-621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+611
-621
lines changed

examples/.base/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ sycamore = "^0.8.1"
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
1313

14-
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
14+
[target.'cfg(engine)'.dev-dependencies]
1515
fantoccini = "0.17"
1616

17-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
17+
[target.'cfg(engine)'.dependencies]
1818
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1919
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2020
## the one commented out below it (changing the path dependency to the version you want to use)
2121
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2222
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2323

24-
[target.'cfg(target_arch = "wasm32")'.dependencies]
24+
[target.'cfg(client)'.dependencies]

examples/comprehensive/tiny/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ edition = "2021"
99
perseus = { path = "../../../packages/perseus" }
1010
sycamore = "^0.8.1"
1111

12-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
12+
[target.'cfg(engine)'.dependencies]
1313
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1414
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
1515
## the one commented out below it (changing the path dependency to the version you want to use)
1616
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
1717
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
1818

19-
[target.'cfg(target_arch = "wasm32")'.dependencies]
19+
[target.'cfg(client)'.dependencies]

examples/comprehensive/tiny/Cargo.toml.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ edition = "2021"
77
perseus = { version = "=0.4.0-beta.11", features = [ "hydrate" ] }
88
sycamore = "^0.8.1"
99

10-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
10+
[target.'cfg(engine)'.dependencies]
1111
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1212
perseus-warp = { version = "=0.4.0-beta.11", features = [ "dflt-server" ] }
1313

14-
[target.'cfg(target_arch = "wasm32")'.dependencies]
14+
[target.'cfg(client)'.dependencies]

examples/core/basic/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ sycamore = "^0.8.1"
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
1313

14-
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
14+
[target.'cfg(engine)'.dev-dependencies]
1515
fantoccini = "0.17"
1616

17-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
17+
[target.'cfg(engine)'.dependencies]
1818
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1919
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2020
## the one commented out below it (changing the path dependency to the version you want to use)
2121
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2222
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2323

24-
[target.'cfg(target_arch = "wasm32")'.dependencies]
24+
[target.'cfg(client)'.dependencies]

examples/core/basic/Cargo.toml.example

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ sycamore = "^0.8.1"
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
1313

14-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
14+
[target.'cfg(engine)'.dependencies]
1515
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1616
perseus-warp = { version = "=0.4.0-beta.11", features = [ "dflt-server" ] }
1717

18-
[target.'cfg(target_arch = "wasm32")'.dependencies]
18+
[target.'cfg(client)'.dependencies]

examples/core/capsules/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
1313
lazy_static = "1"
1414

15-
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
15+
[target.'cfg(engine)'.dev-dependencies]
1616
fantoccini = "0.17"
1717

18-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
18+
[target.'cfg(engine)'.dependencies]
1919
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
2020
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2121
## the one commented out below it (changing the path dependency to the version you want to use)
2222
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2323
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2424

25-
[target.'cfg(target_arch = "wasm32")'.dependencies]
25+
[target.'cfg(client)'.dependencies]

examples/core/custom_server/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ sycamore = "^0.8.1"
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
1313

14-
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
14+
[target.'cfg(engine)'.dev-dependencies]
1515
fantoccini = "0.17"
1616

17-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
17+
[target.'cfg(engine)'.dependencies]
1818
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1919
perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2020
warp = { package = "warp-fix-171", version = "0.3" } # Temporary until Warp #171 is resolved
2121

22-
[target.'cfg(target_arch = "wasm32")'.dependencies]
22+
[target.'cfg(client)'.dependencies]

examples/core/custom_server/src/main.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ use perseus::prelude::*;
44

55
// Note: we use fully-qualified paths in the types to this function so we don't
66
// have to target-gate some more imports
7-
#[cfg(not(target_arch = "wasm32"))] // We only have access to `warp` etc. on the engine-side, so this function
8-
// should only exist there
7+
#[cfg(engine)] // We only have access to `warp` etc. on the engine-side, so this function
8+
// should only exist there
99
pub async fn dflt_server<
1010
M: perseus::stores::MutableStore + 'static,
1111
T: perseus::i18n::TranslationsManager + 'static,

examples/core/error_views/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ sycamore = "^0.8.1"
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
1313

14-
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
14+
[target.'cfg(engine)'.dev-dependencies]
1515
fantoccini = "0.17"
1616

17-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
17+
[target.'cfg(engine)'.dependencies]
1818
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1919
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2020
## the one commented out below it (changing the path dependency to the version you want to use)
2121
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2222
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2323

24-
[target.'cfg(target_arch = "wasm32")'.dependencies]
24+
[target.'cfg(client)'.dependencies]

examples/core/error_views/src/templates/index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use sycamore::prelude::*;
44
fn index_page<G: Html>(cx: Scope) -> View<G> {
55
// Deliberate panic to show how panic handling works (in an `on_mount` so we
66
// still reach the right checkpoints for testing)
7-
#[cfg(target_arch = "wasm32")]
7+
#[cfg(client)]
88
on_mount(cx, || {
99
panic!();
1010
});

examples/core/freezing_and_thawing/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ serde_json = "1"
1414
[dev-dependencies]
1515
fantoccini = "0.17"
1616

17-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
17+
[target.'cfg(engine)'.dependencies]
1818
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1919
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2020
## the one commented out below it (changing the path dependency to the version you want to use)
2121
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2222
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2323

24-
[target.'cfg(target_arch = "wasm32")'.dependencies]
24+
[target.'cfg(client)'.dependencies]

examples/core/freezing_and_thawing/src/templates/about.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn about_page<G: Html>(cx: Scope) -> View<G> {
2020

2121
// We'll let the user freeze from here to demonstrate that the frozen state also navigates back to the last route
2222
button(id = "freeze_button", on:click = |_| {
23-
#[cfg(target_arch = "wasm32")]
23+
#[cfg(client)]
2424
{
2525
use perseus::state::Freeze;
2626
frozen_app.set(render_ctx.freeze());

examples/core/freezing_and_thawing/src/templates/index.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fn index_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, state: &'a IndexPageStateRx
2929
br()
3030

3131
button(id = "freeze_button", on:click = |_| {
32-
#[cfg(target_arch = "wasm32")]
32+
#[cfg(client)]
3333
{
3434
use perseus::state::Freeze;
3535
frozen_app.set(reactor.freeze());
@@ -39,7 +39,7 @@ fn index_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, state: &'a IndexPageStateRx
3939

4040
input(id = "thaw_input", bind:value = frozen_app, placeholder = "Frozen state")
4141
button(id = "thaw_button", on:click = |_| {
42-
#[cfg(target_arch = "wasm32")]
42+
#[cfg(client)]
4343
reactor.thaw(&frozen_app.get(), perseus::state::ThawPrefs {
4444
page: perseus::state::PageThawPrefs::IncludeAll,
4545
global_prefer_frozen: true

examples/core/global_state/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ serde_json = "1"
1414
[dev-dependencies]
1515
fantoccini = "0.17"
1616

17-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
17+
[target.'cfg(engine)'.dependencies]
1818
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1919
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2020
## the one commented out below it (changing the path dependency to the version you want to use)
2121
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2222
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2323

24-
[target.'cfg(target_arch = "wasm32")'.dependencies]
24+
[target.'cfg(client)'.dependencies]

examples/core/helper_build_state/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ sycamore = "^0.8.1"
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
1313

14-
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
14+
[target.'cfg(engine)'.dev-dependencies]
1515
fantoccini = "0.17"
1616

17-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
17+
[target.'cfg(engine)'.dependencies]
1818
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1919
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2020
## the one commented out below it (changing the path dependency to the version you want to use)
2121
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2222
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2323

24-
[target.'cfg(target_arch = "wasm32")'.dependencies]
24+
[target.'cfg(client)'.dependencies]

examples/core/i18n/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ urlencoding = "2.1"
1717
[dev-dependencies]
1818
fantoccini = "0.17"
1919

20-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
20+
[target.'cfg(engine)'.dependencies]
2121
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
2222
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2323
## the one commented out below it (changing the path dependency to the version you want to use)
2424
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2525
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2626

27-
[target.'cfg(target_arch = "wasm32")'.dependencies]
27+
[target.'cfg(client)'.dependencies]

examples/core/idb_freezing/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ wasm-bindgen-futures = "0.4"
1515
[dev-dependencies]
1616
fantoccini = "0.17"
1717

18-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
18+
[target.'cfg(engine)'.dependencies]
1919
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
2020
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2121
## the one commented out below it (changing the path dependency to the version you want to use)
2222
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2323
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2424

25-
[target.'cfg(target_arch = "wasm32")'.dependencies]
25+
[target.'cfg(client)'.dependencies]

examples/core/idb_freezing/src/templates/about.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ fn about_page<G: Html>(cx: Scope) -> View<G> {
2222
// We'll let the user freeze from here to demonstrate that the frozen state also navigates back to the last route
2323
button(id = "freeze_button", on:click = move |_| {
2424
// The IndexedDB API is asynchronous, so we'll spawn a future
25-
#[cfg(target_arch = "wasm32")]
25+
#[cfg(client)]
2626
spawn_local_scoped(cx, async move {
2727
use perseus::state::{IdbFrozenStateStore, Freeze};
2828
// We do this here (rather than when we get the render context) so that it's updated whenever we press the button

examples/core/idb_freezing/src/templates/index.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ fn index_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, state: &'a IndexPropsRx) ->
3232

3333
button(id = "freeze_button", on:click = move |_| {
3434
// The IndexedDB API is asynchronous, so we'll spawn a future
35-
#[cfg(target_arch = "wasm32")] // The freezing types are only available in the browser
35+
#[cfg(client)] // The freezing types are only available in the browser
3636
spawn_local_scoped(cx, async {
3737
use perseus::state::{IdbFrozenStateStore, Freeze, PageThawPrefs, ThawPrefs};
3838
// We do this here (rather than when we get the reactor) so that it's updated whenever we press the button
@@ -54,7 +54,7 @@ fn index_page<'a, G: Html>(cx: BoundedScope<'_, 'a>, state: &'a IndexPropsRx) ->
5454

5555
button(id = "thaw_button", on:click = move |_| {
5656
// The IndexedDB API is asynchronous, so we'll spawn a future
57-
#[cfg(target_arch = "wasm32")] // The freezing types are only available in the browser
57+
#[cfg(client)] // The freezing types are only available in the browser
5858
spawn_local_scoped(cx, async move {
5959
use perseus::state::{IdbFrozenStateStore, Freeze, PageThawPrefs, ThawPrefs};
6060
let idb_store = match IdbFrozenStateStore::new().await {

examples/core/index_view/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ serde_json = "1"
1414
[dev-dependencies]
1515
fantoccini = "0.17"
1616

17-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
17+
[target.'cfg(engine)'.dependencies]
1818
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1919
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2020
## the one commented out below it (changing the path dependency to the version you want to use)
2121
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2222
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2323

24-
[target.'cfg(target_arch = "wasm32")'.dependencies]
24+
[target.'cfg(client)'.dependencies]

examples/core/js_interop/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ sycamore = "^0.8.1"
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
1313

14-
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
14+
[target.'cfg(engine)'.dev-dependencies]
1515
fantoccini = "0.17"
1616

17-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
17+
[target.'cfg(engine)'.dependencies]
1818
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1919
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2020
## the one commented out below it (changing the path dependency to the version you want to use)
2121
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2222
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2323

24-
[target.'cfg(target_arch = "wasm32")'.dependencies]
24+
[target.'cfg(client)'.dependencies]
2525
wasm-bindgen = "0.2"

examples/core/js_interop/src/templates/index.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
use perseus::prelude::*;
22
use sycamore::prelude::*;
3-
#[cfg(target_arch = "wasm32")]
3+
#[cfg(client)]
44
use wasm_bindgen::prelude::wasm_bindgen;
55

66
fn index_page<G: Html>(cx: Scope) -> View<G> {
77
view! { cx,
88
// We'll use JS to change this message manually
99
p(id = "message") { "Hello World!" }
1010
button(id = "change-message", on:click = |_| {
11-
#[cfg(target_arch = "wasm32")]
11+
#[cfg(client)]
1212
change_message()
1313
}) { "Change message with JS" }
1414
}
@@ -19,7 +19,7 @@ pub fn get_template<G: Html>() -> Template<G> {
1919
}
2020

2121
// Of course, JS will only run in the browser, so this should be browser-only
22-
#[cfg(target_arch = "wasm32")]
22+
#[cfg(client)]
2323
// This path should be relative to the root of your project
2424
// That file will then be hosted behind `/.perseus/` and automatically fetched as needed
2525
#[wasm_bindgen(module = "/src/changeMessage.js")]

examples/core/plugins/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ toml = "0.5"
1515
[dev-dependencies]
1616
fantoccini = "0.17"
1717

18-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
18+
[target.'cfg(engine)'.dependencies]
1919
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
2020
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2121
## the one commented out below it (changing the path dependency to the version you want to use)
2222
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2323
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2424

25-
[target.'cfg(target_arch = "wasm32")'.dependencies]
25+
[target.'cfg(client)'.dependencies]

examples/core/preload/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ sycamore = "^0.8.1"
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
1313

14-
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
14+
[target.'cfg(engine)'.dev-dependencies]
1515
fantoccini = "0.17"
1616

17-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
17+
[target.'cfg(engine)'.dependencies]
1818
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1919
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
2020
## the one commented out below it (changing the path dependency to the version you want to use)
2121
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
2222
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2323

24-
[target.'cfg(target_arch = "wasm32")'.dependencies]
24+
[target.'cfg(client)'.dependencies]

examples/core/preload/src/templates/index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use sycamore::prelude::*;
33

44
fn index_page<G: Html>(cx: Scope) -> View<G> {
55
// We can't preload pages on the engine-side
6-
#[cfg(target_arch = "wasm32")]
6+
#[cfg(client)]
77
{
88
// Get the reactor first, which is the one-stop-shop for everything
99
// internal to Perseus in the browser

examples/core/router_state/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ sycamore = "^0.8.1"
1111
serde = { version = "1", features = ["derive"] }
1212
serde_json = "1"
1313

14-
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
14+
[target.'cfg(engine)'.dependencies]
1515
tokio = { version = "1", features = [ "macros", "rt", "rt-multi-thread" ] }
1616
## **WARNING!** Before running this example outside the Perseus repo, replace the below line with
1717
## the one commented out below it (changing the path dependency to the version you want to use)
1818
perseus-warp = { package = "perseus-integration", path = "../../../packages/perseus-integration", default-features = false }
1919
# perseus-warp = { path = "../../../packages/perseus-warp", features = [ "dflt-server" ] }
2020

21-
[target.'cfg(target_arch = "wasm32")'.dependencies]
21+
[target.'cfg(client)'.dependencies]

examples/core/router_state/src/templates/index.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use sycamore::prelude::*;
44
fn router_state_page<G: Html>(cx: Scope) -> View<G> {
55
let load_state_str = create_signal(cx, "We're on the server.".to_string());
66

7-
#[cfg(target_arch = "wasm32")]
7+
#[cfg(client)]
88
{
99
use perseus::router::RouterLoadState;
1010
let load_state = Reactor::<G>::from_cx(cx).router_state.get_load_state(cx);

0 commit comments

Comments
 (0)