Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ivi to 0.13.0 #399

Merged
merged 1 commit into from
May 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions frameworks/ivi-v0.10.0-keyed/gulpfile.js

This file was deleted.

13 changes: 0 additions & 13 deletions frameworks/ivi-v0.10.0-keyed/src/env.js

This file was deleted.

79 changes: 0 additions & 79 deletions frameworks/ivi-v0.10.0-keyed/src/main.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@

<head>
<meta charset="UTF-8">
<title>ivi v0.9.1</title>
<title>ivi</title>
<link href="/css/currentStyle.css" rel="stylesheet" />
</head>

<body>
<div id="main"></div>
<script src="dist/main.js"></script>
<script type="module" src="dist/main.js"></script>
</body>

</html>
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@
"repository": "https://github.com/krausest/js-framework-benchmark",
"keywords": [],
"scripts": {
"build-dev": "gulp build",
"build-prod": "gulp build"
"build-dev": "rollup -c rollup.config.js",
"build-prod": "rollup -c rollup.config.js"
},
"dependencies": {
"ivi-core": "0.10.0",
"ivi-scheduler": "0.10.0",
"ivi-html": "0.10.0",
"ivi-events": "0.10.0",
"ivi-state": "0.10.0",
"ivi": "0.10.0"
"ivi-core": "0.13.0",
"ivi-scheduler": "0.13.0",
"ivi-html": "0.13.0",
"ivi-state": "0.13.0",
"ivi": "0.13.0"
},
"devDependencies": {
"del": "3.0.0",
"google-closure-compiler": "20180402.0.0",
"gulp": "3.9.1",
"rollup": "0.58.2",
"rollup-plugin-node-resolve-main-fields": "3.3.0"
"rollup": "0.59.4",
"rollup-plugin-node-resolve-main-fields": "3.3.0",
"rollup-plugin-replace": "2.0.0",
"rollup-plugin-terser": "1.0.1"
}
}
}
39 changes: 39 additions & 0 deletions frameworks/ivi-v0.13.0-keyed/rollup.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import replace from 'rollup-plugin-replace';
import nodeResolve from 'rollup-plugin-node-resolve-main-fields';
import { terser } from 'rollup-plugin-terser';

export default {
input: 'src/main.js',
output: {
file: 'dist/main.js',
format: 'es',
},
plugins: [
replace({
values: {
DEBUG: false,
TARGET: JSON.stringify('evergreen'),
},
}),
nodeResolve({
mainFields: ['es2016', 'module', 'main'],
}),
terser({
parse: {
ecma: 8,
},
compress: {
ecma: 5,
inline: true,
reduce_funcs: false,
passes: 5,
},
output: {
ecma: 5,
comments: false,
},
toplevel: true,
module: true,
})
],
};
78 changes: 78 additions & 0 deletions frameworks/ivi-v0.13.0-keyed/src/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
import { Component, statefulComponent, connect, render, map, element, onClick, stopDirtyChecking } from "ivi";
import { h1, div, span, table, tbody, tr, td, a, button } from "ivi-html";
import { store } from "./store";

const GlyphIcon = element(span("glyphicon glyphicon-remove").a({ "aria-hidden": "true" }));

const Row = statefulComponent(class extends Component {
constructor(props) {
super(props);
this.click = onClick(() => { store.dispatch({ type: "select", item: this.props.item }); });
this.del = onClick(() => { store.dispatch({ type: "delete", item: this.props.item }); });
}

render() {
const { item, selected } = this.props;
return stopDirtyChecking(
tr(selected ? "danger" : "").c(
td("col-md-1").c(item.id),
td("col-md-4").c(a().e(this.click).c(item.label)),
td("col-md-1").c(
a().e(this.del).c(GlyphIcon()),
),
td("col-md-6"),
),
);
}
});

const RowConnector = connect(
(prev, id) => {
const item = store.getState().data.value[id];
const selected = store.getState().selected === item;
return (prev !== null && prev.item === item && prev.selected === selected) ? prev :
{ item, selected };
},
Row,
);

const RowListConnector = connect(
(prev) => {
const rows = store.getState().data;
return (prev !== null && prev.rows === rows) ? prev :
{ rows, value: rows.value };
},
({ value }) => tbody().c(map(value, (r, i) => RowConnector(i).k(r.id))),
);

function Button(text, id) {
return div("col-sm-6 smallpad").c(
button("btn btn-primary btn-block")
.e(onClick(() => { store.dispatch({ type: id }); }))
.a({ "type": "button", "id": id })
.c(text),
);
}

render(
div("container").c(
div("jumbotron").c(
div("row").c(
div("col-md-6").c(h1().c("ivi")),
div("col-md-6").c(
div("row").c(
Button("Create 1,000 rows", "run"),
Button("Create 10,000 rows", "runlots"),
Button("Append 1,000 rows", "add"),
Button("Update every 10th row", "update"),
Button("Clear", "clear"),
Button("Swap Rows", "swaprows"),
),
),
),
),
table("table table-hover table-striped test-data").c(RowListConnector()),
GlyphIcon("preloadicon glyphicon glyphicon-remove"),
),
document.getElementById("main"),
);
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { updateNextFrame } from "ivi";
import { update } from "ivi";
import { createStore, createBox } from "ivi-state";

function random(max) {
Expand Down Expand Up @@ -59,5 +59,5 @@ export const store = createStore(
}
return state;
},
updateNextFrame,
update,
);
2 changes: 1 addition & 1 deletion webdriver-ts/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export let frameworks = [
f("hyperhtml-v2.4.0-keyed", true),
f("inferno-v4.0.6-keyed", true),
f("inferno-v4.0.6-non-keyed", false),
f("ivi-v0.10.0-keyed", true),
f("ivi-v0.13.0-keyed", true),
f("knockout-v3.4.1-keyed", true),
f("knockout-v3.4.2-ko-jsx-keyed", true),
f("lit-html-v0.10.0-keyed", true),
Expand Down