-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ZEPPELIN-1850] Introduce Webpack (front)
### What is this PR for? <br/> **1. The purpose of this PR is introducing webpack to zeppelin-web** - It supports super-fast javascript compilation and (hot) reload - It helps to simplify, unify build process. - It enables for us to use `import`, `export` features. - It's more modern stack than grunt. This will encourage other developers to contribute (*the most import thing IMO*). **2. This PR is designed to improve build process _gradually!!!_** - So, Angular module loading depends on the import sequence as we did before in [index.html](https://github.com/apache/zeppelin/blob/master/zeppelin-web/src/index.html#L171). (see [index.js](https://github.com/apache/zeppelin/pull/1805/files#diff-a128f4667c7e1afb6058389c20627b4e)). - Also, CSS and HTML file is not managed by webpack including its live reloading *These will be handled by additional PRs.* **3. This PR is not big** - 60+ file changes are just about removing `use strict`, importing `zeppelin.js`. (Also includes fixups for #1802 and #1803) - So skip them while reveiw - Please focus on the changes in `Gruntfile.js`, `package.json`, `webpack.config.js` <br/> ### What type of PR is it? [Improvement] ### Todos * [x] - Setup webpack.config.js * [x] - Resolve global variable `zeppelin` problem * [x] - Support webpack in karma (`npm run test`) * [x] - Annotate the result bundle using webpack ng annotate plugin * [x] - Fix eslint violations * [x] - Livereload for HTML, CSS ### What is the Jira issue? [ZEPPELIN-1850](https://issues.apache.org/jira/browse/ZEPPELIN-1850) ### How should this be tested? - `cd zeppelin-web && rm -rf node_modules bower_components node` - `npm install` - `npm run test` - `npm run build` - `npm run dev` and open `localhost:9000`: **check live-reload works regarding to html, css, js files** - `cd .. && mvn clean package -pl 'zeppelin-web' -DskipTests && ./bin/zeppelin-daemon.sh restart` and open `localhost:8080` ### Screenshots (if appropriate) N/A ### Questions: * Does the licenses files need update? - NO * Is there breaking changes for older versions? - NO * Does this needs documentation? - NO Author: 1ambda <1amb4a@gmail.com> Closes #1805 from 1ambda/ZEPPELIN-1850/introduce-webpack and squashes the following commits: 920589b [1ambda] REVIEW: Add strip-loader to remove console.log 6aa25b8 [1ambda] REVIEW: Update zeppelin-web/README.md bfc635b [1ambda] REVIEW: Rename to in package.json a6ffe42 [1ambda] WORKING: Ignore .babelrc in RAT 533531d [1ambda] WORKING: Cleanup Gruntfile.js fcca30f [1ambda] WORKING: LIVE RELOAD on css, html 4bff61c [1ambda] WORKING: DON'T COPY bower_components 45cb978 [1ambda] WORKING: Use webpack ng annotate plugin b0c7d01 [1ambda] WORKING: npm run build w/o ugly, ngAn d1352d0 [1ambda] WORKING: FIX ESLINT 7aed1bc [1ambda] WORKING: Remove grunt-karma ea7f186 [1ambda] WORKING: npm run test 94bedef [1ambda] WORKING: modularize grunt webpack task b8acc28 [1ambda] WORKING: Setup command properly. d715d2a [1ambda] WORKING: remove all js from index.html 71de16f [1ambda] WORKING: using ProvidePlugin ed04f4e [1ambda] FIXUP: #1802
- Loading branch information
1 parent
4c1bc60
commit 3f28865
Showing
76 changed files
with
464 additions
and
356 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
|
||
"plugins": ["transform-object-rest-spread"], | ||
"presets": ["es2015"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.