Skip to content

Commit 9f22c15

Browse files
authored
Themes perf check (#12)
1 parent 13e713c commit 9f22c15

8 files changed

Lines changed: 914 additions & 140 deletions

File tree

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
14
1+
20

lib/cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const appToServeMap = new Map([
77
["tr", "test-runner"],
88
["bv", "benchmark-viewer"],
99
]);
10-
const hotVersionRegExp = /^(\d{1,3}\.\d{1,3}\.\d{1,3}|latest)$/;
10+
const hotVersionRegExp = /^((\d{1,3}\.\d{1,3}\.\d{1,3}|latest)(\-next\-([a-z0-9]){7}\-[0-9]{8})?)$/;
1111

1212
function parseArgs() {
1313
program

lib/commands/local-server/index.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,27 @@ module.exports = async function (
6161
};
6262

6363
function getHotUrl({ hotVersion, hotServer } = {}) {
64-
const urls = { script: "", style: "" };
64+
const urls = {
65+
script: "",
66+
style_core: "",
67+
style_theme_main: "",
68+
style_theme_horizon: "",
69+
};
6570

6671
if (hotServer) {
6772
urls.script = `${hotServer}/dist/handsontable.full.js`;
68-
urls.style = `${hotServer}/dist/handsontable.full.css`;
73+
// urls.style_core = `${hotServer}/dist/handsontable.full.css`;
74+
urls.style_core = `${hotServer}/styles/handsontable.css`;
75+
urls.style_theme_main = `${hotServer}/styles/ht-theme-main.css`;
76+
// urls.style_core = `${hotServer}/styles_processed/handsontable.css`;
77+
// urls.style_theme_main = `${hotServer}/styles_processed/ht-theme-main.css`;
78+
// urls.style_theme_horizon = `${hotServer}/styles/ht-theme-horizon.css`;
6979
} else {
7080
urls.script = `https://cdn.jsdelivr.net/npm/handsontable@${hotVersion}/dist/handsontable.full.js`;
71-
urls.style = `https://cdn.jsdelivr.net/npm/handsontable@${hotVersion}/dist/handsontable.full.css`;
81+
// urls.style_core = `https://cdn.jsdelivr.net/npm/handsontable@${hotVersion}/dist/handsontable.full.css`;
82+
urls.style_core = `https://cdn.jsdelivr.net/npm/handsontable@${hotVersion}/styles/handsontable.css`;
83+
urls.style_theme_main = `https://cdn.jsdelivr.net/npm/handsontable@${hotVersion}/styles/ht-theme-main.css`;
84+
// urls.style_theme_horizon = `https://cdn.jsdelivr.net/npm/handsontable@${hotVersion}/styles/ht-theme-horizon.css`;
7285
}
7386

7487
return urls;

lib/commands/local-server/public/js/bar-item.js

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,7 @@
5151
return version.replace(/_/g, ".");
5252
})
5353
.sort(function (a, b) {
54-
if (a === b) {
55-
return 0;
56-
}
57-
58-
if (!SemVer.valid(a) || !SemVer.valid(b)) {
59-
return 1;
60-
}
61-
62-
return SemVer.lt(a, b) ? 1 : -1;
54+
return a.localeCompare(b);
6355
});
6456

6557
selHotVersion.appendChild(this._buildOptionsList(hotVersions));

lib/commands/local-server/templates/test-runner.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<!doctype html>
22
<head>
33
<title></title>
4-
<link rel="stylesheet" href="{{ urls.style }}">
4+
<link rel="stylesheet" href="{{ urls.style_core }}">
5+
<link rel="stylesheet" href="{{ urls.style_theme_main }}">
6+
<link rel="stylesheet" href="{{ urls.style_theme_horizon }}">
57
<script src="{{ urls.script }}"></script>
68
<script src="/js/test-runner.js"></script>
79
<style>
@@ -14,19 +16,26 @@
1416
</head>
1517
<html>
1618
<body>
17-
1819
<div id="example"></div>
1920
<script>
2021
var hot = new Handsontable(example, {
2122
licenseKey: 'non-commercial-and-evaluation',
2223
data: Handsontable.helper.createSpreadsheetData(1000, 1000),
2324
rowHeaders: true,
2425
colHeaders: true,
26+
themeName: 'ht-theme-main',
27+
rowHeights: 37,
28+
colWidths: 80,
29+
viewportColumnRenderingOffset: 5,
30+
viewportRowRenderingOffset: 5,
31+
// renderAllRows: true,
32+
// renderAllColumns: true,
2533
// renderer: function(instance, TD, row, col, prop, value, cellProperties) {
2634
// TD.classList.add('test-class');
2735
// TD.innerHTML = '.<b>' + value + '</b>';
2836
// },
29-
autoColumnSize: false, // AutoColumnSize is asynchronous so it has to be disabled to not inferred stat results
37+
autoRowSize: false, // autoRowSize is asynchronous so it has to be disabled to not inferred stat results
38+
autoColumnSize: false, // autoColumnSize is asynchronous so it has to be disabled to not inferred stat results
3039
});
3140
</script>
3241
<script>document.writeln('Build date: ' + Handsontable.buildDate + ', version: ' + Handsontable.version)</script>

0 commit comments

Comments
 (0)