Skip to content

Commit 8bfb13c

Browse files
committed
Update kobold to 0.9.1
1 parent 089954e commit 8bfb13c

File tree

4 files changed

+13
-12
lines changed

4 files changed

+13
-12
lines changed

frameworks/non-keyed/kobold/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
crate-type = ["cdylib"]
88

99
[dependencies]
10-
kobold = "0.7.1"
10+
kobold = "0.9.1"
1111
wasm-bindgen = "0.2.84"
1212
js-sys = "0.3.61"
1313

@@ -18,4 +18,4 @@ codegen-units = 1
1818
panic = "abort"
1919

2020
[package.metadata.wasm-pack.profile.release]
21-
wasm-opt = ['-O4']
21+
wasm-opt = ['-O4']

frameworks/non-keyed/kobold/package-lock.json

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

frameworks/non-keyed/kobold/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Benchmark for Kobold",
55
"license": "MPL-2.0",
66
"js-framework-benchmark": {
7-
"frameworkVersion": "0.7.1",
7+
"frameworkVersion": "0.9.1",
88
"frameworkHomeURL": "https://github.com/maciejhirsz/kobold",
99
"issues": [
1010
1139
@@ -30,4 +30,4 @@
3030
"esbuild": "^0.14.47",
3131
"npm-run-all": "4.1.5"
3232
}
33-
}
33+
}

frameworks/non-keyed/kobold/src/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use js_sys::Math;
2+
use kobold::diff::VString;
23
use kobold::prelude::*;
34
use wasm_bindgen::prelude::*;
45

@@ -47,10 +48,10 @@ fn random(max: usize) -> usize {
4748
(Math::random() * 1000.0) as usize % max
4849
}
4950

50-
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
51+
#[derive(Debug)]
5152
struct RowData {
5253
id: usize,
53-
label: String,
54+
label: VString,
5455
}
5556

5657
struct State {
@@ -83,7 +84,7 @@ impl State {
8384
label.push_str(noun);
8485
self.rows.push(RowData {
8586
id: i + d,
86-
label,
87+
label: label.into(),
8788
});
8889
}
8990
self.last += count;
@@ -137,7 +138,7 @@ fn Row<'a>(num: usize, row: &'a RowData, state: &'a Hook<State>) -> impl View +
137138
view! {
138139
<tr.{is_in_danger}>
139140
<td class="col-md-1">{id}</td>
140-
<td class="col-md-4"><a onclick={select}>{row.label.to_owned()}</a></td>
141+
<td class="col-md-4"><a onclick={select}>{&row.label}</a></td>
141142
<td class="col-md-1"><a onclick={remove}><span class="glyphicon glyphicon-remove" aria-hidden="true"></span></a></td>
142143
<td class="col-md-6"/>
143144
</tr>
@@ -211,7 +212,7 @@ fn App() -> impl View {
211212
</div>
212213
<table class="table table-hover table-striped test-data">
213214
<tbody>
214-
{ for state.rows.iter().enumerate().map(|(num,row)| view! { <Row {state} {num} {row} /> }) }
215+
{ for state.rows.iter().enumerate().map(|(num,row)| view! { <Row {state} {num} {row} /> }) }
215216
</tbody>
216217
</table>
217218
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true" />
@@ -225,4 +226,4 @@ pub fn start() {
225226
kobold::start(view! {
226227
<App />
227228
});
228-
}
229+
}

0 commit comments

Comments
 (0)