You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@zeppelin.apache.org by mi...@apache.org on 2017/03/17 03:22:34 UTC

[04/23] zeppelin git commit: [ZEPPELIN-2166] HeliumBundleFactoty can't transfile imported es6+

[ZEPPELIN-2166] HeliumBundleFactoty can't transfile imported es6+

Currently, we don't use any preset. This cause error messages like
when a helium package imports another packages which include es6+ syntax.

```
SyntaxError: Unexpected token import
    at helium.service.js:36
    at angular.js:10973
    at processQueue (angular.js:15552)
    at angular.js:15568
    at Scope.$eval (angular.js:16820)
    at Scope.$digest (angular.js:16636)
    at Scope.$apply (angular.js:16928)
    at done (angular.js:11266)
    at completeRequest (angular.js:11464)
    at XMLHttpRequest.requestLoaded (angular.js:11405)
```

- https://github.com/1ambda/zeppelin-advanced-transformation/blob/master/examples/example-highcharts-columnrange/index.js#L3
- https://github.com/1ambda/zeppelin-advanced-transformation/blob/master/index.js#L11

[Improvement]

* [x] - Install required NPM packages
* [x] - fix babel configuration

[ZEPPELIN-2166](https://issues.apache.org/jira/browse/ZEPPELIN-2166)

- Should be able to bundle existing helium vis
- Should be able to bundle https://github.com/1ambda/zeppelin-advanced-transformation/tree/master/examples/example-highcharts-columnrange

NONE

* Does the licenses files need update? - NONE
* Is there breaking changes for older versions? - NONE
* Does this needs documentation? - NONE

Author: 1ambda <1a...@gmail.com>

Closes #2071 from 1ambda/ZEPPELIN-2166/fix-webpack-config-for-es6 and squashes the following commits:

40f6b51 [1ambda] fix: Update babel configuration

(cherry picked from commit 252055571bfb444696ddae86b3a4dac24fa16ddf)
Signed-off-by: Lee moon soo <mo...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/zeppelin/repo
Commit: http://git-wip-us.apache.org/repos/asf/zeppelin/commit/7eef7a82
Tree: http://git-wip-us.apache.org/repos/asf/zeppelin/tree/7eef7a82
Diff: http://git-wip-us.apache.org/repos/asf/zeppelin/diff/7eef7a82

Branch: refs/heads/branch-0.7
Commit: 7eef7a82f448e4a39c41b245ca8f6998f37d76de
Parents: 3779100
Author: 1ambda <1a...@gmail.com>
Authored: Mon Feb 27 11:35:38 2017 +0900
Committer: Lee moon soo <mo...@apache.org>
Committed: Mon Mar 6 12:06:16 2017 +0900

----------------------------------------------------------------------
 .../src/main/resources/helium/package.json          |  6 ++++--
 .../src/main/resources/helium/webpack.config.js     | 16 ++++++----------
 2 files changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7eef7a82/zeppelin-zengine/src/main/resources/helium/package.json
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/resources/helium/package.json b/zeppelin-zengine/src/main/resources/helium/package.json
index e6ec612..0fb5ac0 100644
--- a/zeppelin-zengine/src/main/resources/helium/package.json
+++ b/zeppelin-zengine/src/main/resources/helium/package.json
@@ -9,7 +9,9 @@
   },
   "devDependencies": {
     "webpack": "^1.12.2",
-    "babel": "^5.8.23",
-    "babel-loader": "^5.3.2"
+    "babel-core": "^6.23.1",
+    "babel-loader": "^6.3.2",
+    "babel-preset-es2015": "^6.22.0",
+    "babel-preset-stage-0": "^6.22.0"
   }
 }

http://git-wip-us.apache.org/repos/asf/zeppelin/blob/7eef7a82/zeppelin-zengine/src/main/resources/helium/webpack.config.js
----------------------------------------------------------------------
diff --git a/zeppelin-zengine/src/main/resources/helium/webpack.config.js b/zeppelin-zengine/src/main/resources/helium/webpack.config.js
index 2b5015e..69592ae 100644
--- a/zeppelin-zengine/src/main/resources/helium/webpack.config.js
+++ b/zeppelin-zengine/src/main/resources/helium/webpack.config.js
@@ -14,20 +14,16 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+
 module.exports = {
-    entry: ['./'],
-    output: {
-        path: './',
-        filename: 'vis.bundle.js',
-    },
-    resolve: {
-        root: __dirname + "/node_modules"
-    },
+    entry: './load.js',
+    output: { path: './', filename: 'helium.bundle.js', },
     module: {
         loaders: [{
             test: /\.js$/,
-            //exclude: /node_modules/,
-            loader: 'babel-loader'
+            // DON'T exclude. since zeppelin will bundle all necessary packages: `exclude: /node_modules/,`
+            loader: 'babel-loader',
+            query: { presets: ['es2015', 'stage-0'] },
         }]
     }
 }