mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
* add prettierignore * switch to eslint:recommended + eslint-config-prettier * fix eslint violations * remove more .jshintrc files * better conditional structure * add prettier and update prettier ignore * add precommit hook to run prettier * add lint check to precommit and format check to ci * format all the things * add generated files * let npm do it's thing with package.json
56 lines
1.4 KiB
JavaScript
56 lines
1.4 KiB
JavaScript
module.exports = function(app) {
|
|
var Suite = window.Benchmark.Suite;
|
|
|
|
var names = ["dom", "dom-innerHTML", "marko-vdom", "react"];
|
|
|
|
var htmlFiles = ["todomvc", "marko-docs", "tabs"];
|
|
|
|
function loadScripts() {
|
|
window.createBenchmarks = {};
|
|
|
|
var scripts = [];
|
|
|
|
names.forEach(function(name) {
|
|
htmlFiles.forEach(function(htmlFile) {
|
|
scripts.push(
|
|
"./codegen-create/benchmark-" +
|
|
htmlFile +
|
|
"-" +
|
|
name +
|
|
".js"
|
|
);
|
|
});
|
|
});
|
|
|
|
return app.loadScripts(scripts);
|
|
}
|
|
|
|
function runForHtmlFile(htmlFile) {
|
|
return loadScripts(htmlFile).then(function() {
|
|
var suite = new Suite("create-" + htmlFile);
|
|
|
|
names.forEach(function(name) {
|
|
suite.add(name, function() {
|
|
return window.createBenchmarks[htmlFile + "-" + name]();
|
|
});
|
|
});
|
|
|
|
return app.runSuite(suite);
|
|
});
|
|
}
|
|
|
|
var loadScriptsPromise = loadScripts();
|
|
|
|
return function() {
|
|
var promiseChain = loadScriptsPromise;
|
|
|
|
htmlFiles.forEach(function(htmlFile) {
|
|
promiseChain = promiseChain.then(function() {
|
|
return runForHtmlFile(htmlFile);
|
|
});
|
|
});
|
|
|
|
return promiseChain;
|
|
};
|
|
};
|