You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by garrensmith <gi...@git.apache.org> on 2017/03/16 09:37:27 UTC

[GitHub] couchdb-fauxton pull request #868: Update to webpack 2

GitHub user garrensmith opened a pull request:

    https://github.com/apache/couchdb-fauxton/pull/868

    Update to webpack 2

    This upgrades to webpack 2. Webpack 2 makes it a little easier to do certain things. One of them is to split the bundle.js into three separate files:
    
    * manifest.js -> webpack loader file
    * vendor.js -> all required libraries
    * bundle.js -> Fauxton code
    
    Each file also has a a hash applied to it based on the file contents. This should improve caching and load times for Fauxton as the manifest file and vendor file will not change as often as the bundle file.
    
    Webpack is now also generating the html file, this was previously done in grunt. 

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/garrensmith/couchdb-fauxton update-to-webpack-2

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/couchdb-fauxton/pull/868.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 #868
    
----
commit 6146fbe6a76ec6c462894b16124ec4b4abbbf5ce
Author: Garren Smith <ga...@gmail.com>
Date:   2017-03-14T09:08:03Z

    dev working

commit b30d5210ef3bd0546ff5a23dbb593abeef1a9878
Author: Garren Smith <ga...@gmail.com>
Date:   2017-03-14T12:18:38Z

    up configs updated

commit b994c3abbcdf4168756999783c8d5befd6e95780
Author: Garren Smith <ga...@gmail.com>
Date:   2017-03-14T13:58:30Z

    start vendor section

commit b4dd0bc961422b5d590482c18f167525997eae3b
Author: Garren Smith <ga...@gmail.com>
Date:   2017-03-15T15:12:48Z

    initial working for dev and release

commit 3ca454989768b4281ff3cabcb7086f93384c0160
Author: Garren Smith <ga...@gmail.com>
Date:   2017-03-16T09:28:46Z

    upgrade to webpack 2

----


---
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] couchdb-fauxton pull request #868: Update to webpack 2

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

    https://github.com/apache/couchdb-fauxton/pull/868


---
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] couchdb-fauxton pull request #868: Update to webpack 2

Posted by nolanlawson <gi...@git.apache.org>.
Github user nolanlawson commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/868#discussion_r106464891
  
    --- Diff: assets/index.underscore ---
    @@ -19,11 +19,8 @@
       <meta name="viewport" content="width=device-width,initial-scale=1">
       <meta http-equiv="Content-Language" content="en" />
       <link rel="shortcut icon" type="image/png" href="dashboard.assets/img/couchdb-logo.png"/>
    --- End diff --
    
    awesome, can we make the favicon configurable too? this was another thing we needed for pouchdb-fauxton


---
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] couchdb-fauxton issue #868: Update to webpack 2

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

    https://github.com/apache/couchdb-fauxton/pull/868
  
    +1 pending the minor comments/tweaks


---
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] couchdb-fauxton pull request #868: Update to webpack 2

Posted by millayr <gi...@git.apache.org>.
Github user millayr commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/868#discussion_r106692449
  
    --- Diff: test/test.config.underscore ---
    @@ -12,7 +12,7 @@
     // License for the specific language governing permissions and limitations under
     // the License.
     //
    -
    +var Promise = require('bluebird');
    --- End diff --
    
    const?


---
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] couchdb-fauxton pull request #868: Update to webpack 2

Posted by millayr <gi...@git.apache.org>.
Github user millayr commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/868#discussion_r106686509
  
    --- Diff: devserver.js ---
    @@ -4,6 +4,7 @@ var webpack = require('webpack');
     var WebpackDev = require('webpack-dev-server');
     var config = require('./webpack.config.dev.js');
     var httpProxy = require('http-proxy');
    +var path = require('path');
    --- End diff --
    
    const?


---
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] couchdb-fauxton issue #868: Update to webpack 2

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

    https://github.com/apache/couchdb-fauxton/pull/868
  
    This is great!  Left a few comments @garrensmith 


---
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] couchdb-fauxton pull request #868: Update to webpack 2

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/868#discussion_r107089464
  
    --- Diff: webpack.config.release.js ---
    @@ -49,51 +73,71 @@ module.exports = {
       },
     
       module: {
    -    preLoaders: [
    -      {
    -        test: /\.jsx?$/,
    -        loaders: ['eslint'],
    -        exclude: /node_modules/
    -      }
    -    ],
         loaders: [
         {
           test: /\.jsx?$/,
    +      enforce: "pre",
    +      use: ['eslint-loader'],
    +      exclude: /node_modules/
    +    },
    +    {
    +      test: /\.jsx?$/,
           exclude: /node_modules/,
    -      //loader: 'react-hot!babel'
    -      loader: 'babel'
    +      use: 'babel-loader'
         },
    -    { test: require.resolve("jquery"),
    -      loader: "expose?$!expose?jQuery"
    +    {
    +      test: require.resolve('jquery'),
    +      use: [{
    +          loader: 'expose-loader',
    +          options: 'jQuery'
    +      },
    +      {
    +          loader: 'expose-loader',
    +          options: '$'
    +      }]
          },
    -    { test: require.resolve("backbone"),
    -      loader: "expose?Backbone"
    +     {
    +      test: require.resolve("backbone"),
    +      use: [{
    +          loader: 'expose-loader',
    +          options: 'Backbone'
    +      }]
         },
    -    { test: /\.less/,
    -      loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader", {
    +    {
    +      test: /\.less/,
    +      use: ExtractTextPlugin.extract({
    +        fallback: "style-loader",
    +        use: [
    +          "css-loader",
    +          "less-loader"
    +        ],
             publicPath: '../../'
           }),
         },
    -    { test: /\.css$/, loader: 'style!css' },
    +    {
    +      test: /\.css$/, use: [
    +        'style-loader',
    +        'css-loader'
    +        ]
    +    },
         {
           test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
    -      loader: 'url?limit=10000&mimetype=application/font-woff&name=dashboard.assets/fonts/[name].[ext]'
    +      loader: 'url-loader?limit=10000&mimetype=application/font-woff&name=dashboard.assets/fonts/[name].[ext]'
         },
         {
    -      test: /\.woff2(\?\S*)?$/,   loader: 'url?limit=10000&mimetype=application/font-woff2&name=dashboard.assets/fonts/[name].[ext]'
    +      test: /\.woff2(\?\S*)?$/,   loader: 'url-loader?limit=10000&mimetype=application/font-woff2&name=dashboard.assets/fonts/[name].[ext]'
         },
         {
    -      test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,    loader: 'url?limit=10000&mimetype=application/font-tff&name=dashboard.assets/fonts/[name].[ext]'
    +      test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,    loader: 'url-loader?limit=10000&mimetype=application/font-tff&name=dashboard.assets/fonts/[name].[ext]'
         },
    -    { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,    loader: 'file?name=dashboard.assets/fonts/[name].[ext]' },
    -    { test: /\.swf(\?v=\d+\.\d+\.\d+)?$/,    loader: 'file?name=dashboard.assets/[name].[ext]' },
    --- End diff --
    
    swf isn't actually needed in either. I'll remove it.


---
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] couchdb-fauxton pull request #868: Update to webpack 2

Posted by garrensmith <gi...@git.apache.org>.
Github user garrensmith commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/868#discussion_r107089412
  
    --- Diff: test/test.config.underscore ---
    @@ -12,7 +12,7 @@
     // License for the specific language governing permissions and limitations under
     // the License.
     //
    -
    +var Promise = require('bluebird');
    --- End diff --
    
    Yes, it is required.


---
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] couchdb-fauxton pull request #868: Update to webpack 2

Posted by millayr <gi...@git.apache.org>.
Github user millayr commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/868#discussion_r106686584
  
    --- Diff: devserver.js ---
    @@ -98,9 +81,33 @@ var runWebpackServer = function () {
         // don't explode on cancelled requests
       });
     
    -  server.app.all('*', function (req, res) {
    -    proxy.web(req, res);
    -  });
    +  var options = {
    --- End diff --
    
    const?


---
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] couchdb-fauxton pull request #868: Update to webpack 2

Posted by millayr <gi...@git.apache.org>.
Github user millayr commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/868#discussion_r106698032
  
    --- Diff: webpack.config.release.js ---
    @@ -49,51 +73,71 @@ module.exports = {
       },
     
       module: {
    -    preLoaders: [
    -      {
    -        test: /\.jsx?$/,
    -        loaders: ['eslint'],
    -        exclude: /node_modules/
    -      }
    -    ],
         loaders: [
         {
           test: /\.jsx?$/,
    +      enforce: "pre",
    +      use: ['eslint-loader'],
    +      exclude: /node_modules/
    +    },
    +    {
    +      test: /\.jsx?$/,
           exclude: /node_modules/,
    -      //loader: 'react-hot!babel'
    -      loader: 'babel'
    +      use: 'babel-loader'
         },
    -    { test: require.resolve("jquery"),
    -      loader: "expose?$!expose?jQuery"
    +    {
    +      test: require.resolve('jquery'),
    +      use: [{
    +          loader: 'expose-loader',
    +          options: 'jQuery'
    +      },
    +      {
    +          loader: 'expose-loader',
    +          options: '$'
    +      }]
          },
    -    { test: require.resolve("backbone"),
    -      loader: "expose?Backbone"
    +     {
    +      test: require.resolve("backbone"),
    +      use: [{
    +          loader: 'expose-loader',
    +          options: 'Backbone'
    +      }]
         },
    -    { test: /\.less/,
    -      loader: ExtractTextPlugin.extract("style-loader", "css-loader!less-loader", {
    +    {
    +      test: /\.less/,
    +      use: ExtractTextPlugin.extract({
    +        fallback: "style-loader",
    +        use: [
    +          "css-loader",
    +          "less-loader"
    +        ],
             publicPath: '../../'
           }),
         },
    -    { test: /\.css$/, loader: 'style!css' },
    +    {
    +      test: /\.css$/, use: [
    +        'style-loader',
    +        'css-loader'
    +        ]
    +    },
         {
           test: /\.woff(\?v=\d+\.\d+\.\d+)?$/,
    -      loader: 'url?limit=10000&mimetype=application/font-woff&name=dashboard.assets/fonts/[name].[ext]'
    +      loader: 'url-loader?limit=10000&mimetype=application/font-woff&name=dashboard.assets/fonts/[name].[ext]'
         },
         {
    -      test: /\.woff2(\?\S*)?$/,   loader: 'url?limit=10000&mimetype=application/font-woff2&name=dashboard.assets/fonts/[name].[ext]'
    +      test: /\.woff2(\?\S*)?$/,   loader: 'url-loader?limit=10000&mimetype=application/font-woff2&name=dashboard.assets/fonts/[name].[ext]'
         },
         {
    -      test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,    loader: 'url?limit=10000&mimetype=application/font-tff&name=dashboard.assets/fonts/[name].[ext]'
    +      test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/,    loader: 'url-loader?limit=10000&mimetype=application/font-tff&name=dashboard.assets/fonts/[name].[ext]'
         },
    -    { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/,    loader: 'file?name=dashboard.assets/fonts/[name].[ext]' },
    -    { test: /\.swf(\?v=\d+\.\d+\.\d+)?$/,    loader: 'file?name=dashboard.assets/[name].[ext]' },
    --- End diff --
    
    why no swf support in `webpack.config.release.js` but it is supported in `webpack.config.dev.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] couchdb-fauxton pull request #868: Update to webpack 2

Posted by millayr <gi...@git.apache.org>.
Github user millayr commented on a diff in the pull request:

    https://github.com/apache/couchdb-fauxton/pull/868#discussion_r106692659
  
    --- Diff: test/test.config.underscore ---
    @@ -12,7 +12,7 @@
     // License for the specific language governing permissions and limitations under
     // the License.
     //
    -
    +var Promise = require('bluebird');
    --- End diff --
    
    Wait, is needing to import bluebird here necessary?


---
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.
---