GitHub user 1ambda opened a pull request:
https://github.com/apache/zeppelin/pull/1805
[ZEPPELIN-1850] Introduce Webpack (front)
### What is this PR for?
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's more modern stack than grunt. This will encourage other developers
to contribute (the most import thing).
**This PR is designed to improve build process gradually** So,
- Angular module loading depends on the sequence as we did before. (see
`index.js`).
- CSS, HTML file is not managed by webpack including its live reloading
These will be handled by additional PRs.
**This PR is not big**
- 50+ file changes are just about removing `use strict`, importing
`zeppelin.js`. Skip them while reveiw.
- Please focus on the changes in `Gruntfile.js`, `package.json`,
`webpack.config.js`
### 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 bundles 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 start` 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
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/1ambda/zeppelin
ZEPPELIN-1850/introduce-webpack
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zeppelin/pull/1805.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1805
----
commit 75d456d822c70f26ba4fcf786cd7c15cfdf81289
Author: 1ambda <[email protected]>
Date: 2016-12-23T18:35:07Z
FIXUP: #1803
commit 348af2ef824a9878c005dfc204204461c2445eeb
Author: 1ambda <[email protected]>
Date: 2016-12-23T18:35:29Z
FIXUP: #1802
commit 5927504a9a4ca2adc3283b29c886a00a30cd617b
Author: 1ambda <[email protected]>
Date: 2016-12-23T18:37:50Z
WORKING: using ProvidePlugin
commit feea19f32fb3e5a16c55a1fdc411564a3e538098
Author: 1ambda <[email protected]>
Date: 2016-12-23T19:21:36Z
WORKING: remove all js from index.html
commit f75bd93331afd18052e45d8de7fb532c6dc5de11
Author: 1ambda <[email protected]>
Date: 2016-12-23T19:33:18Z
WORKING: Setup command properly.
commit 9562923fb8154a10f93f1d8ce6f8e3497b38f84e
Author: 1ambda <[email protected]>
Date: 2016-12-23T20:04:26Z
WORKING: modularize grunt webpack task
commit 0c1308929d8c849016975f0fac20b2350de0daec
Author: 1ambda <[email protected]>
Date: 2016-12-23T21:43:04Z
WORKING: npm run test
commit b50f783a58357abd415cb8d45aa49e167d87ea02
Author: 1ambda <[email protected]>
Date: 2016-12-23T21:50:57Z
WORKING: Remove grunt-karma
commit b913bfc3c3da7349c1e6255da1041f284c7bcce1
Author: 1ambda <[email protected]>
Date: 2016-12-24T02:03:54Z
WORKING: FIX ESLINT
commit c856c4b05b3591ba7d68881b336dc8e5391c5bc9
Author: 1ambda <[email protected]>
Date: 2016-12-24T16:50:01Z
WORKING: npm run build w/o ugly, ngAn
commit 1c71a3ac8affe1d5fd1e4b2cdde2f44cfa197913
Author: 1ambda <[email protected]>
Date: 2016-12-24T17:22:01Z
WORKING: Use webpack ng annotate plugin
commit 070d77e1ceeee3a004f3001eab4e97a2de18af60
Author: 1ambda <[email protected]>
Date: 2016-12-24T20:14:04Z
WORKING: DON'T COPY bower_components
commit d75306446358b8732abf22182f45c3a492801dde
Author: 1ambda <[email protected]>
Date: 2016-12-25T04:41:25Z
WORKING: LIVE RELOAD on css, html
commit 0d9b8a61efda5f247c1917b0c92493c407ae59e8
Author: 1ambda <[email protected]>
Date: 2016-12-25T14:59:06Z
WORKING: Cleanup Gruntfile.js
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---