Skip to content

Commit 1efe29c

Browse files
committed
2 parents d347bb0 + 80385c0 commit 1efe29c

File tree

21 files changed

+372
-120
lines changed

21 files changed

+372
-120
lines changed

frameworks/keyed/angular-ng/.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
NG_CLI_ANALYTICS=false

frameworks/keyed/angular-ng/package.json

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,34 @@
66
"customURL": "/dist/angular-ng/"
77
},
88
"scripts": {
9-
"postinstall": "ng analytics off",
109
"ng": "ng",
1110
"start": "ng serve",
1211
"build": "ng build",
1312
"test": "ng test",
1413
"lint": "ng lint",
15-
"build-prod": "ng build --aot=true --prod=true",
14+
"build-prod": "ng build --prod=true --buildOptimizer=true --sourceMap=false",
1615
"build-dev": "ng serve"
1716
},
1817
"private": true,
1918
"dependencies": {
20-
"@angular/animations": "8.2.14",
21-
"@angular/common": "8.2.14",
22-
"@angular/compiler": "8.2.14",
23-
"@angular/core": "8.2.14",
24-
"@angular/platform-browser": "8.2.14",
25-
"@angular/platform-browser-dynamic": "8.2.14",
26-
"rxjs": "6.4.0",
27-
"tslib": "^1.10.0",
28-
"zone.js": "0.9.1"
19+
"@angular/animations": "9.1.2",
20+
"@angular/common": "9.1.2",
21+
"@angular/compiler": "9.1.2",
22+
"@angular/core": "9.1.2",
23+
"@angular/platform-browser": "9.1.2",
24+
"@angular/platform-browser-dynamic": "9.1.2",
25+
"rxjs": "6.5.5",
26+
"tslib": "^1.11.1",
27+
"zone.js": "0.10.3"
2928
},
3029
"devDependencies": {
31-
"@angular-devkit/build-angular": "0.803.24",
32-
"@angular/cli": "8.3.24",
33-
"@angular/compiler-cli": "8.2.14",
34-
"@angular/language-service": "8.2.14",
35-
"@types/node": "8.9.4",
36-
"ts-node": "7.0.0",
37-
"tslint": "5.15.0",
38-
"typescript": "3.5.3"
30+
"@angular-devkit/build-angular": "0.901.1",
31+
"@angular/cli": "9.1.1",
32+
"@angular/compiler-cli": "9.1.2",
33+
"@angular/language-service": "9.1.2",
34+
"@types/node": "13.13.0",
35+
"ts-node": "8.8.2",
36+
"tslint": "6.1.1",
37+
"typescript": "3.8.3"
3938
}
4039
}

frameworks/keyed/angular-ng/src/css

Lines changed: 0 additions & 1 deletion
This file was deleted.

frameworks/keyed/apprun/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "js-framework-benchmark-apprun-v1.7.0",
2+
"name": "js-framework-benchmark-apprun-v2.23.10",
33
"version": "1.0.0",
44
"description": "AppRun demo",
55
"main": "index.js",
@@ -23,12 +23,12 @@
2323
},
2424
"devDependencies": {
2525
"json-loader": "0.5.7",
26-
"ts-loader": "6.0.2",
27-
"typescript": "3.5.2",
28-
"webpack": "4.34.0",
29-
"webpack-cli": "^3.1.0"
26+
"ts-loader": "6.2.2",
27+
"typescript": "3.8.3",
28+
"webpack": "4.42.1",
29+
"webpack-cli": "3.3.11"
3030
},
3131
"dependencies": {
32-
"apprun": "1.20.6"
32+
"apprun": "2.23.12"
3333
}
3434
}

frameworks/keyed/apprun/src/main.tsx

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import app, { Component } from 'apprun'
1+
import { app, Component } from 'apprun';
22
import Store from './store';
33

44
const store = new Store();
55

66
const update = {
7-
'#benchmark': (store) => store,
87

98
run(store) {
109
store.run();
@@ -17,20 +16,16 @@ const update = {
1716
},
1817

1918
remove(store, id) {
20-
document.getElementById(id).remove();
2119
store.delete(id);
22-
store.no_render = true;
23-
return store;
20+
document.getElementById(id).remove();
2421
},
2522

2623
select(store, id) {
2724
if (store.selected) {
2825
document.getElementById(store.selected).className = '';
2926
}
30-
document.getElementById(id).className = 'danger';
3127
store.select(id);
32-
store.no_render = true;
33-
return store;
28+
document.getElementById(id).className = 'danger';
3429
},
3530

3631
update(store) {
@@ -45,7 +40,7 @@ const update = {
4540

4641
clear(store) {
4742
store.clear();
48-
return store;
43+
document.getElementById("main-table").innerHTML = "";
4944
},
5045

5146
swaprows(store) {
@@ -55,12 +50,8 @@ const update = {
5550
}
5651

5752
const view = (model) => {
58-
if (model.no_render) {
59-
delete model.no_render;
60-
return;
61-
}
6253
const rows = model.data.map((curr) => {
63-
const selected = curr.id == model.selected ? 'danger' : '';
54+
const selected = curr.id == model.selected ? 'danger' : undefined;
6455
const id = curr.id;
6556
return <tr className={selected} id={id} key={id}>
6657
<td className="col-md-1">{id}</td>
@@ -76,7 +67,7 @@ const view = (model) => {
7667
</tr>;
7768
});
7869

79-
return (<div className="container">
70+
return (<div className="container" onclick={click}>
8071
<div className="jumbotron">
8172
<div className="row">
8273
<div className="col-md-6">
@@ -106,7 +97,7 @@ const view = (model) => {
10697
</div>
10798
</div>
10899
</div>
109-
<table className="table table-hover table-striped test-data">
100+
<table className="table table-hover table-striped test-data" id="main-table">
110101
<tbody>
111102
{rows}
112103
</tbody>
@@ -125,7 +116,7 @@ const getId = (elem) => {
125116
return undefined;
126117
}
127118

128-
document.body.addEventListener('click', e => {
119+
const click = (e) => {
129120
const t = e.target as HTMLElement;
130121
if (!t) return;
131122
if (t.tagName === 'BUTTON' && t.id) {
@@ -138,10 +129,11 @@ document.body.addEventListener('click', e => {
138129
e.preventDefault();
139130
component.run('select', getId(t));
140131
}
141-
});
132+
};
142133

143-
app.on('//', _ => { })
144-
app.on('#', _ => { })
145-
146-
let component = new Component(store, view, update);
134+
const component = new Component(store, view, update);
135+
component['-patch-vdom-on'] = true;
136+
component.rendered = () => {
137+
store.selected && (document.getElementById(store.selected).className = 'danger');
138+
}
147139
component.start(document.getElementById('main'));

frameworks/keyed/apprun/src/store.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@ export default class Store {
2020
}
2121
updateData(mod = 10) {
2222
for (let i=0;i<this.data.length;i+=10) {
23-
// this.data[i].label += ' !!!';
24-
this.data[i] = { ...this.data[i], label: this.data[i].label + ' !!!' };
23+
this.data[i].label += ' !!!';
24+
// this.data[i] = Object.assign({}, this.data[i], {label: this.data[i].label +' !!!'});
2525
}
2626
}
2727
delete(id) {
2828
// const idx = this.data.findIndex(d => d.id==id);
29-
this.data = this.data.filter((e,i) => e.id!=id);
30-
if (this.selected === id) this.selected = null;
29+
this.data = this.data.filter((e, i) => e.id != id);
30+
if (id === this.selected) this.selected = null;
3131
}
3232
run() {
3333
this.data = this.buildData();
@@ -39,7 +39,6 @@ export default class Store {
3939
}
4040
update() {
4141
this.updateData();
42-
this.selected = null;
4342
}
4443
select(id) {
4544
this.selected = id;
@@ -63,10 +62,11 @@ export default class Store {
6362
this.selected = null;
6463
}
6564
swapRows() {
66-
if (this.data.length > 998) {
65+
if (this.data.length > 4) {
66+
var idx = this.data.length - 2;
6767
var a = this.data[1];
68-
this.data[1] = this.data[998];
69-
this.data[998] = a;
68+
this.data[1] = this.data[idx];
69+
this.data[idx] = a;
7070
}
7171
}
7272
}

frameworks/keyed/apprun/tsconfig.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"compilerOptions": {
3-
"target": "es5",
3+
"target": "es2015",
4+
"module": "es2015",
5+
"moduleResolution": "node",
46
"jsx": "react",
57
"reactNamespace": "app",
68
"lib": ["dom", "es2015.promise", "es5"]

frameworks/keyed/isotope/index.html

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<title>Isotope</title>
5+
<link href="/css/currentStyle.css" rel="stylesheet" />
6+
</head>
7+
<body>
8+
<div id="main" class="container"></div>
9+
<script src="dist/main.js"></script>
10+
</body>
11+
</html>

frameworks/keyed/isotope/package.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"name": "js-framework-benchmark-isotope",
3+
"version": "1.0.0",
4+
"description": "Benchmark for Isotope UI library",
5+
"js-framework-benchmark": {
6+
"frameworkVersionFromPackage": "@isotope/core"
7+
},
8+
"scripts": {
9+
"build-dev": "rollup -c -w",
10+
"build-prod": "rollup -c --environment production"
11+
},
12+
"keywords": [
13+
"isotope"
14+
],
15+
"author": "Stefan Krause",
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+
"devDependencies": {
23+
"@rollup/plugin-node-resolve": "7.0.0",
24+
"rollup": "1.15.6",
25+
"rollup-plugin-terser": "5.0.0"
26+
},
27+
"dependencies": {
28+
"@isotope/core": "0.2.0"
29+
}
30+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import resolve from "@rollup/plugin-node-resolve";
2+
import { terser } from "rollup-plugin-terser";
3+
4+
const plugins = [resolve()];
5+
6+
if (process.env.production) {
7+
plugins.push(terser());
8+
}
9+
10+
export default {
11+
input: "src/main.js",
12+
output: {
13+
file: "dist/main.js",
14+
format: "iife",
15+
name: "main"
16+
},
17+
plugins
18+
};

0 commit comments

Comments
 (0)