Skip to content

Commit 59da766

Browse files
committed
Update rendrjs version
1 parent 4a1798e commit 59da766

File tree

6 files changed

+39
-32
lines changed

6 files changed

+39
-32
lines changed

frameworks/keyed/rendrjs-atoms/package-lock.json

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

frameworks/keyed/rendrjs-atoms/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"webpack-cli": "5.1.4"
1111
},
1212
"dependencies": {
13-
"@rendrjs/core": "0.2.6"
13+
"@rendrjs/core": "0.2.10"
1414
},
1515
"js-framework-benchmark": {
1616
"frameworkVersionFromPackage": "@rendrjs/core",

frameworks/keyed/rendrjs-atoms/src/Jumbotron.js

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
import { element, useAtomSetter, text } from '@rendrjs/core';
22
import { dataAtom, selectedAtom } from './store';
33

4-
let random = arr => arr[Math.round(Math.random() * 1000) % arr.length];
5-
6-
let A = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome',
4+
let adjectives = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome',
75
'plain', 'quaint', 'clean', 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy',
86
'odd', 'unsightly', 'adorable', 'important', 'inexpensive', 'cheap', 'expensive',
97
'fancy'];
10-
let C = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown',
8+
let colors = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown',
119
'white', 'black', 'orange'];
12-
let N = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie',
10+
let nouns = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie',
1311
'sandwich', 'burger', 'pizza', 'mouse', 'keyboard'];
1412

15-
let nextId = 1;
13+
let rand = arr => arr[Math.floor(Math.random() * arr.length)];
1614

17-
let buildData = (count = 1000) => {
18-
let data = new Array(count);
19-
for (let i = 0; i < count; i++) {
20-
data[i] = {
21-
id: nextId++,
22-
label: `${random(A)} ${random(C)} ${random(N)}`,
23-
};
24-
}
25-
return data;
26-
};
15+
let nextId = 1;
16+
17+
let buildData = (count = 1000) => {
18+
let data = new Array(count);
19+
for (let i = 0; i < count; i++) {
20+
data[i] = {
21+
id: nextId++,
22+
label: rand(adjectives) + ' ' + rand(colors) + ' ' + rand(nouns),
23+
};
24+
}
25+
return data;
26+
};
2727

2828
let btn = (id, txt, onclick) => element('div', {
2929
class: 'col-sm-6 smallpad',

frameworks/keyed/rendrjs/package-lock.json

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

frameworks/keyed/rendrjs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"webpack-cli": "5.1.4"
1111
},
1212
"dependencies": {
13-
"@rendrjs/core": "0.2.6"
13+
"@rendrjs/core": "0.2.10"
1414
},
1515
"js-framework-benchmark": {
1616
"frameworkVersionFromPackage": "@rendrjs/core",

frameworks/keyed/rendrjs/src/main.js

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
import { mount, element, component, useState, text } from '@rendrjs/core';
22

3-
let A = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome',
3+
let adjectives = ['pretty', 'large', 'big', 'small', 'tall', 'short', 'long', 'handsome',
44
'plain', 'quaint', 'clean', 'elegant', 'easy', 'angry', 'crazy', 'helpful', 'mushy',
55
'odd', 'unsightly', 'adorable', 'important', 'inexpensive', 'cheap', 'expensive',
66
'fancy'];
7-
let C = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown',
7+
let colors = ['red', 'yellow', 'blue', 'green', 'pink', 'brown', 'purple', 'brown',
88
'white', 'black', 'orange'];
9-
let N = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie',
9+
let nouns = ['table', 'chair', 'house', 'bbq', 'desk', 'car', 'pony', 'cookie',
1010
'sandwich', 'burger', 'pizza', 'mouse', 'keyboard'];
1111

12-
let rand = arr => arr[Math.round(Math.random() * 1000) % arr.length];
12+
let rand = arr => arr[Math.floor(Math.random() * arr.length)];
1313

1414
let nextId = 1;
1515

16+
// Executing frameworks/keyed/hyperapp and benchmark 04_select1k failed: Failed to launch the browser process! undefined
17+
18+
19+
// TROUBLESHOOTING: https://pptr.dev/troubleshooting
20+
21+
// Executing frameworks/keyed/rendrjs and benchmark 06_remove-one-1k failed: Failed to launch the browser process! undefined
22+
1623
let buildData = (count = 1000) => {
1724
let data = new Array(count);
1825
for (let i = 0; i < count; i++) {
1926
data[i] = {
2027
id: nextId++,
21-
label: `${rand(A)} ${rand(C)} ${rand(N)}`,
28+
label: rand(adjectives) + ' ' + rand(colors) + ' ' + rand(nouns),
2229
};
2330
}
2431
return data;
@@ -122,7 +129,7 @@ let App = () => {
122129
item,
123130
hi: state.sel === item.id,
124131
set: setState,
125-
memo: [item.id === state.sel, item.label],
132+
memo: [item.label, item.id === state.sel],
126133
})),
127134
}),
128135
}),

0 commit comments

Comments
 (0)