Skip to content

Commit 74091db

Browse files
authored
Merge pull request #20334 from GordonSmith/DOJOLIB_BUNDLE
HPCC-34881 Refactor Dojo imports into single bundle
2 parents 653f52e + 65cbec1 commit 74091db

82 files changed

Lines changed: 357 additions & 395 deletions

Some content is hidden

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

esp/src/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
blob-report/
22
build/
3+
dist/
34
hpcc-js/
45
lib/
56
node_modules/
67
playwright/.cache/
78
playwright-report/
89
test-results/
910
types/
11+
tmp/
1012
.vscode/*
1113
!.vscode/tasks.json
1214
lws.target.txt

esp/src/CMakeLists.txt

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ project ( eclwatch )
1919
file(REMOVE_RECURSE
2020
${CMAKE_CURRENT_BINARY_DIR}/eclwatch
2121
${CMAKE_CURRENT_BINARY_DIR}/src
22+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo
2223
${CMAKE_CURRENT_BINARY_DIR}/src-react
2324
)
2425

@@ -29,6 +30,7 @@ file(COPY
2930
${CMAKE_CURRENT_SOURCE_DIR}/ganglia
3031
${CMAKE_CURRENT_SOURCE_DIR}/loader
3132
${CMAKE_CURRENT_SOURCE_DIR}/src
33+
${CMAKE_CURRENT_SOURCE_DIR}/src-dojo
3234
${CMAKE_CURRENT_SOURCE_DIR}/src-react
3335
${CMAKE_CURRENT_SOURCE_DIR}/eslint.config.mjs
3436
${CMAKE_CURRENT_SOURCE_DIR}/GetUserName.html
@@ -237,6 +239,22 @@ set ( SRCS
237239
${CMAKE_CURRENT_BINARY_DIR}/eclwatch/XrefOrphanFilesWidget.js
238240
${CMAKE_CURRENT_BINARY_DIR}/eclwatch/XrefQueryWidget.js
239241

242+
# src-dojo
243+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/index.ts
244+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/dgrid.ts
245+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/dijit.ts
246+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/dojo.ts
247+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/dojox.ts
248+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/nls/hpcc.ts
249+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/nls/bs/hpcc.ts
250+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/nls/es/hpcc.ts
251+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/nls/fr/hpcc.ts
252+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/nls/hr/hpcc.ts
253+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/nls/hu/hpcc.ts
254+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/nls/pt-br/hpcc.ts
255+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/nls/sr/hpcc.ts
256+
${CMAKE_CURRENT_BINARY_DIR}/src-dojo/nls/zh/hpcc.ts
257+
240258
# src files
241259
${CMAKE_CURRENT_BINARY_DIR}/src/DataPatterns/AttributeDesc.ts
242260
${CMAKE_CURRENT_BINARY_DIR}/src/DataPatterns/Cardinality.ts
@@ -247,15 +265,6 @@ set ( SRCS
247265
${CMAKE_CURRENT_BINARY_DIR}/src/DataPatterns/PopularPatterns.ts
248266
${CMAKE_CURRENT_BINARY_DIR}/src/DataPatterns/Report.ts
249267
${CMAKE_CURRENT_BINARY_DIR}/src/DataPatterns/StatChart.ts
250-
${CMAKE_CURRENT_BINARY_DIR}/src/nls/hpcc.ts
251-
${CMAKE_CURRENT_BINARY_DIR}/src/nls/bs/hpcc.ts
252-
${CMAKE_CURRENT_BINARY_DIR}/src/nls/es/hpcc.ts
253-
${CMAKE_CURRENT_BINARY_DIR}/src/nls/fr/hpcc.ts
254-
${CMAKE_CURRENT_BINARY_DIR}/src/nls/hr/hpcc.ts
255-
${CMAKE_CURRENT_BINARY_DIR}/src/nls/hu/hpcc.ts
256-
${CMAKE_CURRENT_BINARY_DIR}/src/nls/pt-br/hpcc.ts
257-
${CMAKE_CURRENT_BINARY_DIR}/src/nls/sr/hpcc.ts
258-
${CMAKE_CURRENT_BINARY_DIR}/src/nls/zh/hpcc.ts
259268
${CMAKE_CURRENT_BINARY_DIR}/src/react/hooks/useWsStore.ts
260269
${CMAKE_CURRENT_BINARY_DIR}/src/react/index.ts
261270
${CMAKE_CURRENT_BINARY_DIR}/src/react/render.ts
@@ -271,7 +280,6 @@ set ( SRCS
271280
${CMAKE_CURRENT_BINARY_DIR}/src/Clippy.ts
272281
${CMAKE_CURRENT_BINARY_DIR}/src/DataPatternsWidget.ts
273282
${CMAKE_CURRENT_BINARY_DIR}/src/DiskUsage.ts
274-
${CMAKE_CURRENT_BINARY_DIR}/src/dojoLib.ts
275283
${CMAKE_CURRENT_BINARY_DIR}/src/ECLArchiveWidget.ts
276284
${CMAKE_CURRENT_BINARY_DIR}/src/ESPActivity.ts
277285
${CMAKE_CURRENT_BINARY_DIR}/src/ESPBase.ts

esp/src/GetUserName.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
}
1313

1414
.container {
15-
width: 99%;
1615
position: absolute;
1716
top: 50%;
18-
transform: translateY(-50%);
17+
left: 50%;
18+
transform: translate(-50%, -50%);
1919
}
2020

2121
.formContainer {
@@ -79,8 +79,7 @@
7979
display: none;
8080
}
8181
</style>
82-
<script>dojoConfig = { async: true, parseOnLoad: false }</script>
83-
<script src="/esp/files/dist/dojoLib.eclwatch.js"></script>
82+
<script type="text/javascript" src="/esp/files/dist/src-dojo.eclwatch.js" charset="utf-8"></script>
8483
</head>
8584

8685
<body>
@@ -98,7 +97,7 @@
9897
</div>
9998

10099
<script type="text/javascript">
101-
require(["dojo/ready", "src/nlsHPCC"],
100+
require(["dojo/ready", "src-dojo/index"],
102101
function (ready, nlsHPCCMod) {
103102
var nlsHPCC = nlsHPCCMod.default;
104103
ready(function () {

esp/src/Login.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
<html>
33

44
<head>
5-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
65
<meta charset="UTF-8">
76
<title class="loginStr"></title>
87
<style type="text/css">
@@ -13,10 +12,10 @@
1312
}
1413

1514
.container {
16-
width: 99%;
1715
position: absolute;
1816
top: 50%;
19-
transform: translateY(-50%);
17+
left: 50%;
18+
transform: translate(-50%, -50%);
2019
}
2120

2221
.formContainer {
@@ -88,7 +87,7 @@
8887
display: none;
8988
}
9089
</style>
91-
<script src="/esp/files/dist/dojoLib.eclwatch.js"></script>
90+
<script type="text/javascript" src="/esp/files/dist/src-dojo.eclwatch.js" charset="utf-8"></script>
9291
</head>
9392

9493
<body>
@@ -108,7 +107,7 @@
108107
</div>
109108
</div>
110109
<script type="text/javascript">
111-
require(["dojo/ready", "src/nlsHPCC"],
110+
require(["dojo/ready", "src-dojo/index"],
112111
function (ready, nlsHPCCMod) {
113112
var nlsHPCC = nlsHPCCMod.default;
114113
ready(function () {

esp/src/eclwatch/HPCCPlatformWidget.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@ define([
4242
"dojo/text!../templates/HPCCPlatformWidget.html",
4343

4444
/* DEBUG_ONLY
45-
"src/nls/bs/hpcc",
46-
"src/nls/es/hpcc",
47-
"src/nls/fr/hpcc",
48-
"src/nls/hr/hpcc",
49-
"src/nls/hu/hpcc",
50-
"src/nls/pt-br/hpcc",
51-
"src/nls/sr/hpcc",
52-
"src/nls/zh/hpcc",
45+
"src-dojo/nls/bs/hpcc",
46+
"src-dojo/nls/es/hpcc",
47+
"src-dojo/nls/fr/hpcc",
48+
"src-dojo/nls/hr/hpcc",
49+
"src-dojo/nls/hu/hpcc",
50+
"src-dojo/nls/pt-br/hpcc",
51+
"src-dojo/nls/sr/hpcc",
52+
"src-dojo/nls/zh/hpcc",
5353
/* */
5454

5555
"hpcc/DelayLoadWidget",
@@ -504,13 +504,13 @@ define([
504504
_ondebugLanguageFiles: function () {
505505
/* DEBUG_ONLY
506506
var context = this;
507-
require(["src/nls/hpcc"], function (lang) {
507+
require(["src-dojo/nls/hpcc"], function (lang) {
508508
var languageID = [];
509509
var languageRequire = [];
510510
for (var key in lang) {
511511
if (key !== "root") {
512512
languageID.push(key);
513-
languageRequire.push("src/nls/" + key + "/hpcc");
513+
languageRequire.push("src-dojo/nls/" + key + "/hpcc");
514514
}
515515
}
516516
var errWarnGrid = registry.byId(context.id + "ErrWarnGrid");

esp/src/eclwatch/dojoConfig.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function getConfig(env) {
1919
blankGif: "/esp/files/eclwatch/img/blank.gif",
2020
paths: {
2121
"hpcc": baseUrl + "/eclwatch",
22+
"src-dojo": baseUrl + "/lib/src-dojo",
2223
"src": baseUrl + "/lib/src",
2324
"src-react": baseUrl + "/lib/src-react",
2425
"src-react-css": baseUrl + "/src-react",

esp/src/index.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<meta http-equiv="X-UA-Compatible" content="ie=edge">
88
<meta name="robots" content="noindex">
99
<title>ECL Watch</title>
10-
<script src="/esp/files/node_modules/es6-promise/dist/es6-promise.auto.min.js"></script>
1110
<link rel="stylesheet" href="/esp/files/dist/font-awesome/css/font-awesome.min.css">
1211
<link rel="icon" type="image/png" href="/esp/files/img/favlogo.png">
1312
<style>
@@ -71,6 +70,8 @@
7170
}
7271
}
7372
</script>
73+
<script type="text/javascript" src="/esp/files/dist/src-dojo.eclwatch.js" charset="utf-8"></script>
74+
<script type="text/javascript" src="/esp/files/dist/src-lib.eclwatch.js" charset="utf-8"></script>
7475
</head>
7576

7677
<body class="flat">

esp/src/lws.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ console.log("IP: " + ip);
2323
console.log("Port: " + port);
2424

2525
let rewrite = [
26+
{ from: "/esp/files/stub.htm", to: "/stub.htm" },
27+
{ from: "/esp/files/index.html", to: "/index.html" },
28+
{ from: "/esp/files/Login.html", to: "/Login.html" },
29+
{ from: "/esp/files/GetUserName.html", to: "/GetUserName.html" },
2630
{ from: "/esp/titlebar(.*)", to: protocol + "://" + ip + ":" + port + "/esp/titlebar$1" },
2731
{ from: "/esp/login", to: protocol + "://" + ip + ":" + port + "/esp/login" },
2832
{ from: "/esp/logout", to: protocol + "://" + ip + ":" + port + "/esp/logout" },

esp/src/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
"clean": "rimraf ./build ./lib ./types ./src/nlsHPCCType.ts",
77
"lint": "eslint ./eclwatch ./src ./src-react",
88
"lint-fix": "eslint --fix eclwatch/**/*.js src/**/*.ts src-react/**/*.ts?",
9-
"copy-res-es6-promise": "copyfiles -u 3 \"./node_modules/es6-promise/dist/es6-promise.auto.min.js\" ./build/node_modules/es6-promise/dist/",
109
"copy-res-eclwatch-img": "copyfiles -u 2 \"./eclwatch/img/**/*.{png,jpg,gif,svg}\" ./build/eclwatch/img/",
1110
"copy-res-eclwatch-ecl": "copyfiles -u 2 \"./eclwatch/ecl/**/*.*\" ./build/eclwatch/ecl/",
1211
"copy-res-dgrid-shim": "copyfiles -u 4 \"./node_modules/@hpcc-js/dgrid-shim/dist/index.min.js\" ./build/dgrid-shim/",
1312
"copy-res-dojo-img": "copyfiles -u 3 \"./node_modules/dojo/resources/blank.gif\" ./build/eclwatch/img/",
1413
"copy-res-dojo": "copyfiles -u 3 \"./node_modules/dojo/resources/**/*.{png,jpg,gif}\" ./build/node_modules/dojo/resources/",
1514
"copy-res-dojox": "copyfiles -u 5 \"./node_modules/dojox/widget/ColorPicker/images/**/*.{png,jpg,gif}\" ./build/eclwatch/img/",
15+
"copy-res-dgrid-css": "copyfiles -u 2 \"./dgrid/css/**/*\" ./lib/dgrid/css/",
1616
"copy-res-TopoJSON": "copyfiles -u 4 \"./node_modules/@hpcc-js/map/TopoJSON/**/*\" ./build/dist/TopoJSON/",
1717
"copy-res-font-awesome": "copyfiles -u 2 \"./node_modules/font-awesome/**/*\" ./build/dist/font-awesome/",
1818
"copy-res-fluentui-fonts": "copyfiles -f \"./node_modules/@fluentui/font-icons-mdl2/fonts/*\" ./build/dist/fluentui-fonts/",
1919
"copy-res-html": "copyfiles \"./*.{htm,html}\" ./build/",
20-
"copy-res": "run-p copy-res-es6-promise copy-res-eclwatch-img copy-res-eclwatch-ecl copy-res-dgrid-shim copy-res-dojo-img copy-res-dojo copy-res-dojox copy-res-TopoJSON copy-res-font-awesome copy-res-fluentui-fonts copy-res-html",
20+
"copy-res": "run-p copy-res-eclwatch-img copy-res-eclwatch-ecl copy-res-dgrid-shim copy-res-dojo-img copy-res-dojo copy-res-dojox copy-res-dgrid-css copy-res-TopoJSON copy-res-font-awesome copy-res-fluentui-fonts copy-res-html",
2121
"compile": "tsc",
2222
"compile-watch": "npm run compile -- -w",
2323
"bundle": "node node_modules/webpack/bin/webpack.js --env production --config webpack.config.js",
@@ -72,7 +72,6 @@
7272
"dojo": "1.17.3",
7373
"dojo-util": "1.17.3",
7474
"dojox": "1.17.3",
75-
"es6-promise": "4.2.8",
7675
"font-awesome": "4.7.0",
7776
"formik": "2.4.6",
7877
"octokit": "4.1.4",

esp/src/src-dojo/dgrid.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// @ts-expect-error
2+
export * as Grid from "dgrid/Grid";
3+
// @ts-expect-error
4+
export * as List from "dgrid/List";
5+
// @ts-expect-error
6+
export * as OnDemandGrid from "dgrid/OnDemandGrid";
7+
// @ts-expect-error
8+
export * as StoreMixin from "dgrid/_StoreMixin";
9+
// @ts-expect-error
10+
export * as selector from "dgrid/selector";
11+
// @ts-expect-error
12+
export * as tree from "dgrid/tree";
13+
// @ts-expect-error
14+
export * as editor from "dgrid/editor";
15+
// @ts-expect-error
16+
export * as Keyboard from "dgrid/Keyboard";
17+
// @ts-expect-error
18+
export * as Selection from "dgrid/Selection";
19+
20+
// @ts-expect-error
21+
export * as Pagination from "dgrid/extensions/Pagination";
22+
// @ts-expect-error
23+
export * as ColumnResizer from "dgrid/extensions/ColumnResizer";
24+
// @ts-expect-error
25+
export * as CompoundColumns from "dgrid/extensions/CompoundColumns";
26+
// @ts-expect-error
27+
export * as DijitRegistry from "dgrid/extensions/DijitRegistry";
28+
29+
import "dgrid/TouchScroll";
30+
import "dgrid/util/misc";
31+
import "dgrid/util/touch";
32+
import "dgrid/util/has-css3";
33+
import "dgrid/css/dgrid.css";
34+

0 commit comments

Comments
 (0)