Skip to content

Commit f2ea2d5

Browse files
Charts: use commonjs exports for debug functions to avoid reference error in transpiled code (DevExpress#31036)
1 parent 981f35b commit f2ea2d5

File tree

15 files changed

+71
-59
lines changed

15 files changed

+71
-59
lines changed

packages/devextreme/js/__internal/viz/components/legend.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-import-module-exports */
12
/* eslint-disable @typescript-eslint/no-unused-vars */
23
/* eslint-disable @typescript-eslint/default-param-last */
34
/* eslint-disable no-return-assign */
@@ -1281,17 +1282,17 @@ export const plugin = {
12811282
};
12821283

12831284
/// #DEBUG
1284-
export const _setLegend = function (value) {
1285+
exports._setLegend = function (value) {
12851286
Legend = value;
12861287
};
12871288

12881289
const __getMarkerCreator = getMarkerCreator;
1289-
export const _DEBUG_stubMarkerCreator = function (callback) {
1290+
exports._DEBUG_stubMarkerCreator = function (callback) {
12901291
getMarkerCreator = function () {
12911292
return callback;
12921293
};
12931294
};
1294-
export const _DEBUG_restoreMarkerCreator = function () {
1295+
exports._DEBUG_restoreMarkerCreator = function () {
12951296
getMarkerCreator = __getMarkerCreator;
12961297
};
12971298
/// #ENDDEBUG

packages/devextreme/js/__internal/viz/core/base_widget.utils.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-import-module-exports */
12
/* eslint-disable @typescript-eslint/no-implied-eval */
23
/* eslint-disable prefer-spread */
34
/* eslint-disable @typescript-eslint/init-declarations */
@@ -130,13 +131,13 @@ export { createEventTrigger as DEBUG_createEventTrigger };
130131

131132
export const DEBUG_createIncidentOccurred = createIncidentOccurred;
132133

133-
export function DEBUG_stub_createIncidentOccurred(stub) {
134+
exports.DEBUG_stub_createIncidentOccurred = function (stub) {
134135
createIncidentOccurred = stub;
135-
}
136+
};
136137

137-
export function DEBUG_restore_createIncidentOccurred() {
138+
exports.DEBUG_restore_createIncidentOccurred = function () {
138139
createIncidentOccurred = DEBUG_createIncidentOccurred;
139-
}
140+
};
140141

141142
export { createResizeHandler as DEBUG_createResizeHandler };
142143
/// #ENDDEBUG

packages/devextreme/js/__internal/viz/core/export.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
/* eslint-disable import/no-import-module-exports */
12
/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */
23
/* eslint-disable no-restricted-globals */
34
/* eslint-disable func-names */
45
/* eslint-disable import/no-mutable-exports */
5-
/* eslint-disable @typescript-eslint/naming-convention */
66
/* eslint-disable no-nested-ternary */
77
/* eslint-disable @typescript-eslint/no-shadow */
88
/* eslint-disable consistent-return */
@@ -819,11 +819,11 @@ export const plugin = {
819819
};
820820

821821
/// #DEBUG
822-
export const DEBUG_set_combineMarkups = function (value) {
822+
exports.DEBUG_set_combineMarkups = function (value) {
823823
combineMarkups = value;
824824
};
825825

826-
export const DEBUG_set_ExportMenu = function (value) {
826+
exports.DEBUG_set_ExportMenu = function (value) {
827827
ExportMenu = value;
828828
};
829829
/// #ENDDEBUG

packages/devextreme/js/__internal/viz/core/loading_indicator.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-import-module-exports */
12
/* eslint-disable prefer-rest-params */
23
/* eslint-disable @typescript-eslint/no-this-alias */
34
/* eslint-disable @typescript-eslint/init-declarations */
@@ -209,8 +210,9 @@ export const plugin = {
209210
},
210211
fontFields: ['loadingIndicator.font'],
211212
};
213+
212214
/// #DEBUG
213-
export const DEBUG_set_LoadingIndicator = function (value) {
215+
exports.DEBUG_set_LoadingIndicator = function (value) {
214216
LoadingIndicator = value;
215217
};
216218
/// #ENDDEBUG

packages/devextreme/js/__internal/viz/core/renderers/renderer.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-import-module-exports */
12
/* eslint-disable @typescript-eslint/prefer-optional-chain */
23
/* eslint-disable @typescript-eslint/no-unused-vars */
34
/* eslint-disable @typescript-eslint/default-param-last */
@@ -107,7 +108,7 @@ const DEFAULTS = {
107108
'pointer-events': null,
108109
};
109110

110-
const getBackup = callOnce(() => {
111+
export const getBackup = callOnce(() => {
111112
const backupContainer = domAdapter.createElement('div');
112113
const backupCounter = 0;
113114
backupContainer.style.left = '-9999px';
@@ -1391,15 +1392,6 @@ function arcAnimate(params, options, complete) {
13911392
return baseAnimate(that, params, options, complete);
13921393
}
13931394

1394-
/// #DEBUG
1395-
export const DEBUG_removeBackupContainer = function () {
1396-
if (getBackup().backupCounter) {
1397-
getBackup().backupCounter = 0;
1398-
domAdapter.getBody().removeChild(getBackup().backupContainer);
1399-
}
1400-
};
1401-
/// #ENDDEBUG
1402-
14031395
function buildLink(target, parameters) {
14041396
const obj = { is: false, name: parameters.name || parameters, after: parameters.after };
14051397
if (target) {
@@ -2351,23 +2343,31 @@ export const refreshPaths = function () {
23512343
};
23522344

23532345
/// #DEBUG
2354-
export const DEBUG_set_SvgElement = function (value) {
2346+
const DEBUG_set_SvgElement = function (value) {
23552347
SvgElement = value;
23562348
};
23572349

2358-
export const DEBUG_set_RectSvgElement = function (value) {
2350+
const DEBUG_set_RectSvgElement = function (value) {
23592351
RectSvgElement = value;
23602352
};
23612353

2362-
export const DEBUG_set_PathSvgElement = function (value) {
2354+
const DEBUG_set_PathSvgElement = function (value) {
23632355
PathSvgElement = value;
23642356
};
23652357

2366-
export const DEBUG_set_ArcSvgElement = function (value) {
2358+
const DEBUG_set_ArcSvgElement = function (value) {
23672359
ArcSvgElement = value;
23682360
};
23692361

2370-
export const DEBUG_set_TextSvgElement = function (value) {
2362+
const DEBUG_set_TextSvgElement = function (value) {
23712363
TextSvgElement = value;
23722364
};
23732365
/// #ENDDEBUG
2366+
2367+
/// #DEBUG
2368+
exports.DEBUG_set_ArcSvgElement = DEBUG_set_ArcSvgElement;
2369+
exports.DEBUG_set_PathSvgElement = DEBUG_set_PathSvgElement;
2370+
exports.DEBUG_set_RectSvgElement = DEBUG_set_RectSvgElement;
2371+
exports.DEBUG_set_SvgElement = DEBUG_set_SvgElement;
2372+
exports.DEBUG_set_TextSvgElement = DEBUG_set_TextSvgElement;
2373+
/// #ENDDEBUG

packages/devextreme/js/__internal/viz/core/title.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-import-module-exports */
12
/* eslint-disable @typescript-eslint/no-this-alias */
23
/* eslint-disable @typescript-eslint/init-declarations */
34
/* eslint-disable func-names */
@@ -357,7 +358,7 @@ export const plugin = {
357358
};
358359

359360
/// #DEBUG
360-
export const DEBUG_set_title = function (value) {
361+
exports.DEBUG_set_title = function (value) {
361362
Title = value;
362363
};
363364
/// #ENDDEBUG

packages/devextreme/js/__internal/viz/core/tooltip.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
/* eslint-disable import/no-import-module-exports */
12
/* eslint-disable @typescript-eslint/no-base-to-string */
23
/* eslint-disable @typescript-eslint/no-this-alias */
34
/* eslint-disable default-case */
45
/* eslint-disable no-restricted-syntax */
56
/* eslint-disable guard-for-in */
67
/* eslint-disable func-names */
78
/* eslint-disable import/no-mutable-exports */
8-
/* eslint-disable @typescript-eslint/naming-convention */
99
/* eslint-disable consistent-return */
1010
/* eslint-disable no-param-reassign */
1111
/* eslint-disable no-multi-assign */
@@ -516,7 +516,7 @@ export const plugin = {
516516
};
517517

518518
/// #DEBUG
519-
export const DEBUG_set_tooltip = function (value) {
519+
exports.DEBUG_set_tooltip = function (value) {
520520
Tooltip = value;
521521
};
522522
/// #ENDDEBUG

packages/devextreme/js/__internal/viz/gauges/bar_gauge.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-import-module-exports */
12
/* eslint-disable prefer-rest-params */
23
/* eslint-disable @stylistic/no-mixed-operators */
34
/* eslint-disable prefer-spread */
@@ -857,11 +858,11 @@ const __BarWrapper = BarWrapper;
857858

858859
export { __BarWrapper as BarWrapper };
859860

860-
export function stubBarWrapper(barWrapperType) {
861+
exports.stubBarWrapper = function (barWrapperType) {
861862
BarWrapper = barWrapperType;
862-
}
863+
};
863864

864-
export function restoreBarWrapper() {
865+
exports.restoreBarWrapper = function () {
865866
BarWrapper = __BarWrapper;
866-
}
867+
};
867868
/// #ENDDEBUG

packages/devextreme/js/__internal/viz/themes.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-import-module-exports */
12
/* eslint-disable @typescript-eslint/no-dynamic-delete */
23
/* eslint-disable @typescript-eslint/init-declarations */
34
/* eslint-disable no-plusplus */
@@ -255,7 +256,7 @@ export {
255256
widgetsCache,
256257
};
257258

258-
export const resetCurrentTheme = function () {
259+
exports.resetCurrentTheme = function () {
259260
currentThemeName = null;
260261
};
261262
/// #ENDDEBUG

packages/devextreme/js/__internal/viz/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1+
/* eslint-disable import/no-import-module-exports */
12
/* eslint-disable prefer-rest-params */
23
/* eslint-disable no-bitwise */
34
/* eslint-disable @typescript-eslint/init-declarations */
45
/* eslint-disable func-names */
56
/* eslint-disable import/no-mutable-exports */
6-
/* eslint-disable @typescript-eslint/naming-convention */
77
/* eslint-disable @typescript-eslint/no-shadow */
88
/* eslint-disable no-param-reassign */
99
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
@@ -104,7 +104,7 @@ export const floorCanvasDimensions = function (canvas) {
104104
};
105105

106106
/// #DEBUG
107-
export const _test_prepareSegmentRectPoints = function () {
107+
exports._test_prepareSegmentRectPoints = function () {
108108
// @ts-expect-error
109109
const original = prepareSegmentRectPoints.original || prepareSegmentRectPoints;
110110
if (arguments[0]) {

0 commit comments

Comments
 (0)