Skip to content

Commit c3da4f6

Browse files
committed
Merge branch 'master' of https://github.com/erichulburd/js-framework-benchmark into erichulburd-master
2 parents c59b493 + 8074e07 commit c3da4f6

File tree

14 files changed

+2020
-0
lines changed

14 files changed

+2020
-0
lines changed

frameworks/keyed/dioxus/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
/target

frameworks/keyed/dioxus/Cargo.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[package]
2+
name = "dioxus_benchmark"
3+
version = "0.1.0"
4+
edition = "2021"
5+
6+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+
[dependencies]
9+
dioxus = { version = "0.2.4", features = ["web"] }
10+
getrandom = { version = "0.2.6", features = ["js"] }
11+
rand = { version = "0.8.5", features = ["small_rng"] }
12+
13+
wasm-bindgen = { version = "*", features = ["enable-interning"] }
14+
[profile.release]
15+
opt-level = "s"
16+
lto = true
17+
codegen-units = 1

frameworks/keyed/dioxus/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Because of the heavy amount of Rust dependencies, this example is pre-compiled, so you don't need to compile anything.
2+
3+
However, if you do want to compile it, you will need the following:
4+
5+
* [Rust](https://www.rust-lang.org/tools/install)
6+
7+
After installing that, run these commands:
8+
9+
```
10+
npm install
11+
npm run build-prod-force
12+
```

frameworks/keyed/dioxus/build.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
sed -i.bak "s/dioxus_benchmark-.+\.js/dioxus_benchmark.js/g" index.html
6+
sed -i.bak "s/dioxus_benchmark-.+\.wasm/dioxus_benchmark_bg.wasm/g" index.html
7+
rm index.html.bak
8+
9+
HASH=$(uuidgen)
10+
trunk build --release
11+
12+
echo "$HASH"
13+
14+
mv bundled-dist/dioxus_benchmark.js "bundled-dist/dioxus_benchmark-$HASH.js"
15+
mv bundled-dist/dioxus_benchmark_bg.wasm bundled-dist/dioxus_benchmark-"$HASH"_bg.wasm
16+
17+
sed -i.bak "s/dioxus_benchmark/dioxus_benchmark-$HASH/g" bundled-dist/index.html
18+
rm bundled-dist/index.html.bak
19+
20+
mv bundled-dist/index.html index.html

0 commit comments

Comments
 (0)