This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch next-npm-env
in repository https://gitbox.apache.org/repos/asf/incubator-echarts.git


The following commit(s) were added to refs/heads/next-npm-env by this push:
     new 0dae350  chore(prepublish): transform __DEV__ to node env expr.
0dae350 is described below

commit 0dae35077c0233fa5f089508bcb765393c2686ac
Author: pissang <[email protected]>
AuthorDate: Tue Jul 28 13:01:44 2020 +0800

    chore(prepublish): transform __DEV__ to node env expr.
---
 build/build.js                                      |  4 ++--
 build/config.js                                     |  4 ++--
 build/pre-publish.js                                | 21 +++++++++------------
 ...abel-plugin.js => transform-dev-babel-plugin.js} | 20 ++++++++++----------
 ...lup-plugin.js => transform-dev-rollup-plugin.js} |  8 ++++----
 build/{remove-dev.js => transform-dev.js}           |  2 +-
 src/.eslintrc.yaml                                  |  1 +
 src/chart/bar/BarView.ts                            |  1 -
 src/chart/custom.ts                                 |  1 -
 src/chart/heatmap/HeatmapView.ts                    |  1 -
 src/chart/line/LineSeries.ts                        |  1 -
 src/chart/line/LineView.ts                          |  1 -
 src/chart/lines/LinesSeries.ts                      |  1 -
 src/chart/lines/LinesView.ts                        |  1 -
 src/chart/sankey/SankeySeries.ts                    |  1 -
 src/chart/sunburst/sunburstAction.ts                |  1 -
 src/chart/tree/TreeView.ts                          |  1 -
 src/component/axis/AxisView.ts                      |  1 -
 src/component/brush/BrushModel.ts                   |  1 -
 src/component/dataZoom/DataZoomModel.ts             |  1 -
 src/component/dataZoom/SliderZoomView.ts            |  1 -
 src/component/dataZoom/helper.ts                    |  1 -
 src/component/graphic.ts                            |  1 -
 src/component/helper/BrushController.ts             |  1 -
 src/component/helper/BrushTargetManager.ts          |  1 -
 src/component/legend/LegendView.ts                  |  1 -
 src/component/marker/MarkLineView.ts                |  3 +--
 src/component/marker/MarkerModel.ts                 |  1 -
 src/component/radar/RadarView.ts                    |  1 -
 src/component/visualMap/PiecewiseModel.ts           |  1 -
 src/config.ts                                       |  2 +-
 src/coord/calendar/Calendar.ts                      |  1 -
 src/coord/cartesian/Grid.ts                         |  1 -
 src/coord/cartesian/cartesianAxisHelper.ts          |  1 -
 src/coord/geo/geoCreator.ts                         |  1 -
 src/coord/geo/geoSourceManager.ts                   |  1 -
 src/coord/geo/mapDataStorage.ts                     |  1 -
 src/coord/polar/polarCreator.ts                     |  1 -
 src/coord/scaleRawExtentInfo.ts                     |  1 -
 src/data/Graph.ts                                   |  1 -
 src/data/List.ts                                    |  1 -
 src/data/helper/dataProvider.ts                     |  1 -
 src/data/helper/dimensionHelper.ts                  |  1 -
 src/data/helper/sourceHelper.ts                     |  1 -
 src/echarts.ts                                      |  2 --
 src/label/labelStyle.ts                             |  1 -
 src/legacy/dataSelectAction.ts                      |  1 -
 src/model/Global.ts                                 |  1 -
 src/model/Series.ts                                 |  1 -
 src/model/internalComponentCreator.ts               |  1 -
 src/model/referHelper.ts                            |  1 -
 src/preprocessor/backwardCompat.ts                  |  1 -
 src/preprocessor/helper/compatStyle.ts              |  1 -
 src/stream/task.ts                                  |  1 -
 src/util/clazz.ts                                   |  1 -
 src/util/log.ts                                     |  1 -
 src/util/model.ts                                   |  3 +--
 src/util/styleCompat.ts                             |  1 -
 src/visual/helper.ts                                |  1 -
 59 files changed, 32 insertions(+), 86 deletions(-)

diff --git a/build/build.js b/build/build.js
index b46c032..646bda2 100755
--- a/build/build.js
+++ b/build/build.js
@@ -27,7 +27,7 @@ const chalk = require('chalk');
 const rollup = require('rollup');
 const ecLangPlugin = require('./ec-lang-rollup-plugin');
 const prePublish = require('./pre-publish');
-const recheckDEV = require('./remove-dev').recheckDEV;
+const recheckDEV = require('./transform-dev').recheckDEV;
 const UglifyJS = require("uglify-js");
 const preamble = require('./preamble');
 
@@ -132,7 +132,7 @@ async function run() {
         output: commander.output,
         format: commander.format,
         sourcemap: commander.sourcemap,
-        removeDev: commander.removedev,
+        removeDev: commander.removedev || commander.min,
         addBundleVersion: isWatch,
         // Force to disable cache in release build.
         // TODO npm run build also disable cache?
diff --git a/build/config.js b/build/config.js
index 3d5c67f..d58ebbb 100644
--- a/build/config.js
+++ b/build/config.js
@@ -19,7 +19,7 @@
 
 const assert = require('assert');
 const nodeResolvePlugin = require('rollup-plugin-node-resolve');
-const ecRemoveDevPlugin = require('./remove-dev-rollup-plugin');
+const ecTransformDevPlugin = require('./transform-dev-rollup-plugin');
 const ecLangPlugin = require('./ec-lang-rollup-plugin');
 const nodePath = require('path');
 const ecDir = nodePath.resolve(__dirname, '..');
@@ -73,7 +73,7 @@ function preparePlugins(
     ];
 
     removeDev && plugins.push(
-        ecRemoveDevPlugin({sourcemap})
+        ecTransformDevPlugin({sourcemap})
     );
 
     lang && plugins.push(
diff --git a/build/pre-publish.js b/build/pre-publish.js
index 2f40c2d..dcc6ccc 100644
--- a/build/pre-publish.js
+++ b/build/pre-publish.js
@@ -35,11 +35,8 @@ const fsExtra = require('fs-extra');
 const chalk = require('chalk');
 const ts = require('typescript');
 const globby = require('globby');
-const removeDEVUtil = require('./remove-dev');
+const transformDEVUtil = require('./transform-dev');
 const preamble = require('./preamble');
-const {promisify} = require('util');
-const readFileAsync = promisify(fs.readFile);
-const writeFileAsync = promisify(fs.writeFile);
 
 const ecDir = nodePath.resolve(__dirname, '..');
 const tmpDir = nodePath.resolve(ecDir, 'pre-publish-tmp');
@@ -88,7 +85,7 @@ const compileWorkList = [
         transformOptions: {
             filesGlobby: {patterns: ['**/*.js'], cwd: tmpDir},
             preamble: preamble.js,
-            removeDEV: true
+            transformDEV: true
         },
         before: async function () {
             fsExtra.removeSync(tmpDir);
@@ -126,7 +123,7 @@ const compileWorkList = [
             preamble: preamble.js,
             // esm do not remove DEV. Keep it them same with
             // the previous state before migrate to ts.
-            removeDEV: false
+            transformDEV: false
         },
         before: async function () {
             fsExtra.removeSync(tmpDir);
@@ -162,7 +159,7 @@ const compileWorkList = [
         transformOptions: {
             filesGlobby: {patterns: ['**/*.js'], cwd: extensionCJSDir},
             preamble: preamble.js,
-            removeDEV: true
+            transformDEV: true
         },
         before: async function () {
             fsExtra.removeSync(extensionCJSDir);
@@ -179,7 +176,7 @@ const compileWorkList = [
         transformOptions: {
             filesGlobby: {patterns: ['**/*.js'], cwd: extensionESMDir},
             preamble: preamble.js,
-            removeDEV: false
+            transformDEV: false
         },
         before: async function () {
             fsExtra.removeSync(extensionESMDir);
@@ -284,17 +281,17 @@ async function transformRootFolderInEntry(entryFile, 
replacement) {
  * @param {Object} transformOptions
  * @param {Object} transformOptions.filesGlobby {patterns: string[], cwd: 
string}
  * @param {string} [transformOptions.preamble] See './preamble.js'
- * @param {boolean} [transformOptions.removeDEV]
+ * @param {boolean} [transformOptions.transformDEV]
  */
-async function transformCode({filesGlobby, preamble, removeDEV}) {
+async function transformCode({filesGlobby, preamble, transformDEV}) {
 
     let filePaths = await readFilePaths(filesGlobby);
 
     filePaths.map(filePath => {
         let code = fs.readFileSync(filePath, 'utf8');
 
-        if (removeDEV) {
-            let result = removeDEVUtil.transform(code, false);
+        if (transformDEV) {
+            let result = transformDEVUtil.transform(code, false);
             code = result.code;
         }
 
diff --git a/build/remove-dev-babel-plugin.js 
b/build/transform-dev-babel-plugin.js
similarity index 71%
rename from build/remove-dev-babel-plugin.js
rename to build/transform-dev-babel-plugin.js
index 884e630..18318f2 100644
--- a/build/remove-dev-babel-plugin.js
+++ b/build/transform-dev-babel-plugin.js
@@ -17,20 +17,20 @@
 * under the License.
 */
 
+const parser = require('@babel/parser');
+
+const replacedExpr = parser.parseExpression('process.env.NODE_ENV !== 
\'production\'');
+
 module.exports = function ({types, template}, options) {
     return {
         visitor: {
-            IfStatement: {
-                exit(path) {
-                    removeDEV(path);
+            Identifier: {
+                enter(path) {
+                    if (path.isIdentifier({ name: '__DEV__' }) && 
path.scope.hasGlobal('__DEV__')) {
+                        path.replaceWith(replacedExpr);
+                    }
                 }
             }
         }
     };
-};
-
-function removeDEV(path) {
-    if (path.node.test.name === '__DEV__') {
-        path.remove();
-    }
-}
+};
\ No newline at end of file
diff --git a/build/remove-dev-rollup-plugin.js 
b/build/transform-dev-rollup-plugin.js
similarity index 81%
rename from build/remove-dev-rollup-plugin.js
rename to build/transform-dev-rollup-plugin.js
index f07ff23..da9e5ac 100644
--- a/build/remove-dev-rollup-plugin.js
+++ b/build/transform-dev-rollup-plugin.js
@@ -18,20 +18,20 @@
 */
 
 /**
- * Remove the code of `if (__DEV__) { ... }`.
+ * Transform the code of `if (__DEV__) { ... }`. to `if (process.env.NODE_ENV 
!== 'production') { ... }`
  *
  * Usage:
  *
- * import ecRemoveDevPlugin from 'echats/build/rollup-plugin-ec-remove-dev';
+ * import ecTransformDevPlugin from 
'echats/build/rollup-plugin-ec-transform-dev';
  * let rollupConfig = {
  *     plugins: [
- *         ecRemoveDevPlugin(),
+ *         ecTransformDevPlugin(),
  *         ...
  *     ]
  * };
  */
 
-const removeDEV = require('./remove-dev');
+const removeDEV = require('./transform-dev');
 
 /**
  * @param {Object} [opt]
diff --git a/build/remove-dev.js b/build/transform-dev.js
similarity index 95%
rename from build/remove-dev.js
rename to build/transform-dev.js
index 18a1937..37aacab 100644
--- a/build/remove-dev.js
+++ b/build/transform-dev.js
@@ -18,7 +18,7 @@
 */
 
 const babel = require('@babel/core');
-const removeDEVBabelPlugin = require('./remove-dev-babel-plugin');
+const removeDEVBabelPlugin = require('./transform-dev-babel-plugin');
 
 /**
  * @param {string} sourceCode
diff --git a/src/.eslintrc.yaml b/src/.eslintrc.yaml
index fe91738..8da2a86 100644
--- a/src/.eslintrc.yaml
+++ b/src/.eslintrc.yaml
@@ -25,6 +25,7 @@ env:
 globals:
     jQuery: true
     Promise: true
+    __DEV__: true
 rules:
     # Check the rules in: 
node_modules/@typescript-eslint/eslint-plugin/README.md
     no-console:
diff --git a/src/chart/bar/BarView.ts b/src/chart/bar/BarView.ts
index 1342350..a1d4d0d 100644
--- a/src/chart/bar/BarView.ts
+++ b/src/chart/bar/BarView.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../../config';
 import {
     Rect,
     Sector,
diff --git a/src/chart/custom.ts b/src/chart/custom.ts
index 3925f90..2c0d600 100644
--- a/src/chart/custom.ts
+++ b/src/chart/custom.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../config';
 import {
     hasOwn, assert, isString, retrieve2, retrieve3, defaults, each, keys, 
isArrayLike, bind
 } from 'zrender/src/core/util';
diff --git a/src/chart/heatmap/HeatmapView.ts b/src/chart/heatmap/HeatmapView.ts
index 6c4d271..c7c08c3 100644
--- a/src/chart/heatmap/HeatmapView.ts
+++ b/src/chart/heatmap/HeatmapView.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import { __DEV__ } from '../../config';
 import * as graphic from '../../util/graphic';
 import { enableHoverEmphasis } from '../../util/states';
 import HeatmapLayer from './HeatmapLayer';
diff --git a/src/chart/line/LineSeries.ts b/src/chart/line/LineSeries.ts
index 7fa4d63..9715908 100644
--- a/src/chart/line/LineSeries.ts
+++ b/src/chart/line/LineSeries.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../../config';
 import createListFromArray from '../helper/createListFromArray';
 import SeriesModel from '../../model/Series';
 import {
diff --git a/src/chart/line/LineView.ts b/src/chart/line/LineView.ts
index 25ea7d9..2c77752 100644
--- a/src/chart/line/LineView.ts
+++ b/src/chart/line/LineView.ts
@@ -19,7 +19,6 @@
 
 // FIXME step not support polar
 
-import {__DEV__} from '../../config';
 import * as zrUtil from 'zrender/src/core/util';
 import {fromPoints} from 'zrender/src/core/bbox';
 import SymbolDraw from '../helper/SymbolDraw';
diff --git a/src/chart/lines/LinesSeries.ts b/src/chart/lines/LinesSeries.ts
index f0fecb4..71baa6b 100644
--- a/src/chart/lines/LinesSeries.ts
+++ b/src/chart/lines/LinesSeries.ts
@@ -19,7 +19,6 @@
 
 /* global Uint32Array, Float64Array, Float32Array */
 
-import {__DEV__} from '../../config';
 import SeriesModel from '../../model/Series';
 import List from '../../data/List';
 import { concatArray, mergeAll, map } from 'zrender/src/core/util';
diff --git a/src/chart/lines/LinesView.ts b/src/chart/lines/LinesView.ts
index f89254b..effb2fa 100644
--- a/src/chart/lines/LinesView.ts
+++ b/src/chart/lines/LinesView.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../../config';
 import LineDraw from '../helper/LineDraw';
 import EffectLine from '../helper/EffectLine';
 import Line from '../helper/Line';
diff --git a/src/chart/sankey/SankeySeries.ts b/src/chart/sankey/SankeySeries.ts
index 5cd34ea..9e3779c 100644
--- a/src/chart/sankey/SankeySeries.ts
+++ b/src/chart/sankey/SankeySeries.ts
@@ -21,7 +21,6 @@ import SeriesModel from '../../model/Series';
 import createGraphFromNodeEdge from '../helper/createGraphFromNodeEdge';
 import {encodeHTML} from '../../util/format';
 import Model from '../../model/Model';
-import { __DEV__ } from '../../config';
 import {
     SeriesOption,
     BoxLayoutOptionMixin,
diff --git a/src/chart/sunburst/sunburstAction.ts 
b/src/chart/sunburst/sunburstAction.ts
index 8fc3eff..61428fd 100644
--- a/src/chart/sunburst/sunburstAction.ts
+++ b/src/chart/sunburst/sunburstAction.ts
@@ -29,7 +29,6 @@ import GlobalModel from '../../model/Global';
 import ExtensionAPI from '../../ExtensionAPI';
 import { extend } from 'zrender/src/core/util';
 import { deprecateReplaceLog } from '../../util/log';
-import { __DEV__ } from '../../config';
 
 export const ROOT_TO_NODE_ACTION = 'sunburstRootToNode';
 
diff --git a/src/chart/tree/TreeView.ts b/src/chart/tree/TreeView.ts
index c1aab47..fe65c25 100644
--- a/src/chart/tree/TreeView.ts
+++ b/src/chart/tree/TreeView.ts
@@ -27,7 +27,6 @@ import View from '../../coord/View';
 import * as roamHelper from '../../component/helper/roamHelper';
 import RoamController, { RoamControllerHost } from 
'../../component/helper/RoamController';
 import {onIrrelevantElement} from '../../component/helper/cursorHelper';
-import { __DEV__ } from '../../config';
 import {parsePercent} from '../../util/number';
 import ChartView from '../../view/Chart';
 import TreeSeriesModel, { TreeSeriesOption, TreeSeriesNodeItemOption } from 
'./TreeSeries';
diff --git a/src/component/axis/AxisView.ts b/src/component/axis/AxisView.ts
index 7f7971c..54d929a 100644
--- a/src/component/axis/AxisView.ts
+++ b/src/component/axis/AxisView.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../../config';
 import * as axisPointerModelHelper from '../axisPointer/modelHelper';
 import ComponentView from '../../view/Component';
 import { AxisBaseModel } from '../../coord/AxisBaseModel';
diff --git a/src/component/brush/BrushModel.ts 
b/src/component/brush/BrushModel.ts
index 0b47f5e..f30f528 100644
--- a/src/component/brush/BrushModel.ts
+++ b/src/component/brush/BrushModel.ts
@@ -18,7 +18,6 @@
 */
 
 
-import {__DEV__} from '../../config';
 import * as zrUtil from 'zrender/src/core/util';
 import * as visualSolution from '../../visual/visualSolution';
 import Model from '../../model/Model';
diff --git a/src/component/dataZoom/DataZoomModel.ts 
b/src/component/dataZoom/DataZoomModel.ts
index 6212aa2..877851f 100644
--- a/src/component/dataZoom/DataZoomModel.ts
+++ b/src/component/dataZoom/DataZoomModel.ts
@@ -33,7 +33,6 @@ import {
     getAxisMainType, DATA_ZOOM_AXIS_DIMENSIONS, DataZoomAxisDimension
 } from './helper';
 import SingleAxisModel from '../../coord/single/AxisModel';
-import { __DEV__ } from '../../config';
 import { MULTIPLE_REFERRING, SINGLE_REFERRING } from '../../util/model';
 
 
diff --git a/src/component/dataZoom/SliderZoomView.ts 
b/src/component/dataZoom/SliderZoomView.ts
index 5fc07a7..8b49c8b 100644
--- a/src/component/dataZoom/SliderZoomView.ts
+++ b/src/component/dataZoom/SliderZoomView.ts
@@ -40,7 +40,6 @@ import { getAxisMainType, collectReferCoordSysModelInfo } 
from './helper';
 import { enableHoverEmphasis } from '../../util/states';
 import { createSymbol, symbolBuildProxies } from '../../util/symbol';
 import { deprecateLog } from '../../util/log';
-import { __DEV__ } from '../../config';
 import { PointLike } from 'zrender/src/core/Point';
 import Displayable from 'zrender/src/graphic/Displayable';
 
diff --git a/src/component/dataZoom/helper.ts b/src/component/dataZoom/helper.ts
index ef739b1..4b0a8a3 100644
--- a/src/component/dataZoom/helper.ts
+++ b/src/component/dataZoom/helper.ts
@@ -21,7 +21,6 @@ import { Payload } from '../../util/types';
 import GlobalModel from '../../model/Global';
 import DataZoomModel from './DataZoomModel';
 import { indexOf, createHashMap, assert, HashMap } from 
'zrender/src/core/util';
-import { __DEV__ } from '../../config';
 import SeriesModel from '../../model/Series';
 import { CoordinateSystemHostModel } from '../../coord/CoordinateSystem';
 import { AxisBaseModel } from '../../coord/AxisBaseModel';
diff --git a/src/component/graphic.ts b/src/component/graphic.ts
index 4079ed3..430e81c 100644
--- a/src/component/graphic.ts
+++ b/src/component/graphic.ts
@@ -19,7 +19,6 @@
 
 // @ts-nocheck
 
-import {__DEV__} from '../config';
 import * as echarts from '../echarts';
 import * as zrUtil from 'zrender/src/core/util';
 
diff --git a/src/component/helper/BrushController.ts 
b/src/component/helper/BrushController.ts
index b402987..596c37a 100644
--- a/src/component/helper/BrushController.ts
+++ b/src/component/helper/BrushController.ts
@@ -18,7 +18,6 @@
 */
 
 
-import {__DEV__} from '../../config';
 import {curry, each, map, bind, merge, clone, defaults, assert} from 
'zrender/src/core/util';
 import Eventful from 'zrender/src/core/Eventful';
 import * as graphic from '../../util/graphic';
diff --git a/src/component/helper/BrushTargetManager.ts 
b/src/component/helper/BrushTargetManager.ts
index 0015e96..f141a79 100644
--- a/src/component/helper/BrushTargetManager.ts
+++ b/src/component/helper/BrushTargetManager.ts
@@ -18,7 +18,6 @@
 */
 
 
-import {__DEV__} from '../../config';
 import { each, indexOf, curry, assert, map, createHashMap } from 
'zrender/src/core/util';
 import * as graphic from '../../util/graphic';
 import * as brushHelper from './brushHelper';
diff --git a/src/component/legend/LegendView.ts 
b/src/component/legend/LegendView.ts
index e2ed821..6bb9326 100644
--- a/src/component/legend/LegendView.ts
+++ b/src/component/legend/LegendView.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../../config';
 import * as zrUtil from 'zrender/src/core/util';
 import {createSymbol} from '../../util/symbol';
 import * as graphic from '../../util/graphic';
diff --git a/src/component/marker/MarkLineView.ts 
b/src/component/marker/MarkLineView.ts
index 1d8f8b5..47e04a5 100644
--- a/src/component/marker/MarkLineView.ts
+++ b/src/component/marker/MarkLineView.ts
@@ -27,8 +27,7 @@ import { CoordinateSystem, isCoordinateSystemType } from 
'../../coord/Coordinate
 import MarkLineModel, { MarkLine2DDataItemOption, MarkLineOption } from 
'./MarkLineModel';
 import { ScaleDataValue, ColorString } from '../../util/types';
 import SeriesModel from '../../model/Series';
-import { __DEV__ } from '../../config';
-import { getECData } from "../../util/ecData";
+import { getECData } from '../../util/ecData';
 import ExtensionAPI from '../../ExtensionAPI';
 import Cartesian2D from '../../coord/cartesian/Cartesian2D';
 import GlobalModel from '../../model/Global';
diff --git a/src/component/marker/MarkerModel.ts 
b/src/component/marker/MarkerModel.ts
index 4dc1625..096a273 100644
--- a/src/component/marker/MarkerModel.ts
+++ b/src/component/marker/MarkerModel.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../../config';
 import * as zrUtil from 'zrender/src/core/util';
 import env from 'zrender/src/core/env';
 import * as formatUtil from '../../util/format';
diff --git a/src/component/radar/RadarView.ts b/src/component/radar/RadarView.ts
index 057f4df..9544750 100644
--- a/src/component/radar/RadarView.ts
+++ b/src/component/radar/RadarView.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../../config';
 import * as zrUtil from 'zrender/src/core/util';
 import AxisBuilder from '../axis/AxisBuilder';
 import * as graphic from '../../util/graphic';
diff --git a/src/component/visualMap/PiecewiseModel.ts 
b/src/component/visualMap/PiecewiseModel.ts
index ab806aa..64e5f5e 100644
--- a/src/component/visualMap/PiecewiseModel.ts
+++ b/src/component/visualMap/PiecewiseModel.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../../config';
 import * as zrUtil from 'zrender/src/core/util';
 import VisualMapModel, { VisualMapOption, VisualMeta } from './VisualMapModel';
 import VisualMapping, { VisualMappingOption } from 
'../../visual/VisualMapping';
diff --git a/src/config.ts b/src/config.ts
index 2c185e6..7c7549a 100644
--- a/src/config.ts
+++ b/src/config.ts
@@ -38,4 +38,4 @@ if (typeof dev === 'undefined') {
     dev = true;
 }
 
-export const __DEV__ = dev;
+declare const __DEV__: boolean;
\ No newline at end of file
diff --git a/src/coord/calendar/Calendar.ts b/src/coord/calendar/Calendar.ts
index ae23233..b5732ef 100644
--- a/src/coord/calendar/Calendar.ts
+++ b/src/coord/calendar/Calendar.ts
@@ -33,7 +33,6 @@ import {
 } from '../../util/types';
 import { ParsedModelFinder } from '../../util/model';
 import { CoordinateSystem, CoordinateSystemMaster } from '../CoordinateSystem';
-import { __DEV__ } from '../../config';
 import SeriesModel from '../../model/Series';
 import CoordinateSystemManager from '../../CoordinateSystem';
 import { RectLike } from 'zrender/src/core/BoundingRect';
diff --git a/src/coord/cartesian/Grid.ts b/src/coord/cartesian/Grid.ts
index 20223e2..7df314e 100644
--- a/src/coord/cartesian/Grid.ts
+++ b/src/coord/cartesian/Grid.ts
@@ -23,7 +23,6 @@
  * TODO Default cartesian
  */
 
-import {__DEV__} from '../../config';
 import {isObject, each, indexOf, retrieve3} from 'zrender/src/core/util';
 import {getLayoutRect, LayoutRect} from '../../util/layout';
 import {
diff --git a/src/coord/cartesian/cartesianAxisHelper.ts 
b/src/coord/cartesian/cartesianAxisHelper.ts
index 1d66179..6f977bf 100644
--- a/src/coord/cartesian/cartesianAxisHelper.ts
+++ b/src/coord/cartesian/cartesianAxisHelper.ts
@@ -22,7 +22,6 @@ import * as zrUtil from 'zrender/src/core/util';
 import GridModel from './GridModel';
 import CartesianAxisModel from './AxisModel';
 import SeriesModel from '../../model/Series';
-import { __DEV__ } from '../../config';
 import { SINGLE_REFERRING } from '../../util/model';
 
 interface CartesianAxisLayout {
diff --git a/src/coord/geo/geoCreator.ts b/src/coord/geo/geoCreator.ts
index 55ffc24..46ac7ad 100644
--- a/src/coord/geo/geoCreator.ts
+++ b/src/coord/geo/geoCreator.ts
@@ -18,7 +18,6 @@
 */
 
 
-import {__DEV__} from '../../config';
 import * as echarts from '../../echarts';
 import * as zrUtil from 'zrender/src/core/util';
 import Geo from './Geo';
diff --git a/src/coord/geo/geoSourceManager.ts 
b/src/coord/geo/geoSourceManager.ts
index 6ec97cd..e324bbf 100644
--- a/src/coord/geo/geoSourceManager.ts
+++ b/src/coord/geo/geoSourceManager.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../../config';
 import {each, createHashMap, HashMap} from 'zrender/src/core/util';
 import mapDataStorage, { MapRecord } from './mapDataStorage';
 import geoJSONLoader from './geoJSONLoader';
diff --git a/src/coord/geo/mapDataStorage.ts b/src/coord/geo/mapDataStorage.ts
index ae1bf22..69cd4b4 100644
--- a/src/coord/geo/mapDataStorage.ts
+++ b/src/coord/geo/mapDataStorage.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../../config';
 import {createHashMap, isString, isArray, each, assert} from 
'zrender/src/core/util';
 import {parseXML} from 'zrender/src/tool/parseSVG';
 import { GeoSpecialAreas, GeoJSON, GeoJSONCompressed } from './geoTypes';
diff --git a/src/coord/polar/polarCreator.ts b/src/coord/polar/polarCreator.ts
index 4c807c3..2b9248e 100644
--- a/src/coord/polar/polarCreator.ts
+++ b/src/coord/polar/polarCreator.ts
@@ -19,7 +19,6 @@
 
 // TODO Axis scale
 
-import {__DEV__} from '../../config';
 import * as zrUtil from 'zrender/src/core/util';
 import Polar from './Polar';
 import {parsePercent} from '../../util/number';
diff --git a/src/coord/scaleRawExtentInfo.ts b/src/coord/scaleRawExtentInfo.ts
index ebd7d00..9f90b1a 100644
--- a/src/coord/scaleRawExtentInfo.ts
+++ b/src/coord/scaleRawExtentInfo.ts
@@ -18,7 +18,6 @@
 */
 
 import { assert, isArray, eqNaN, isFunction } from 'zrender/src/core/util';
-import { __DEV__ } from '../config';
 import Scale from '../scale/Scale';
 import { AxisBaseModel } from './AxisBaseModel';
 import { parsePercent } from 'zrender/src/contain/text';
diff --git a/src/data/Graph.ts b/src/data/Graph.ts
index 164fe27..e21251c 100644
--- a/src/data/Graph.ts
+++ b/src/data/Graph.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../config';
 import * as zrUtil from 'zrender/src/core/util';
 import { Dictionary } from 'zrender/src/core/types';
 import List from './List';
diff --git a/src/data/List.ts b/src/data/List.ts
index 6fbef99..cc6ca04 100644
--- a/src/data/List.ts
+++ b/src/data/List.ts
@@ -23,7 +23,6 @@
  * List for data storage
  */
 
-import {__DEV__} from '../config';
 import * as zrUtil from 'zrender/src/core/util';
 import Model from '../model/Model';
 import DataDiffer from './DataDiffer';
diff --git a/src/data/helper/dataProvider.ts b/src/data/helper/dataProvider.ts
index c499f06..3363597 100644
--- a/src/data/helper/dataProvider.ts
+++ b/src/data/helper/dataProvider.ts
@@ -21,7 +21,6 @@
 // ??? refactor? check the outer usage of data provider.
 // merge with defaultDimValueGetter?
 
-import {__DEV__} from '../../config';
 import {isTypedArray, extend, assert, each, isObject} from 
'zrender/src/core/util';
 import {getDataItemValue} from '../../util/model';
 import Source from '../Source';
diff --git a/src/data/helper/dimensionHelper.ts 
b/src/data/helper/dimensionHelper.ts
index 245f545..433fd79 100644
--- a/src/data/helper/dimensionHelper.ts
+++ b/src/data/helper/dimensionHelper.ts
@@ -20,7 +20,6 @@
 // @ts-nocheck
 
 import {each, createHashMap, assert} from 'zrender/src/core/util';
-import { __DEV__ } from '../../config';
 import List from '../List';
 import {
     DimensionName, VISUAL_DIMENSIONS, DimensionType, DimensionUserOuput
diff --git a/src/data/helper/sourceHelper.ts b/src/data/helper/sourceHelper.ts
index fc760d8..19bc6ee 100644
--- a/src/data/helper/sourceHelper.ts
+++ b/src/data/helper/sourceHelper.ts
@@ -19,7 +19,6 @@
 
 // @ts-nocheck
 
-import {__DEV__} from '../../config';
 import {makeInner, getDataItemValue} from '../../util/model';
 import {
     createHashMap,
diff --git a/src/echarts.ts b/src/echarts.ts
index 4364788..76334a7 100644
--- a/src/echarts.ts
+++ b/src/echarts.ts
@@ -16,8 +16,6 @@
 * specific language governing permissions and limitations
 * under the License.
 */
-
-import {__DEV__} from './config';
 import * as zrender from 'zrender/src/zrender';
 import * as zrUtil from 'zrender/src/core/util';
 import * as colorTool from 'zrender/src/tool/color';
diff --git a/src/label/labelStyle.ts b/src/label/labelStyle.ts
index 449e9f2..a6866dc 100644
--- a/src/label/labelStyle.ts
+++ b/src/label/labelStyle.ts
@@ -16,7 +16,6 @@ import {
 import GlobalModel from '../model/Global';
 import { isFunction, retrieve2, extend, keys, trim } from 
'zrender/src/core/util';
 import { SPECIAL_STATES, DISPLAY_STATES } from '../util/states';
-import { __DEV__ } from '../config';
 import { deprecateReplaceLog } from '../util/log';
 
 type TextCommonParams = {
diff --git a/src/legacy/dataSelectAction.ts b/src/legacy/dataSelectAction.ts
index 29cd163..cae9f63 100644
--- a/src/legacy/dataSelectAction.ts
+++ b/src/legacy/dataSelectAction.ts
@@ -21,7 +21,6 @@ import { Payload, SelectChangedPayload } from '../util/types';
 import SeriesModel from '../model/Series';
 import { extend, each, isArray } from 'zrender/src/core/util';
 import GlobalModel from '../model/Global';
-import { __DEV__ } from '../config';
 import { deprecateReplaceLog, deprecateLog } from '../util/log';
 import Eventful from 'zrender/src/core/Eventful';
 import type { EChartsType, registerAction } from '../echarts';
diff --git a/src/model/Global.ts b/src/model/Global.ts
index ff220f8..252148b 100644
--- a/src/model/Global.ts
+++ b/src/model/Global.ts
@@ -33,7 +33,6 @@
  * `mergeOption` in module:echarts/model/OptionManager.
  */
 
-import {__DEV__} from '../config';
 import {
     each, filter, isArray, isObject, isString,
     createHashMap, assert, clone, merge, extend, mixin, HashMap, isFunction
diff --git a/src/model/Series.ts b/src/model/Series.ts
index a580c9c..d364d5f 100644
--- a/src/model/Series.ts
+++ b/src/model/Series.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../config';
 import * as zrUtil from 'zrender/src/core/util';
 import env from 'zrender/src/core/env';
 import {
diff --git a/src/model/internalComponentCreator.ts 
b/src/model/internalComponentCreator.ts
index ca48540..ad8dfe5 100644
--- a/src/model/internalComponentCreator.ts
+++ b/src/model/internalComponentCreator.ts
@@ -20,7 +20,6 @@
 import GlobalModel from './Global';
 import { ComponentOption, ComponentMainType } from '../util/types';
 import { createHashMap, assert } from 'zrender/src/core/util';
-import { __DEV__ } from '../config';
 import { isComponentIdInternal } from '../util/model';
 
 // PNEDING:
diff --git a/src/model/referHelper.ts b/src/model/referHelper.ts
index 03500f9..1b97c8f 100644
--- a/src/model/referHelper.ts
+++ b/src/model/referHelper.ts
@@ -26,7 +26,6 @@
 // merge relevant logic to this file?
 // check: "modelHelper" of tooltip and "BrushTargetManager".
 
-import {__DEV__} from '../config';
 import {createHashMap, retrieve, each, HashMap} from 'zrender/src/core/util';
 import SeriesModel from './Series';
 import type PolarModel from '../coord/polar/PolarModel';
diff --git a/src/preprocessor/backwardCompat.ts 
b/src/preprocessor/backwardCompat.ts
index 6a97853..167dafa 100644
--- a/src/preprocessor/backwardCompat.ts
+++ b/src/preprocessor/backwardCompat.ts
@@ -22,7 +22,6 @@ import compatStyle from './helper/compatStyle';
 import {normalizeToArray} from '../util/model';
 import { Dictionary } from 'zrender/src/core/types';
 import { ECUnitOption } from '../util/types';
-import { __DEV__ } from '../config';
 import type { BarSeriesOption } from '../chart/bar/BarSeries';
 import type { PieSeriesOption } from '../chart/pie/PieSeries';
 import { deprecateLog, deprecateReplaceLog } from '../util/log';
diff --git a/src/preprocessor/helper/compatStyle.ts 
b/src/preprocessor/helper/compatStyle.ts
index 5e864f0..87b30c2 100644
--- a/src/preprocessor/helper/compatStyle.ts
+++ b/src/preprocessor/helper/compatStyle.ts
@@ -20,7 +20,6 @@
 import * as zrUtil from 'zrender/src/core/util';
 import * as modelUtil from '../../util/model';
 import { Dictionary } from 'zrender/src/core/types';
-import { __DEV__ } from '../../config';
 import { deprecateLog, deprecateReplaceLog } from '../../util/log';
 
 const each = zrUtil.each;
diff --git a/src/stream/task.ts b/src/stream/task.ts
index a25b14e..4d2eafa 100644
--- a/src/stream/task.ts
+++ b/src/stream/task.ts
@@ -18,7 +18,6 @@
 */
 
 import {assert, isArray} from 'zrender/src/core/util';
-import { __DEV__ } from '../config';
 import SeriesModel from '../model/Series';
 import { Pipeline } from './Scheduler';
 import { Payload } from '../util/types';
diff --git a/src/util/clazz.ts b/src/util/clazz.ts
index d1a03ed..7f46f07 100644
--- a/src/util/clazz.ts
+++ b/src/util/clazz.ts
@@ -17,7 +17,6 @@
 * under the License.
 */
 
-import {__DEV__} from '../config';
 import * as zrUtil from 'zrender/src/core/util';
 import { Dictionary } from 'zrender/src/core/types';
 import { ComponentFullType, ComponentTypeInfo, ComponentMainType, 
ComponentSubType } from './types';
diff --git a/src/util/log.ts b/src/util/log.ts
index f4d89a3..c841bac 100644
--- a/src/util/log.ts
+++ b/src/util/log.ts
@@ -18,7 +18,6 @@
 */
 
 import { Dictionary } from './types';
-import { __DEV__ } from '../config';
 
 const storedLogs: Dictionary<boolean> = {};
 
diff --git a/src/util/model.ts b/src/util/model.ts
index 5cf3568..ee975c5 100644
--- a/src/util/model.ts
+++ b/src/util/model.ts
@@ -29,7 +29,7 @@ import {
     indexOf
 } from 'zrender/src/core/util';
 import env from 'zrender/src/core/env';
-import GlobalModel, { QueryConditionKindB } from '../model/Global';
+import GlobalModel from '../model/Global';
 import ComponentModel, {ComponentModelConstructor} from '../model/Component';
 import List from '../data/List';
 import {
@@ -46,7 +46,6 @@ import { Dictionary } from 'zrender/src/core/types';
 import SeriesModel from '../model/Series';
 import CartesianAxisModel from '../coord/cartesian/AxisModel';
 import GridModel from '../coord/cartesian/GridModel';
-import { __DEV__ } from '../config';
 import { isNumeric } from './number';
 
 /**
diff --git a/src/util/styleCompat.ts b/src/util/styleCompat.ts
index fe09407..8844dea 100644
--- a/src/util/styleCompat.ts
+++ b/src/util/styleCompat.ts
@@ -21,7 +21,6 @@ import { Dictionary, ZRStyleProps } from './types';
 import { ElementTextConfig } from 'zrender/src/Element';
 import { TextStyleProps, TextStylePropsPart, TextProps } from 
'zrender/src/graphic/Text';
 import { each, hasOwn } from 'zrender/src/core/util';
-import { __DEV__ } from '../config';
 import { ItemStyleProps } from '../model/mixin/itemStyle';
 
 export interface LegacyStyleProps {
diff --git a/src/visual/helper.ts b/src/visual/helper.ts
index 29b8079..e419a9a 100644
--- a/src/visual/helper.ts
+++ b/src/visual/helper.ts
@@ -25,7 +25,6 @@
  *  'style', 'symbol', 'symbolSize'...
  */
 import List from '../data/List';
-import { __DEV__ } from '../config';
 
 
 export function getItemVisualFromData(data: List, dataIndex: number, key: 
string) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to