Skip to content

Commit 3327adb

Browse files
committed
Update Mikado v0.7.46
1 parent ef29542 commit 3327adb

File tree

10 files changed

+56
-116
lines changed

10 files changed

+56
-116
lines changed

frameworks/keyed/mikado/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
},
1515
"scripts": {
1616
"compile": "mikado-compile src/template/app.html && mikado-compile src/template/item.html && echo Compile Complete. && exit 0",
17-
"build": "npm run compile && node task/build RELEASE=custom DEBUG=false USE_POLYFILL=false SUPPORT_CACHE=false SUPPORT_EVENTS=true SUPPORT_STORAGE=true SUPPORT_HELPERS='swap' SUPPORT_ASYNC=false SUPPORT_TRANSPORT=false SUPPORT_TEMPLATE_EXTENSION=false SUPPORT_REACTIVE=false SUPPORT_CACHE_HELPERS=false SUPPORT_POOLS=false SUPPORT_COMPILE=false && exit 0",
17+
"build": "npm run compile && node task/build RELEASE=custom DEBUG=false USE_POLYFILL=false SUPPORT_CACHE=false SUPPORT_EVENTS=true SUPPORT_STORAGE=false SUPPORT_HELPERS='swap' SUPPORT_ASYNC=false SUPPORT_TRANSPORT=false SUPPORT_TEMPLATE_EXTENSION=false SUPPORT_REACTIVE=false SUPPORT_CACHE_HELPERS=false SUPPORT_POOLS=false SUPPORT_CALLBACKS=false SUPPORT_COMPILE=false && exit 0",
1818
"build-prod": "npm run build"
1919
},
2020
"dependencies": {
21-
"mikado": "^0.6.53"
21+
"mikado": "0.7.46"
2222
},
2323
"devDependencies": {
24-
"google-closure-compiler": "20191012.0.0-nightly",
24+
"google-closure-compiler": "20191105.0.0-nightly",
2525
"mikado-compile": "0.6.5"
2626
}
2727
}

frameworks/keyed/mikado/src/data.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ let _nextId = 1;
1010

1111
export function buildData(count){
1212

13-
if(count === 1){
14-
15-
return {
16-
17-
id: _nextId++,
18-
label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)]
19-
}
20-
}
13+
// if(count === 1){
14+
//
15+
// return {
16+
//
17+
// id: _nextId++,
18+
// label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)]
19+
// }
20+
// }
2121

2222
const data = new Array(count);
2323

2424
for(let i = 0; i < count; i++){
2525

2626
data[i] = {
2727

28-
id: _nextId++,
29-
label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)]
28+
"id": _nextId++,
29+
"label": ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)]
3030
};
3131
}
3232

frameworks/keyed/mikado/src/main.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ import { buildData } from "./data.js";
55

66
Mikado.once(document.getElementById("main"), app);
77

8-
const state = { "selected": {} };
8+
let data, state = {"selected": {}};
99
const root = document.getElementById("tbody");
10-
const mikado = Mikado.new(root, item, {
10+
const view = new Mikado(root, item, {
1111
"reuse": false, "state": state
1212
})
13-
.route("run", () => { mikado.render(buildData(1000)) })
14-
.route("runlots", () => { mikado.render(buildData(10000)) })
15-
.route("add", () => { mikado.append(buildData(1000)) })
13+
.route("run", () => view.render(data = buildData(1000)))
14+
.route("runlots", () => view.render(buildData(10000)))
15+
.route("add", () => view.append(buildData(1000)))
1616
.route("update", () => {
17-
for(let i = 0, len = mikado.length; i < len; i += 10){
18-
mikado.data(i).label += " !!!";
19-
mikado.refresh(i);
17+
for(let i = 0, len = view.length, item; i < len; i += 10){
18+
(item = data[i]).label += " !!!";
19+
view.update(i, item);
2020
}
2121
})
22-
.route("clear", () => { mikado.clear() })
23-
.route("swaprows", () => { mikado.swap(1, 998) })
24-
.route("remove", target => { mikado.remove(target) })
22+
.route("clear", () => view.clear())
23+
.route("swaprows", () => view.swap(1, 998))
24+
.route("remove", target => view.remove(target))
2525
.route("select", target => {
26-
state["selected"].className = "";
27-
(state["selected"] = target).className = "danger";
26+
state.selected.className = "";
27+
(state.selected = target).className = "danger";
2828
})
2929
.listen("click");

frameworks/keyed/mikado/task/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const parameter = (function(opt){
5858
generate_exports: true,
5959
export_local_property_definitions: true,
6060
language_in: "ECMASCRIPT6_STRICT",
61-
language_out: "ECMASCRIPT5_STRICT",
61+
language_out: "ECMASCRIPT6_STRICT",
6262
process_closure_primitives: true,
6363
summary_detail_level: 3,
6464
warning_level: "VERBOSE",
@@ -88,7 +88,7 @@ const parameter = (function(opt){
8888
//formatting: "PRETTY_PRINT"
8989
});
9090

91-
exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --js='src/*.js' --js='src/template/*.es6.js' --js='node_modules/mikado/src/*.js' --js='!src/*config.js'" + flag_str + " --js_output_file='dist/main.js' && exit 0", function(){
91+
exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --js='src/*.js' --js='src/template/*.es6.js' --js='node_modules/mikado/src/*.js'" + flag_str + " --js_output_file='dist/main.js' && exit 0", function(){
9292

9393
console.log("Build Complete.");
9494
});

frameworks/keyed/mikado/webpack.config.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

frameworks/non-keyed/mikado/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
},
1515
"scripts": {
1616
"compile": "mikado-compile src/template/app.html && mikado-compile src/template/item.html && echo Compile Complete. && exit 0",
17-
"build": "npm run compile && node task/build RELEASE=custom DEBUG=false USE_POLYFILL=false SUPPORT_CACHE=false SUPPORT_EVENTS=true SUPPORT_STORAGE=true SUPPORT_HELPERS='swap' SUPPORT_ASYNC=false SUPPORT_TRANSPORT=false SUPPORT_TEMPLATE_EXTENSION=false SUPPORT_REACTIVE=false SUPPORT_CACHE_HELPERS=false SUPPORT_POOLS=false SUPPORT_COMPILE=false && exit 0",
17+
"build": "npm run compile && node task/build RELEASE=custom DEBUG=false USE_POLYFILL=false SUPPORT_CACHE=false SUPPORT_EVENTS=true SUPPORT_STORAGE=false SUPPORT_HELPERS='swap' SUPPORT_ASYNC=false SUPPORT_TRANSPORT=false SUPPORT_TEMPLATE_EXTENSION=false SUPPORT_REACTIVE=false SUPPORT_CACHE_HELPERS=false SUPPORT_POOLS=false SUPPORT_CALLBACKS=false SUPPORT_COMPILE=false && exit 0",
1818
"build-prod": "npm run build"
1919
},
2020
"dependencies": {
21-
"mikado": "^0.6.53"
21+
"mikado": "0.7.46"
2222
},
2323
"devDependencies": {
24-
"google-closure-compiler": "20191012.0.0-nightly",
24+
"google-closure-compiler": "20191105.0.0-nightly",
2525
"mikado-compile": "0.6.5"
2626
}
2727
}

frameworks/non-keyed/mikado/src/data.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ let _nextId = 1;
1010

1111
export function buildData(count){
1212

13-
if(count === 1){
14-
15-
return {
16-
17-
id: _nextId++,
18-
label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)]
19-
}
20-
}
13+
// if(count === 1){
14+
//
15+
// return {
16+
//
17+
// id: _nextId++,
18+
// label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)]
19+
// }
20+
// }
2121

2222
const data = new Array(count);
2323

2424
for(let i = 0; i < count; i++){
2525

2626
data[i] = {
2727

28-
id: _nextId++,
29-
label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)]
28+
"id": _nextId++,
29+
"label": ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)]
3030
};
3131
}
3232

frameworks/non-keyed/mikado/src/main.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@ import { buildData } from "./data.js";
55

66
Mikado.once(document.getElementById("main"), app);
77

8-
const state = { "selected": {} };
8+
let data, state = {"selected": {}};
99
const root = document.getElementById("tbody");
10-
const mikado = Mikado.new(root, item, {
10+
const view = new Mikado(root, item, {
1111
"reuse": true, "state": state
1212
})
13-
.route("run", () => { mikado.render(buildData(1000)) })
14-
.route("runlots", () => { mikado.render(buildData(10000)) })
15-
.route("add", () => { mikado.append(buildData(1000)) })
13+
.route("run", () => view.render(data = buildData(1000)))
14+
.route("runlots", () => view.render(buildData(10000)))
15+
.route("add", () => view.append(buildData(1000)))
1616
.route("update", () => {
17-
for(let i = 0, len = mikado.length; i < len; i += 10){
18-
mikado.data(i).label += " !!!";
19-
mikado.refresh(i);
17+
for(let i = 0, len = view.length, item; i < len; i += 10){
18+
(item = data[i]).label += " !!!";
19+
view.update(i, item);
2020
}
2121
})
22-
.route("clear", () => { mikado.clear() })
23-
.route("swaprows", () => { mikado.swap(1, 998) })
24-
.route("remove", target => { mikado.remove(target) })
22+
.route("clear", () => view.clear())
23+
.route("swaprows", () => view.swap(1, 998))
24+
.route("remove", target => view.remove(target))
2525
.route("select", target => {
26-
state["selected"].className = "";
27-
(state["selected"] = target).className = "danger";
26+
state.selected.className = "";
27+
(state.selected = target).className = "danger";
2828
})
2929
.listen("click");

frameworks/non-keyed/mikado/task/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const parameter = (function(opt){
5858
generate_exports: true,
5959
export_local_property_definitions: true,
6060
language_in: "ECMASCRIPT6_STRICT",
61-
language_out: "ECMASCRIPT5_STRICT",
61+
language_out: "ECMASCRIPT6_STRICT",
6262
process_closure_primitives: true,
6363
summary_detail_level: 3,
6464
warning_level: "VERBOSE",
@@ -88,7 +88,7 @@ const parameter = (function(opt){
8888
//formatting: "PRETTY_PRINT"
8989
});
9090

91-
exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --js='src/*.js' --js='src/template/*.es6.js' --js='node_modules/mikado/src/*.js' --js='!src/*config.js'" + flag_str + " --js_output_file='dist/main.js' && exit 0", function(){
91+
exec("java -jar node_modules/google-closure-compiler-java/compiler.jar" + parameter + " --js='src/*.js' --js='src/template/*.es6.js' --js='node_modules/mikado/src/*.js'" + flag_str + " --js_output_file='dist/main.js' && exit 0", function(){
9292

9393
console.log("Build Complete.");
9494
});

frameworks/non-keyed/mikado/webpack.config.js

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)