Skip to content

Commit 0d8aa3b

Browse files
committed
integrate wasm_split_helpers directly into yew
makes it possible to implement a helper macro without the user pulling in an extra dependency and has tighter version requirements.
1 parent 8445ad5 commit 0d8aa3b

6 files changed

Lines changed: 10 additions & 10 deletions

File tree

Cargo.lock

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/split-wasm/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ license = "MIT OR Apache-2.0"
88
[dependencies]
99
async-once-cell = "0.5.3"
1010
yew = { path = "../../packages/yew", features = ["csr"] }
11-
wasm_split_helpers = "0.2.0-rc.1"
1211
wasm-bindgen = "*"
1312
wasm-bindgen-futures = "*"
1413

examples/split-wasm/build.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ GLOBIGNORE=".:.."
2020
rm -rf dist/*
2121
mkdir dist/.stage
2222
(
23-
cd ~/recreational/src/wasm-split-prototype/
24-
cargo run --features="build-binary" -- --verbose "$TARGET_DIR/wasm32-unknown-unknown/${PROFILE}/split-wasm.wasm" "$THIS_DIR"/dist/.stage/ \
23+
wasm_split_cli --verbose "$TARGET_DIR/wasm32-unknown-unknown/${PROFILE}/split-wasm.wasm" "$THIS_DIR"/dist/.stage/ \
2524
> "$THIS_DIR"/dist/.stage/split.log
2625
)
2726
echo "running wasm-bindgen"

examples/split-wasm/src/yew.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use std::future::{pending, Future};
22

3-
use wasm_split_helpers::wasm_split as split;
43
use web_sys::HtmlInputElement;
54
use yew::lazy::declare_lazy_component;
65
use yew::prelude::*;

packages/yew/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ serde = { version = "1", features = ["derive"] }
3434
tracing = "0.1.40"
3535
tokise = "0.2.0"
3636
rustversion = "1"
37+
wasm_split_helpers = "0.2.0-rc.2"
3738
async-once-cell = "0.5.3"
3839

3940
[target.'cfg(target_arch = "wasm32")'.dependencies]

packages/yew/src/lazy.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ macro_rules! __declare_lazy_component {
190190
type Underlying = $comp;
191191

192192
async fn fetch() -> ::yew::lazy::LazyVTable<Self::Underlying> {
193-
#[split($module)]
193+
#[$crate::lazy::wasm_split::wasm_split($module, wasm_split_path = $crate::lazy::wasm_split)]
194194
fn split_fetch() -> ::yew::lazy::LazyVTable<$comp> {
195195
::yew::lazy::LazyVTable::<$comp>::vtable()
196196
}
@@ -227,5 +227,7 @@ macro_rules! __declare_lazy_component {
227227
}
228228
#[doc(hidden)]
229229
pub use ::async_once_cell::Lazy as LazyCell;
230+
#[doc(hidden)]
231+
pub use ::wasm_split_helpers as wasm_split;
230232

231233
pub use crate::__declare_lazy_component as declare_lazy_component;

0 commit comments

Comments
 (0)