You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by 1ambda <gi...@git.apache.org> on 2016/12/25 15:47:13 UTC

[GitHub] zeppelin pull request #1805: [ZEPPELIN-1850] Introduce Webpack (front)

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 <1a...@gmail.com>
Date:   2016-12-23T18:35:07Z

    FIXUP: #1803

commit 348af2ef824a9878c005dfc204204461c2445eeb
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-23T18:35:29Z

    FIXUP: #1802

commit 5927504a9a4ca2adc3283b29c886a00a30cd617b
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-23T18:37:50Z

    WORKING: using ProvidePlugin

commit feea19f32fb3e5a16c55a1fdc411564a3e538098
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-23T19:21:36Z

    WORKING: remove all js from index.html

commit f75bd93331afd18052e45d8de7fb532c6dc5de11
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-23T19:33:18Z

    WORKING: Setup  command properly.

commit 9562923fb8154a10f93f1d8ce6f8e3497b38f84e
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-23T20:04:26Z

    WORKING: modularize grunt webpack task

commit 0c1308929d8c849016975f0fac20b2350de0daec
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-23T21:43:04Z

    WORKING: npm run test

commit b50f783a58357abd415cb8d45aa49e167d87ea02
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-23T21:50:57Z

    WORKING: Remove grunt-karma

commit b913bfc3c3da7349c1e6255da1041f284c7bcce1
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-24T02:03:54Z

    WORKING: FIX ESLINT

commit c856c4b05b3591ba7d68881b336dc8e5391c5bc9
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-24T16:50:01Z

    WORKING: npm run build w/o ugly, ngAn

commit 1c71a3ac8affe1d5fd1e4b2cdde2f44cfa197913
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-24T17:22:01Z

    WORKING: Use webpack ng annotate plugin

commit 070d77e1ceeee3a004f3001eab4e97a2de18af60
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-24T20:14:04Z

    WORKING: DON'T COPY bower_components

commit d75306446358b8732abf22182f45c3a492801dde
Author: 1ambda <1a...@gmail.com>
Date:   2016-12-25T04:41:25Z

    WORKING: LIVE RELOAD on css, html

commit 0d9b8a61efda5f247c1917b0c92493c407ae59e8
Author: 1ambda <1a...@gmail.com>
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1805: [ZEPPELIN-1850] Introduce Webpack (front)

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/1805
  
    @AhyoungRyu I didn't know about ZEPPELIN-1805 but good to hear that it is solved by this PR. 
    
    Also, docs was updated to include `npm run dev` command in 8442eba :)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1805: [ZEPPELIN-1850] Introduce Webpack (front)

Posted by tae-jun <gi...@git.apache.org>.
Github user tae-jun commented on the issue:

    https://github.com/apache/zeppelin/pull/1805
  
    So coool!
    
    I tested following your instructions and it worked like a charm \U0001f44d 
    And live-reloading time remarkably decreased.
    
    LGTM!!!


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1805: [ZEPPELIN-1850] Introduce Webpack (front)

Posted by AhyoungRyu <gi...@git.apache.org>.
Github user AhyoungRyu commented on the issue:

    https://github.com/apache/zeppelin/pull/1805
  
    @1ambda To quickly test this branch, I tried to change some css components and html, js files. It's working really nicely(and super fast). Great work indeed! Seems it solved [ZEPPELIN-1805](https://issues.apache.org/jira/browse/ZEPPELIN-1805) as well :)
    If you don't mind can we update [zeppelin-web/README.md](https://github.com/apache/zeppelin/blob/master/zeppelin-web/README.md)?


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1805: [ZEPPELIN-1850] Introduce Webpack (front)

Posted by 1ambda <gi...@git.apache.org>.
Github user 1ambda commented on the issue:

    https://github.com/apache/zeppelin/pull/1805
  
    @Leemoonsoo 
    
    ### Remove `console.log` in dist
    
    I missed it. Previously, grunt stripped all `console.log` using this config 
    
    ```
    uglify: {
    ...
            'drop_console': true
    ...
    ```
    
    So i added [strip-loader](https://github.com/yahoo/strip-loader) to achieve same behavior while building in 5e1696f
    
    ### About Size
    
    ```
    ## before
    -rw-r--r--  1 lambda  staff   113K Dec 28 11:33 scripts.1546a550da5ec483.js
    
    ## after
    -rw-r--r--   1 lambda  staff   116K Dec 28 12:36 app.f4ebf1a368629b338f2d.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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1805: [ZEPPELIN-1850] Introduce Webpack (front)

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the issue:

    https://github.com/apache/zeppelin/pull/1805
  
    @1ambda Great improvement!
    Tested and it works well.
    
    One thing is, previously console.log() was printed only in dev mode. After this change, console.log() is printed both dev and dist. If it is not very difficult, can console.log() be muted in non-dev mode?
    
    Other than that, LGTM.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin pull request #1805: [ZEPPELIN-1850] Introduce Webpack (front)

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/zeppelin/pull/1805


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] zeppelin issue #1805: [ZEPPELIN-1850] Introduce Webpack (front)

Posted by Leemoonsoo <gi...@git.apache.org>.
Github user Leemoonsoo commented on the issue:

    https://github.com/apache/zeppelin/pull/1805
  
    Tested `console.log` in dev and dist. It now works as expected.
    
    LGTM and merge to master if there're no further discussions.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---