Skip to content

Commit 1fbe389

Browse files
committed
Merge branch 'artjul-master'
2 parents 9c6f192 + 3b54447 commit 1fbe389

27 files changed

+185
-0
lines changed

frameworks/keyed/zune/index.html

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<title>Zune-keyed</title>
6+
<link href="/css/currentStyle.css" rel="stylesheet" />
7+
</head>
8+
<body>
9+
<div class="container" id="main">
10+
<div class="jumbotron">
11+
<div class="row">
12+
<div class="col-md-6">
13+
<h1>Zune-keyed</h1>
14+
</div>
15+
<div class="col-md-6">
16+
<div class="row">
17+
<div class="col-sm-6 smallpad">
18+
<button type="button" class="btn btn-primary btn-block" id="run" data-click="bench: 'run'">Create 1,000 rows</button>
19+
</div>
20+
<div class="col-sm-6 smallpad">
21+
<button type="button" class="btn btn-primary btn-block" id="runlots" data-click="bench: 'runLots'">Create 10,000 rows</button>
22+
</div>
23+
<div class="col-sm-6 smallpad">
24+
<button type="button" class="btn btn-primary btn-block" id="add" data-click="bench: 'add'">Append 1,000 rows</button>
25+
</div>
26+
<div class="col-sm-6 smallpad">
27+
<button type="button" class="btn btn-primary btn-block" id="update" data-click="bench: 'update'">Update every 10th row</button>
28+
</div>
29+
<div class="col-sm-6 smallpad">
30+
<button type="button" class="btn btn-primary btn-block" id="clear" data-click="bench: 'clear'">Clear</button>
31+
</div>
32+
<div class="col-sm-6 smallpad">
33+
<button type="button" class="btn btn-primary btn-block" id="swaprows" data-click="bench: 'swapRows'">Swap Rows</button>
34+
</div>
35+
</div>
36+
</div>
37+
</div>
38+
</div>
39+
<table class="table table-hover table-striped test-data">
40+
<tbody data-tpl="bench"></tbody>
41+
</table>
42+
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
43+
<template data-name="bench">
44+
<tr>
45+
<td class="col-md-1">${id}</td>
46+
<td class="col-md-4"><a data-click="bench: 'select'">${label}</a></td>
47+
<td class="col-md-1"><a data-click="bench: 'remove'"><span class="glyphicon glyphicon-remove" aria-hidden="true" /></a></td>
48+
<td class="col-md-6"></td>
49+
</tr>
50+
</template>
51+
</div>
52+
<script type="module">
53+
(await import('./src/core/main.js')).default();
54+
</script>
55+
</body>
56+
</html>

frameworks/keyed/zune/package-lock.json

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

frameworks/keyed/zune/package.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "js-framework-benchmark-zune",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"main": "src/core/main.js",
6+
"js-framework-benchmark": {
7+
"frameworkVersionFromPackage": "zune"
8+
},
9+
"scripts": {
10+
"build-dev": "exit 0",
11+
"build-prod": "exit 0"
12+
},
13+
"keywords": [
14+
"zune"
15+
],
16+
"license": "Apache-2.0",
17+
"homepage": "https://github.com/krausest/js-framework-benchmark",
18+
"repository": {
19+
"type": "git",
20+
"url": "https://github.com/krausest/js-framework-benchmark.git"
21+
},
22+
"dependencies": {
23+
"zune": "1.0.8"
24+
}
25+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
export default async (e, method) => {
2+
window.rowId = window.rowId ?? 1;
3+
const adjectives = ["pretty", "large", "big", "small", "tall", "short", "long", "handsome", "plain", "quaint", "clean", "elegant", "easy", "angry", "crazy", "helpful", "mushy", "odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy"],
4+
colours = ["red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange"],
5+
nouns = ["table", "chair", "house", "bbq", "desk", "car", "pony", "cookie", "sandwich", "burger", "pizza", "mouse", "keyboard"];
6+
7+
function _random (max) { return Math.round(Math.random() * 1000) % max; };
8+
9+
function buildData(count) {
10+
let data = [];
11+
for (let i = 0; i < count; i++) {
12+
data.push({id: rowId++, label: `${adjectives[_random(adjectives.length)]} ${colours[_random(colours.length)]} ${nouns[_random(nouns.length)]}`});
13+
}
14+
return data;
15+
}
16+
17+
const methods = {
18+
run: () => tpl.replace('bench', buildData(1000)),
19+
runLots: () => tpl.replace('bench', buildData(10000)),
20+
add: () => tpl.add('bench', buildData(1000)),
21+
clear: () => tpl.remove('bench'),
22+
remove: () => tpl.remove('bench', e.it),
23+
swapRows: () => tpl.swap('bench', 1, 998),
24+
update: () => tpl.set('bench', {label: '${label} !!!'}, {id: /^(\d*1)$/}),
25+
select: () => {
26+
$('.danger')?.cls.remove('danger');
27+
tpl.pos(e.it, (e) => {e?.field?.cls.add('danger')});
28+
}
29+
};
30+
31+
methods[method]();
32+
}

frameworks/keyed/zune/src/config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
export default {
2+
duration: false,
3+
init: {
4+
type: "ready",
5+
preloader: null
6+
},
7+
events: {
8+
click: true
9+
},
10+
api: {
11+
url: "/",
12+
method: "POST",
13+
headers: false,
14+
format: "json"
15+
},
16+
spa: false,
17+
cache: {
18+
component: 50,
19+
module: 50,
20+
api: 50,
21+
state: 5
22+
},
23+
cacheTime: 300
24+
}

frameworks/keyed/zune/src/core/api.js

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

frameworks/keyed/zune/src/core/build.js

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

frameworks/keyed/zune/src/core/clear.js

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

frameworks/keyed/zune/src/core/content.js

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

frameworks/keyed/zune/src/core/each.js

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

0 commit comments

Comments
 (0)