Skip to content

Commit 6e048ba

Browse files
authored
Merge branch 'krausest:master' into master
2 parents 61ad2c1 + e80bd6d commit 6e048ba

File tree

515 files changed

+77218
-46671
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

515 files changed

+77218
-46671
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ angular*/app/app.js.map
4242
angular*/src/app.ngsummary.json
4343
tests/results/completed/
4444
target/
45+
webdriver-ts/chrome_profile
4546
webdriver-ts/results/
4647
webdriver-ts/traces/
4748
webdriver-ts/results*/
@@ -83,3 +84,6 @@ Cargo.lock
8384
*~
8485
frameworks/keyed/doohtml/js/doo.html.min.js.LICENSE.txt
8586
frameworks/non-keyed/doohtml/js/doo.html.min.js.LICENSE.txt
87+
88+
# chrome for testing
89+
chrome-mac-arm64-*

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# js-framework-benchmark
32

43
This is a simple benchmark for several javascript frameworks. The benchmarks creates a large table with randomized entries and measures the time for various operations including rendering duration.
@@ -58,7 +57,7 @@ Some frameworks like React, Vue.js or Angular, allow you to create a 1:1 relatio
5857

5958
The other mode is “non-keyed” and this is what e.g. vue.js uses by default for lists. In this mode, a change to the data items can modify DOM nodes that were associated with other data before. This can be more performant, since costly DOM operations can be avoided (e.g. first removing old nodes and then adding new nodes) and the existing DOM nodes are updated to display the new data. For React and Angular, using the item index as the key uses “non-keyed” mode for those frameworks.
6059

61-
Depending on your requirements, the “non-keyed” mode can be a performance gain or can cause severe problems, so one must carefully choose the mode and check that the framework supports that mode.
60+
Depending on your requirements, the “non-keyed” mode can be a performance gain or can cause severe problems, so one must carefully choose the mode and check that the framework supports that mode.
6261

6362
Read more here: [https://www.stefankrause.net/wp/?p=342](https://www.stefankrause.net/wp/?p=342)
6463

broken-frameworks/keyed/mikado/.gitignore

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

broken-frameworks/keyed/mikado/package.json

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

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

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

broken-frameworks/keyed/mikado/src/template/app.html

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

broken-frameworks/non-keyed/stem/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# stemjs-demo
2-
This is a demo project to learn StemJS https:/stemjs.org
2+
This is a demo project to learn StemJS https://stemjs.org
33
`Node` and `npm` need to be installed to be able to build this project.
44
In order to compile the source, you need to have `Rollup` and `Babel` installed.
55

cli.js

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-check
12
import { program } from "commander";
23

34
import {
@@ -6,43 +7,67 @@ import {
67
configureStyles,
78
copyProjectToDist,
89
createFrameworkZipArchive,
9-
updateLockfilesOfAllFrameworks,
10+
updateFrameworkLockfiles,
11+
rebuildAllFrameworks,
12+
rebuildSingleFramework,
1013
} from "./cli/index.js";
1114

12-
program.command("zip").action(createFrameworkZipArchive);
15+
program.command("zip").description("Create a zip archive of frameworks").action(createFrameworkZipArchive);
1316

14-
program.command("copy").action(copyProjectToDist);
17+
program.command("copy").description("Copy project to dist directory").action(copyProjectToDist);
1518

1619
program
1720
.command("check-obsolete")
21+
.description("Check for obsolete frameworks in the frameworks directory")
1822
.option("--debug [boolean]", "", false)
1923
.action((options) => {
2024
checkObsoleteFrameworks(options);
2125
});
2226

2327
program
2428
.command("cleanup")
29+
.description(
30+
"Clean all framework directories of package-lock.json, yarn-lock and the elm-stuff, node-modules, bower-components and dist directories"
31+
)
2532
.option("--frameworks-dir-path [string]", "", "frameworks")
26-
.option("--frameworks-types [Array<string>]", "", ["keyed", "non-keyed"])
33+
.option("--frameworks-types [types...]", "", ["keyed", "non-keyed"])
2734
.action((options) => {
2835
cleanFrameworkDirectories(options);
2936
});
3037

3138
program
3239
.command("update-lockfiles")
40+
.description("Update lockfiles for all frameworks in the frameworks directory")
3341
.option("--frameworks-dir-path [string]", "", "frameworks")
34-
.option("--frameworks-types [Array<string>]", "", ["keyed", "non-keyed"])
35-
.option("--latest-lockfile-version [number]", "", 3)
42+
.option("--frameworks-types [types...]", "", ["keyed", "non-keyed"])
43+
.option("--latest-lockfile-version [number]", "", "3")
3644
.action((options) => {
37-
updateLockfilesOfAllFrameworks(options);
45+
updateFrameworkLockfiles(options);
3846
});
3947

4048
program
4149
.command("configure-styles")
50+
.description("Configure CSS styles for all frameworks in the frameworks directory")
4251
.option("--bootstrap [boolean]", "", false)
4352
.option("--minimal [boolean]", "", false)
4453
.action(async (options) => {
4554
await configureStyles(options);
4655
});
4756

57+
program
58+
.command("rebuild-all")
59+
.option("--ci [boolean]", "", false)
60+
.option("--restart-with-framework [string]", "", "")
61+
.action((options) => {
62+
rebuildAllFrameworks({ restartWithFramework: options.restartWithFramework, useCi: options.ci });
63+
});
64+
65+
program
66+
.command("rebuild-single")
67+
.option("-f, --frameworks [frameworks...]", "", [])
68+
.option("--ci [boolean]", "", false)
69+
.action((options) => {
70+
rebuildSingleFramework(options);
71+
});
72+
4873
program.parse();

cli/check-obsolete.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
// @ts-check
12
import JSON5 from "json5";
23
import { execSync } from "node:child_process";
34
import * as fs from "node:fs";
45
import path from "node:path";
56

6-
import { getFrameworks } from "../utils/frameworks/index.js";
7+
import { getFrameworks } from "./helpers/frameworks.js";
78

89
/**
910
* @typedef {Object} Framework
@@ -61,7 +62,7 @@ function maybeObsolete(packageName) {
6162

6263
const modifiedDate = new Date(timeData.modified);
6364
const isObsolete = modifiedDate < obsoleteDate;
64-
const formattedDate = modifiedDate.toISOString().substring(0, 10);
65+
const formattedDate = modifiedDate.toISOString().slice(0, 10);
6566

6667
return { isObsolete, lastUpdate: formattedDate, packageName };
6768
} catch (error) {
@@ -81,8 +82,10 @@ const manualChecks = [];
8182
* @param {Object} options
8283
* @param {boolean} options.debug
8384
*/
84-
function checkObsoleteFrameworks(options) {
85-
const DEBUG = options.debug ?? false;
85+
export function checkObsoleteFrameworks({ debug }) {
86+
console.log("Check obsolete frameworks", "debug", debug);
87+
88+
const DEBUG = debug;
8689

8790
for (const { name, type } of frameworks) {
8891
const frameworkPath = path.join("frameworks", type, name);
@@ -93,7 +96,7 @@ function checkObsoleteFrameworks(options) {
9396
continue;
9497
}
9598

96-
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, "utf-8"));
99+
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath, "utf8"));
97100
const mainPackages = packageJSON?.["js-framework-benchmark"]?.frameworkVersionFromPackage;
98101

99102
if (!mainPackages) {
@@ -106,7 +109,7 @@ function checkObsoleteFrameworks(options) {
106109
}
107110

108111
const packages = mainPackages.split(":");
109-
const isPackageObsolete = packages.map(maybeObsolete);
112+
const isPackageObsolete = packages.map((element) => maybeObsolete(element));
110113

111114
if (DEBUG) {
112115
console.log(`Results for ${type}/${name} ${isPackageObsolete}`);
@@ -132,5 +135,3 @@ function checkObsoleteFrameworks(options) {
132135
if (manualChecks.length > 0)
133136
console.warn("\nThe following frameworks must be checked manually\n" + manualChecks.join("\n"));
134137
}
135-
136-
export { checkObsoleteFrameworks };

cli/cleanup.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @ts-check
12
import * as fs from "node:fs";
23
import path from "node:path";
34

@@ -22,8 +23,14 @@ function deleteFrameworkFiles(frameworkPath, filesToDelete) {
2223
* @param {string} options.frameworksDirPath
2324
* @param {Array<string>} options.frameworksTypes
2425
*/
25-
function cleanFrameworkDirectories(options) {
26-
const { frameworksDirPath, frameworksTypes } = options;
26+
export function cleanFrameworkDirectories({ frameworksDirPath, frameworksTypes }) {
27+
console.log(
28+
"Clean framework directories",
29+
"frameworksDirPath",
30+
frameworksDirPath,
31+
"frameworksTypes",
32+
frameworksTypes
33+
);
2734

2835
for (const frameworkType of frameworksTypes) {
2936
const frameworkDir = path.resolve(frameworksDirPath, frameworkType);
@@ -36,5 +43,3 @@ function cleanFrameworkDirectories(options) {
3643
}
3744
}
3845
}
39-
40-
export { cleanFrameworkDirectories };

0 commit comments

Comments
 (0)