Skip to content

Commit f61661f

Browse files
committed
Merge branch 'simi' of https://github.com/limira/js-framework-benchmark into limira-simi
2 parents 6c425a6 + 7d57d93 commit f61661f

File tree

10 files changed

+903
-0
lines changed

10 files changed

+903
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
output_path = "."
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[package]
2+
name = "js-framework-benchmark-simi"
3+
version = "0.1.0"
4+
authors = ["Limira"]
5+
edition = "2018"
6+
7+
[lib]
8+
crate-type = ["cdylib"]
9+
10+
[dependencies]
11+
wasm-bindgen = "0.2.29"
12+
rand = { version="0.6.1", features=["wasm-bindgen"] }
13+
simi = { git = "https://gitlab.com/limira-rs/simi.git", rev = "3b7e8e0cf06a20e9ae6f1cc1fd6f598f867e6695" }
14+
15+
[profile.release]
16+
lto = true

frameworks/non-keyed/simi/build.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
(async () => {
2+
const spawnSync = require('child_process').spawnSync
3+
4+
function spawnSyncOrThrow() {
5+
const result = spawnSync(...arguments)
6+
if (result.error) {
7+
throw result.error
8+
} else if (result.status !== 0) {
9+
const args = Array.from(arguments)
10+
throw new Error(args[0] + ' ' + args[1].join(' ') + ': exit status=' + result.status)
11+
}
12+
return result
13+
}
14+
15+
if (spawnSync('rustup', ['--version'], { stdio: 'inherit' }).status !== 0) {
16+
throw new Error('The build process for this framework is intended for a Rust user (via rustup).' +
17+
'If you want to install Rust, visit https://www.rust-lang.org/.' +
18+
'Otherwise, you can run the benchmark with the provided `.js` and `.wasm` files.' +
19+
'(Note that other dependencies (require by this framework) will be installed automatically by "npm run build-prod-force")')
20+
}
21+
22+
spawnSyncOrThrow('rustup', ['toolchain', 'install', 'nightly'], { stdio: 'inherit' })
23+
spawnSyncOrThrow('rustup', ['target', 'add', 'wasm32-unknown-unknown', '--toolchain', 'nightly'], { stdio: 'inherit' })
24+
25+
if (spawnSync('wasm-bindgen', ['--version'], { stdio: 'inherit' }).status !== 0) {
26+
spawnSyncOrThrow('cargo', ['install', 'wasm-bindgen-cli', '--version', '0.2.29'], { stdio: 'inherit' })
27+
}
28+
29+
if (spawnSync('simi', ['--version'], { stdio: 'inherit' }).status !== 0) {
30+
spawnSyncOrThrow('cargo', ['install', 'simi-cli'], { stdio: 'inherit' })
31+
}
32+
33+
const build_mode = process.argv[2]
34+
spawnSyncOrThrow('simi', ['build', build_mode], { stdio: 'inherit' })
35+
})().catch(console.dir)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Simi</title>
6+
<link href="/css/currentStyle.css" rel="stylesheet" />
7+
</head>
8+
<body>
9+
<div id="main"></div>
10+
<script src="js_framework_benchmark_simi_bg.js" type="module"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)