diff --git a/frameworks/keyed/mikado/package.json b/frameworks/keyed/mikado/package.json index 810665616..071484876 100644 --- a/frameworks/keyed/mikado/package.json +++ b/frameworks/keyed/mikado/package.json @@ -14,14 +14,14 @@ }, "scripts": { "compile": "mikado-compile src/template/app.html && mikado-compile src/template/item.html && echo Compile Complete. && exit 0", - "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", + "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", "build-prod": "npm run build" }, "dependencies": { - "mikado": "^0.6.53" + "mikado": "0.7.46" }, "devDependencies": { - "google-closure-compiler": "20191012.0.0-nightly", + "google-closure-compiler": "20191105.0.0-nightly", "mikado-compile": "0.6.5" } } diff --git a/frameworks/keyed/mikado/src/data.js b/frameworks/keyed/mikado/src/data.js index 7a0a2f369..235abc12d 100644 --- a/frameworks/keyed/mikado/src/data.js +++ b/frameworks/keyed/mikado/src/data.js @@ -10,14 +10,14 @@ let _nextId = 1; export function buildData(count){ - if(count === 1){ - - return { - - id: _nextId++, - label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)] - } - } + // if(count === 1){ + // + // return { + // + // id: _nextId++, + // label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)] + // } + // } const data = new Array(count); @@ -25,8 +25,8 @@ export function buildData(count){ data[i] = { - id: _nextId++, - label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)] + "id": _nextId++, + "label": ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)] }; } diff --git a/frameworks/keyed/mikado/src/main.js b/frameworks/keyed/mikado/src/main.js index b21328ac2..fde329bda 100644 --- a/frameworks/keyed/mikado/src/main.js +++ b/frameworks/keyed/mikado/src/main.js @@ -5,25 +5,25 @@ import { buildData } from "./data.js"; Mikado.once(document.getElementById("main"), app); -const state = { "selected": {} }; +let data, state = {"selected": {}}; const root = document.getElementById("tbody"); -const mikado = Mikado.new(root, item, { +const view = new Mikado(root, item, { "reuse": false, "state": state }) -.route("run", () => { mikado.render(buildData(1000)) }) -.route("runlots", () => { mikado.render(buildData(10000)) }) -.route("add", () => { mikado.append(buildData(1000)) }) +.route("run", () => view.render(data = buildData(1000))) +.route("runlots", () => view.render(buildData(10000))) +.route("add", () => view.append(buildData(1000))) .route("update", () => { - for(let i = 0, len = mikado.length; i < len; i += 10){ - mikado.data(i).label += " !!!"; - mikado.refresh(i); + for(let i = 0, len = view.length, item; i < len; i += 10){ + (item = data[i]).label += " !!!"; + view.update(i, item); } }) -.route("clear", () => { mikado.clear() }) -.route("swaprows", () => { mikado.swap(1, 998) }) -.route("remove", target => { mikado.remove(target) }) +.route("clear", () => view.clear()) +.route("swaprows", () => view.swap(1, 998)) +.route("remove", target => view.remove(target)) .route("select", target => { - state["selected"].className = ""; - (state["selected"] = target).className = "danger"; + state.selected.className = ""; + (state.selected = target).className = "danger"; }) .listen("click"); diff --git a/frameworks/keyed/mikado/task/build.js b/frameworks/keyed/mikado/task/build.js index 6e5f10db0..929d26370 100644 --- a/frameworks/keyed/mikado/task/build.js +++ b/frameworks/keyed/mikado/task/build.js @@ -58,7 +58,7 @@ const parameter = (function(opt){ generate_exports: true, export_local_property_definitions: true, language_in: "ECMASCRIPT6_STRICT", - language_out: "ECMASCRIPT5_STRICT", + language_out: "ECMASCRIPT6_STRICT", process_closure_primitives: true, summary_detail_level: 3, warning_level: "VERBOSE", @@ -88,7 +88,7 @@ const parameter = (function(opt){ //formatting: "PRETTY_PRINT" }); -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(){ +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(){ console.log("Build Complete."); }); diff --git a/frameworks/keyed/mikado/webpack.config.js b/frameworks/keyed/mikado/webpack.config.js deleted file mode 100644 index 97f8b2a5e..000000000 --- a/frameworks/keyed/mikado/webpack.config.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; -var path = require('path') - -module.exports = [{ - module: { - rules: [{ - test: /\.jsx?$/, - exclude: /node_modules/, - use: [ - { - loader: 'babel-loader', - options: { - presets: ['@babel/preset-env'], - plugins: [], - } - } - ] - }] - }, - entry: { - main: './src/main.js', - }, - output: { - path: path.resolve(__dirname, "dist"), - filename: '[name].js' - }, - resolve: { - extensions: ['.js'] - } -}]; \ No newline at end of file diff --git a/frameworks/non-keyed/mikado/package.json b/frameworks/non-keyed/mikado/package.json index 810665616..071484876 100644 --- a/frameworks/non-keyed/mikado/package.json +++ b/frameworks/non-keyed/mikado/package.json @@ -14,14 +14,14 @@ }, "scripts": { "compile": "mikado-compile src/template/app.html && mikado-compile src/template/item.html && echo Compile Complete. && exit 0", - "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", + "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", "build-prod": "npm run build" }, "dependencies": { - "mikado": "^0.6.53" + "mikado": "0.7.46" }, "devDependencies": { - "google-closure-compiler": "20191012.0.0-nightly", + "google-closure-compiler": "20191105.0.0-nightly", "mikado-compile": "0.6.5" } } diff --git a/frameworks/non-keyed/mikado/src/data.js b/frameworks/non-keyed/mikado/src/data.js index 7a0a2f369..235abc12d 100644 --- a/frameworks/non-keyed/mikado/src/data.js +++ b/frameworks/non-keyed/mikado/src/data.js @@ -10,14 +10,14 @@ let _nextId = 1; export function buildData(count){ - if(count === 1){ - - return { - - id: _nextId++, - label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)] - } - } + // if(count === 1){ + // + // return { + // + // id: _nextId++, + // label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)] + // } + // } const data = new Array(count); @@ -25,8 +25,8 @@ export function buildData(count){ data[i] = { - id: _nextId++, - label: ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)] + "id": _nextId++, + "label": ADJECTIVES[_random(len_ADJECTIVES)] + " " + COLOURS[_random(len_COLOURS)] + " " + NOUNS[_random(len_NOUNS)] }; } diff --git a/frameworks/non-keyed/mikado/src/main.js b/frameworks/non-keyed/mikado/src/main.js index 3d7399955..1faf96264 100644 --- a/frameworks/non-keyed/mikado/src/main.js +++ b/frameworks/non-keyed/mikado/src/main.js @@ -5,25 +5,25 @@ import { buildData } from "./data.js"; Mikado.once(document.getElementById("main"), app); -const state = { "selected": {} }; +let data, state = {"selected": {}}; const root = document.getElementById("tbody"); -const mikado = Mikado.new(root, item, { +const view = new Mikado(root, item, { "reuse": true, "state": state }) -.route("run", () => { mikado.render(buildData(1000)) }) -.route("runlots", () => { mikado.render(buildData(10000)) }) -.route("add", () => { mikado.append(buildData(1000)) }) +.route("run", () => view.render(data = buildData(1000))) +.route("runlots", () => view.render(buildData(10000))) +.route("add", () => view.append(buildData(1000))) .route("update", () => { - for(let i = 0, len = mikado.length; i < len; i += 10){ - mikado.data(i).label += " !!!"; - mikado.refresh(i); + for(let i = 0, len = view.length, item; i < len; i += 10){ + (item = data[i]).label += " !!!"; + view.update(i, item); } }) -.route("clear", () => { mikado.clear() }) -.route("swaprows", () => { mikado.swap(1, 998) }) -.route("remove", target => { mikado.remove(target) }) +.route("clear", () => view.clear()) +.route("swaprows", () => view.swap(1, 998)) +.route("remove", target => view.remove(target)) .route("select", target => { - state["selected"].className = ""; - (state["selected"] = target).className = "danger"; + state.selected.className = ""; + (state.selected = target).className = "danger"; }) .listen("click"); diff --git a/frameworks/non-keyed/mikado/task/build.js b/frameworks/non-keyed/mikado/task/build.js index 6e5f10db0..929d26370 100644 --- a/frameworks/non-keyed/mikado/task/build.js +++ b/frameworks/non-keyed/mikado/task/build.js @@ -58,7 +58,7 @@ const parameter = (function(opt){ generate_exports: true, export_local_property_definitions: true, language_in: "ECMASCRIPT6_STRICT", - language_out: "ECMASCRIPT5_STRICT", + language_out: "ECMASCRIPT6_STRICT", process_closure_primitives: true, summary_detail_level: 3, warning_level: "VERBOSE", @@ -88,7 +88,7 @@ const parameter = (function(opt){ //formatting: "PRETTY_PRINT" }); -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(){ +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(){ console.log("Build Complete."); }); diff --git a/frameworks/non-keyed/mikado/webpack.config.js b/frameworks/non-keyed/mikado/webpack.config.js deleted file mode 100644 index 97f8b2a5e..000000000 --- a/frameworks/non-keyed/mikado/webpack.config.js +++ /dev/null @@ -1,30 +0,0 @@ -'use strict'; -var path = require('path') - -module.exports = [{ - module: { - rules: [{ - test: /\.jsx?$/, - exclude: /node_modules/, - use: [ - { - loader: 'babel-loader', - options: { - presets: ['@babel/preset-env'], - plugins: [], - } - } - ] - }] - }, - entry: { - main: './src/main.js', - }, - output: { - path: path.resolve(__dirname, "dist"), - filename: '[name].js' - }, - resolve: { - extensions: ['.js'] - } -}]; \ No newline at end of file