nwb v0.15.0 Release Notes

Release Date: 2017-01-25 // about 7 years ago
  • ๐Ÿ’ฅ Breaking Changes:

    • โฌ†๏ธ Upgraded from Webpack 1 to Webpack 2 [#110]

    Minimum Node.js version increased from 4.2 to 4.3 - this is Webpack 2's minimum supported Node.js version.

    Strict Webpack configuration - Webpack 2 is strict about what appears in its configuration object. If you're using webpack.extra config, it must conform to Webpack 2's configuration format or your build will fail with a validation error.

    Dropped CommonJS compatibility when importing ES modules - Webpack 2 no longer allows you to mix CommonJS modules with ECMAScript modules - if a module uses import or export syntax, exports will be undefined and module.exports will be read-only and undefined.

    As a result, we can no longer provide CommonJS interop by default for ES Modules - you will need to check your code for usage of CommonJS require() to import ES modules and tack a .default on the end if you need to use the module's export default.

    If you used nwb's Preact project skeleton, the init() function in index.js needs to have a .default tacked on when the App component is being imported.

    Custom top-level properties no longer allowed in Webpack configuration - Webpack 2 no longer allows custom top-level properties in its configuration. Loader configuration which can't be serialised, such as plugin objects, can now be provided directly as loader options instead using webpack.rules config instead.

    This includes postcss-loader, which is now configured via webpack.rules instead of having its own special webpack.postcss config.

    nwb.config.js Config Format Changes:

    ๐Ÿš€ > For deprecations, nwb will continue to support the old format for the next couple of releases, displaying warning messages about the changes required and adapting deprecated config for use in the current version where possible.

    โšก๏ธ > If you have an nwb.config.js file, run nwb check-config after updating nwb to find out if there's anything you need to change.

    • ๐Ÿ”ง Deprecated karma.testDirs, renaming this config to karma.excludeFromCoverage, as it can be configured to exclude any paths from code coverage, not just directories [#236]
      // < v0.15                         // v0.15
      module.exports = {                 module.exports = {
        karma: {                           karma: {
          testDirs: [                =>      excludeFromCoverage: [
            'test/',                           'test/',
            'path/to/ignorethis.js'            'path/to/ignorethis.js'
          ]                                  ]
        }                                  }
      }                                  }
    
    • ๐Ÿ—„ Deprecated webpack.loaders, renaming this config to webpack.rules to match Webpack 2's new config format:
      // < v0.15              // v0.15
      module.exports = {      module.exports = {
        webpack: {              webpack: {
          loaders: {      =>      rules: {
            /* ... */               /* ... */
          }                       }
        }                       }
      }                       }
    
    • ๐Ÿ”ง Deprecated use of a query property to configure Webpack rule options as a separate object - an options property should now be used as per Webpack 2's new config format:
      // < v0.15                        // v0.15
      module.exports = {                module.exports = {
        webpack: {                        webpack: {
          loaders: {                        rules: {
            css: {                            css: {
              query: {              =>          options: {
                modules: /* ... */                modules: /* ... */
              }                                 }
            }                                 }
          }                                 }
        }                                 }
      }                                 }
    

    You can also still configure loader options as a flat object to make this particular change irrelevant:

      module.exports = {
        webpack: {
          rules: {
            css: {
              modules: /* ... */
            }
          }
        }
      }
    
    • ๐Ÿ”ง Deprecated configuring PostCSS plugins with special webpack.postcss config - postcss-loader can now be configured like any other loader using webpack.rules config:
      // < v0.15                           // v0.15
      module.exports = {                   module.exports = {
        webpack: {                           webpack: {
          postcss: [                   =>      rules: {
            require('precss')(),                 postcss: {
            require('autoprefixer')()              plugins: [
          ]                                          require('precss')(),
        }                                            require('autoprefixer')()
      }                                            ]
                                                 }
                                               }
                                             }
                                           }
    

    โœ‚ Removed:

    • โœ‚ Removed support for configuration which was deprecated in nwb v0.12.
    • โœ‚ Removed support for json-schema in webpack.compat config, as this library has now been fixed [#227]

    Dependencies:

    • autoprefixer: v6.6.1 โ†’ v6.7.0
    • babel-cli: v6.18.0 โ†’ v6.22.2
    • babel-core: v6.21.0 โ†’ v6.22.1
    • ๐Ÿ”Œ babel-plugin-inferno: v1.5.0 โ†’ v1.7.0 - make plugin ES5-environment compatible; add option to import createVNode
    • ๐Ÿ”Œ babel-plugin-transform-react-jsx: v6.8.0 โ†’ v6.22.0
    • ๐Ÿ”Œ babel-plugin-transform-react-jsx-self: v6.11.0 โ†’ v6.22.0
    • ๐Ÿ”Œ babel-plugin-transform-react-jsx-source: v6.9.0 โ†’ v6.22.0
    • ๐Ÿ”Œ babel-plugin-transform-runtime: v6.15.0 โ†’ v6.22.0
    • babel-polyfill: v6.20.0 โ†’ v6.22.0
    • babel-preset-es2015: v6.18.0 โ†’ v6.22.0
    • babel-preset-es2016: v6.16.0 โ†’ v6.22.0
    • babel-preset-react : v6.16.0 โ†’ v6.22.0
    • babel-preset-stage-0: v6.16.0 โ†’ v6.22.0
    • babel-preset-stage-1: v6.16.0 โ†’ v6.22.0
    • babel-preset-stage-2: v6.18.0 โ†’ v6.22.0
    • babel-preset-stage-3: v6.17.0 โ†’ v6.22.0
    • babel-runtime: v6.20.0 โ†’ v6.22.0
    • detect-port: v1.0.7 โ†’ v1.1.0
    • filesize: v3.3.0 โ†’ v3.4.3
    • ๐Ÿ”Œ html-webpack-plugin: v2.24.1 โ†’ v2.26.0 - Webpack 2 RC support
    • ๐Ÿš€ inquirer: v2.0.0 โ†’ v3.0.1 - drop Node.js 0.12 support
    • karma: v1.3.0 โ†’ v1.4.0
    • karma-mocha-reporter: v2.2.1 โ†’ v2.2.2
    • ๐Ÿ‘ karma-webpack: v1.8.0 โ†’ v2.0.1 - Webpack 2 RC support
    • object-assign: v4.1.0 โ†’ v4.1.1
    • ora: v0.4.1 โ†’ v1.1.0 - text can now be changed while stopping and persisting
    • postcss-loader: v1.2.1 โ†’ v1.2.2
    • ๐Ÿš€ webpack: v1.14.0 โ†’ v2.2.0 - \o/
    • ๐Ÿ”€ webpack-merge: v2.3.1 โ†’ v2.4.0
    • ๐Ÿš€ whatwg-fetch: v2.0.1 โ†’ v2.0.2

    Temporarily Scoped Dependencies:

    ๐Ÿš€ These are being scoped to both make use of unreleased features and to test them out:

    • ๐Ÿš€ @insin/extract-text-webpack-plugin - scoped until this PR is merged and released
    • ๐Ÿš€ @insin/npm-install-webpack-plugin - scoped until new features are merged and released

    Internal:

    • โฌ‡๏ธ Dropped unused fs-extra dependency.
    • ๐Ÿ‘‰ Use babel-preset-env when transpiling to lib/, targeting Node.js 4 [#233]
    • ๐Ÿ‘‰ Use ES2015 String methods available in Node.js 4 instead of String.prototype.indexOf comparisons [#222]