Skip to content

Commit b33ea58

Browse files
committed
Merge branch 'master' of https://github.com/WebReflection/js-framework-benchmark into WebReflection-master
2 parents ce139d2 + 06ec3d0 commit b33ea58

File tree

6 files changed

+146
-144
lines changed

6 files changed

+146
-144
lines changed

frameworks/keyed/lighterhtml/package.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@
2424
},
2525
"homepage": "https://github.com/krausest/js-framework-benchmark#readme",
2626
"dependencies": {
27-
"lighterhtml": "1.2.1"
27+
"lighterhtml": "^2.0.1"
2828
},
2929
"devDependencies": {
30-
"@babel/core": "7.5.5",
31-
"babel-plugin-remove-ungap": "1.2.0",
32-
"rollup": "1.17.0",
33-
"rollup-plugin-babel": "4.3.3",
34-
"rollup-plugin-minify-html-literals": "1.2.2",
35-
"rollup-plugin-node-resolve": "5.2.0",
36-
"rollup-plugin-replace": "2.2.0",
37-
"rollup-plugin-terser": "5.1.1"
30+
"@ungap/degap": "^0.1.4",
31+
"rollup": "^1.27.0",
32+
"rollup-plugin-includepaths": "^0.2.3",
33+
"rollup-plugin-minify-html-literals": "^1.2.2",
34+
"rollup-plugin-node-resolve": "^5.2.0",
35+
"rollup-plugin-terser": "^5.1.2"
3836
}
3937
}

frameworks/keyed/lighterhtml/rollup.config.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
import minifyHTML from 'rollup-plugin-minify-html-literals';
22
import resolve from 'rollup-plugin-node-resolve';
3-
import replace from 'rollup-plugin-replace';
4-
import babel from 'rollup-plugin-babel';
3+
import includePaths from 'rollup-plugin-includepaths';
54
import { terser } from 'rollup-plugin-terser';
65

76
export default {
87
input: 'src/index.js',
98
plugins: [
109
minifyHTML(),
11-
resolve(),
12-
replace({
13-
'tta.apply(null, arguments)': 'arguments',
14-
delimiters: ['', '']
15-
}),
16-
babel({
17-
plugins: [['remove-ungap']]
10+
includePaths({
11+
include: {
12+
"@ungap/create-content": "./node_modules/@ungap/degap/create-content.js",
13+
"@ungap/template-tag-arguments": "./node_modules/@ungap/degap/template-tag-arguments.js",
14+
"@ungap/template-literal": "./node_modules/@ungap/degap/template-literal.js",
15+
"@ungap/weakmap": "./node_modules/@ungap/degap/weakmap.js",
16+
"@ungap/weakset": "./node_modules/@ungap/degap/weakset.js",
17+
"@ungap/event": "./node_modules/@ungap/degap/event.js",
18+
"@ungap/essential-map": "./node_modules/@ungap/degap/essential-map.js",
19+
"@ungap/import-node": "./node_modules/@ungap/degap/import-node.js",
20+
"@ungap/trim": "./node_modules/@ungap/degap/trim.js"
21+
},
1822
}),
23+
resolve({module: true}),
1924
terser()
2025
],
2126
context: 'null',

frameworks/keyed/lighterhtml/src/index.js

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { html, render } from '../node_modules/lighterhtml/esm/index';
1+
import { html, render } from '../node_modules/lighterhtml/esm/index.js';
22

33
const adjectives = [
44
'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'];
@@ -80,62 +80,60 @@ const _random = max => {
8080

8181
const container = document.getElementById('container');
8282
const _render = () => {
83-
render(container, template);
84-
};
85-
86-
const template = () => html.for(container)`
87-
<div class="container">
88-
<div class="jumbotron">
89-
<div class="row">
90-
<div class="col-md-6">
91-
<h1>lighterhtml</h1>
92-
</div>
93-
<div class="col-md-6">
94-
<div class="row">
95-
<div class="col-sm-6 smallpad">
96-
<button type="button" class="btn btn-primary btn-block" id="run" onclick=${run}>Create 1,000 rows</button>
97-
</div>
98-
<div class="col-sm-6 smallpad">
99-
<button type="button" class="btn btn-primary btn-block" id="runlots" onclick=${runLots}>Create 10,000 rows</button>
100-
</div>
101-
<div class="col-sm-6 smallpad">
102-
<button type="button" class="btn btn-primary
103-
btn-block" id="add" onclick=${add}>Append 1,000 rows</button>
104-
</div>
105-
<div class="col-sm-6 smallpad">
106-
<button type="button" class="btn btn-primary
107-
btn-block" id="update" onclick=${update}>Update every 10th row</button>
108-
</div>
109-
<div class="col-sm-6 smallpad">
110-
<button type="button" class="btn btn-primary
111-
btn-block" id="clear" onclick=${clear}>Clear</button>
112-
</div>
113-
<div class="col-sm-6 smallpad">
114-
<button type="button" class="btn btn-primary
115-
btn-block" id="swaprows" onclick=${swapRows}>Swap Rows</button>
83+
render(container, html.for(container)`
84+
<div class="container">
85+
<div class="jumbotron">
86+
<div class="row">
87+
<div class="col-md-6">
88+
<h1>lighterhtml</h1>
89+
</div>
90+
<div class="col-md-6">
91+
<div class="row">
92+
<div class="col-sm-6 smallpad">
93+
<button type="button" class="btn btn-primary btn-block" id="run" onclick=${run}>Create 1,000 rows</button>
94+
</div>
95+
<div class="col-sm-6 smallpad">
96+
<button type="button" class="btn btn-primary btn-block" id="runlots" onclick=${runLots}>Create 10,000 rows</button>
97+
</div>
98+
<div class="col-sm-6 smallpad">
99+
<button type="button" class="btn btn-primary
100+
btn-block" id="add" onclick=${add}>Append 1,000 rows</button>
101+
</div>
102+
<div class="col-sm-6 smallpad">
103+
<button type="button" class="btn btn-primary
104+
btn-block" id="update" onclick=${update}>Update every 10th row</button>
105+
</div>
106+
<div class="col-sm-6 smallpad">
107+
<button type="button" class="btn btn-primary
108+
btn-block" id="clear" onclick=${clear}>Clear</button>
109+
</div>
110+
<div class="col-sm-6 smallpad">
111+
<button type="button" class="btn btn-primary
112+
btn-block" id="swaprows" onclick=${swapRows}>Swap Rows</button>
113+
</div>
116114
</div>
117115
</div>
118116
</div>
119117
</div>
120-
</div>
121-
<table onclick=${interact} class="table table-hover table-striped test-data">
122-
<tbody>${data.map(item => html.for(item)`
123-
<tr id=${item.id} class=${item.selected ? 'danger' : ''}>
124-
<td class="col-md-1">${item.id}</td>
125-
<td data-interaction='select' class="col-md-4">
126-
<a data-interaction='select'>${item.label}</a>
127-
</td>
128-
<td data-interaction='delete' class="col-md-1">
129-
<a data-interaction='delete'>
130-
<span data-interaction='delete' class="glyphicon glyphicon-remove" aria-hidden="true"></span>
131-
</a>
132-
</td>
133-
<td class="col-md-6"></td>
134-
</tr>`)
135-
}
136-
</tbody>
137-
</table>
138-
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
139-
</div>`;
118+
<table onclick=${interact} class="table table-hover table-striped test-data">
119+
<tbody>${data.map(item => html.for(item)`
120+
<tr id=${item.id} class=${item.selected ? 'danger' : ''}>
121+
<td class="col-md-1">${item.id}</td>
122+
<td data-interaction='select' class="col-md-4">
123+
<a data-interaction='select'>${item.label}</a>
124+
</td>
125+
<td data-interaction='delete' class="col-md-1">
126+
<a data-interaction='delete'>
127+
<span data-interaction='delete' class="glyphicon glyphicon-remove" aria-hidden="true"></span>
128+
</a>
129+
</td>
130+
<td class="col-md-6"></td>
131+
</tr>`)
132+
}
133+
</tbody>
134+
</table>
135+
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
136+
</div>`);
137+
};
140138

141139
_render();

frameworks/non-keyed/lighterhtml/package.json

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,14 @@
2424
},
2525
"homepage": "https://github.com/krausest/js-framework-benchmark#readme",
2626
"dependencies": {
27-
"lighterhtml": "1.2.1"
27+
"lighterhtml": "^2.0.1"
2828
},
2929
"devDependencies": {
30-
"@babel/core": "7.5.5",
31-
"babel-plugin-remove-ungap": "1.2.0",
32-
"rollup": "1.17.0",
33-
"rollup-plugin-babel": "4.3.3",
34-
"rollup-plugin-minify-html-literals": "1.2.2",
35-
"rollup-plugin-node-resolve": "5.2.0",
36-
"rollup-plugin-replace": "2.2.0",
37-
"rollup-plugin-terser": "5.1.1"
30+
"@ungap/degap": "^0.1.4",
31+
"rollup": "^1.27.0",
32+
"rollup-plugin-includepaths": "^0.2.3",
33+
"rollup-plugin-minify-html-literals": "^1.2.2",
34+
"rollup-plugin-node-resolve": "^5.2.0",
35+
"rollup-plugin-terser": "^5.1.2"
3836
}
3937
}

frameworks/non-keyed/lighterhtml/rollup.config.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
import minifyHTML from 'rollup-plugin-minify-html-literals';
22
import resolve from 'rollup-plugin-node-resolve';
3-
import replace from 'rollup-plugin-replace';
4-
import babel from 'rollup-plugin-babel';
3+
import includePaths from 'rollup-plugin-includepaths';
54
import { terser } from 'rollup-plugin-terser';
65

76
export default {
87
input: 'src/index.js',
98
plugins: [
109
minifyHTML(),
11-
resolve(),
12-
replace({
13-
'tta.apply(null, arguments)': 'arguments',
14-
delimiters: ['', '']
15-
}),
16-
babel({
17-
plugins: [['remove-ungap']]
10+
includePaths({
11+
include: {
12+
"@ungap/create-content": "./node_modules/@ungap/degap/create-content.js",
13+
"@ungap/template-tag-arguments": "./node_modules/@ungap/degap/template-tag-arguments.js",
14+
"@ungap/template-literal": "./node_modules/@ungap/degap/template-literal.js",
15+
"@ungap/weakmap": "./node_modules/@ungap/degap/weakmap.js",
16+
"@ungap/weakset": "./node_modules/@ungap/degap/weakset.js",
17+
"@ungap/event": "./node_modules/@ungap/degap/event.js",
18+
"@ungap/essential-map": "./node_modules/@ungap/degap/essential-map.js",
19+
"@ungap/import-node": "./node_modules/@ungap/degap/import-node.js",
20+
"@ungap/trim": "./node_modules/@ungap/degap/trim.js"
21+
},
1822
}),
23+
resolve({module: true}),
1924
terser()
2025
],
2126
context: 'null',

frameworks/non-keyed/lighterhtml/src/index.js

Lines changed: 52 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { html, render } from '../node_modules/lighterhtml/esm/index';
1+
import { html, render } from '../node_modules/lighterhtml/esm/index.js';
22

33
const adjectives = [
44
'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'];
@@ -80,62 +80,60 @@ const _random = max => {
8080

8181
const container = document.getElementById('container');
8282
const _render = () => {
83-
render(container, template);
84-
};
85-
86-
const template = () => html`
87-
<div class="container">
88-
<div class="jumbotron">
89-
<div class="row">
90-
<div class="col-md-6">
91-
<h1>lighterhtml</h1>
92-
</div>
93-
<div class="col-md-6">
94-
<div class="row">
95-
<div class="col-sm-6 smallpad">
96-
<button type="button" class="btn btn-primary btn-block" id="run" onclick=${run}>Create 1,000 rows</button>
97-
</div>
98-
<div class="col-sm-6 smallpad">
99-
<button type="button" class="btn btn-primary btn-block" id="runlots" onclick=${runLots}>Create 10,000 rows</button>
100-
</div>
101-
<div class="col-sm-6 smallpad">
102-
<button type="button" class="btn btn-primary
103-
btn-block" id="add" onclick=${add}>Append 1,000 rows</button>
104-
</div>
105-
<div class="col-sm-6 smallpad">
106-
<button type="button" class="btn btn-primary
107-
btn-block" id="update" onclick=${update}>Update every 10th row</button>
108-
</div>
109-
<div class="col-sm-6 smallpad">
110-
<button type="button" class="btn btn-primary
111-
btn-block" id="clear" onclick=${clear}>Clear</button>
112-
</div>
113-
<div class="col-sm-6 smallpad">
114-
<button type="button" class="btn btn-primary
115-
btn-block" id="swaprows" onclick=${swapRows}>Swap Rows</button>
83+
render(container, html`
84+
<div class="container">
85+
<div class="jumbotron">
86+
<div class="row">
87+
<div class="col-md-6">
88+
<h1>lighterhtml</h1>
89+
</div>
90+
<div class="col-md-6">
91+
<div class="row">
92+
<div class="col-sm-6 smallpad">
93+
<button type="button" class="btn btn-primary btn-block" id="run" onclick=${run}>Create 1,000 rows</button>
94+
</div>
95+
<div class="col-sm-6 smallpad">
96+
<button type="button" class="btn btn-primary btn-block" id="runlots" onclick=${runLots}>Create 10,000 rows</button>
97+
</div>
98+
<div class="col-sm-6 smallpad">
99+
<button type="button" class="btn btn-primary
100+
btn-block" id="add" onclick=${add}>Append 1,000 rows</button>
101+
</div>
102+
<div class="col-sm-6 smallpad">
103+
<button type="button" class="btn btn-primary
104+
btn-block" id="update" onclick=${update}>Update every 10th row</button>
105+
</div>
106+
<div class="col-sm-6 smallpad">
107+
<button type="button" class="btn btn-primary
108+
btn-block" id="clear" onclick=${clear}>Clear</button>
109+
</div>
110+
<div class="col-sm-6 smallpad">
111+
<button type="button" class="btn btn-primary
112+
btn-block" id="swaprows" onclick=${swapRows}>Swap Rows</button>
113+
</div>
116114
</div>
117115
</div>
118116
</div>
119117
</div>
120-
</div>
121-
<table onclick=${interact} class="table table-hover table-striped test-data">
122-
<tbody>${data.map(item => html`
123-
<tr id=${item.id} class=${item.selected ? 'danger' : ''}>
124-
<td class="col-md-1">${item.id}</td>
125-
<td data-interaction='select' class="col-md-4">
126-
<a data-interaction='select'>${item.label}</a>
127-
</td>
128-
<td data-interaction='delete' class="col-md-1">
129-
<a data-interaction='delete'>
130-
<span data-interaction='delete' class="glyphicon glyphicon-remove" aria-hidden="true"></span>
131-
</a>
132-
</td>
133-
<td class="col-md-6"></td>
134-
</tr>`)
135-
}
136-
</tbody>
137-
</table>
138-
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
139-
</div>`;
118+
<table onclick=${interact} class="table table-hover table-striped test-data">
119+
<tbody>${data.map(item => html`
120+
<tr id=${item.id} class=${item.selected ? 'danger' : ''}>
121+
<td class="col-md-1">${item.id}</td>
122+
<td data-interaction='select' class="col-md-4">
123+
<a data-interaction='select'>${item.label}</a>
124+
</td>
125+
<td data-interaction='delete' class="col-md-1">
126+
<a data-interaction='delete'>
127+
<span data-interaction='delete' class="glyphicon glyphicon-remove" aria-hidden="true"></span>
128+
</a>
129+
</td>
130+
<td class="col-md-6"></td>
131+
</tr>`)
132+
}
133+
</tbody>
134+
</table>
135+
<span class="preloadicon glyphicon glyphicon-remove" aria-hidden="true"></span>
136+
</div>`);
137+
};
140138

141139
_render();

0 commit comments

Comments
 (0)