Skip to content

Releases: insin/nwb

v0.15.0

24 Jan 19:20
Compare
Choose a tag to compare

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 v0.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 v4 [#233]
  • Use ES2015 String methods available in Node.js v4 instead of String.prototype.indexOf comparisons [#222]

v0.14.3

21 Jan 12:40
Compare
Choose a tag to compare

Fixed:

v0.14.2

19 Jan 23:49
Compare
Choose a tag to compare

Fixed:

  • Fix using Express middleware with a config file which exports a function [#238]

v0.14.1

13 Jan 03:13
Compare
Choose a tag to compare

Fixed:

  • Fix running tests with base config only (web-app and web-module projects).

Dependencies:

  • Downgrade html-webpack-plugin to v2.24.1 while issues later versions cause with npm-install-webpack-plugin are unresolved.

v0.14.0

12 Jan 18:56
Compare
Choose a tag to compare

This release brings support for Preact and Inferno up to parity with support for React, with new preact and inferno commands to match react, and Express middleware support for running development builds with them on your own server.

Quick development commands are now much better at installing dependencies nwb can determine you'll need up front. They can also now use style preprocessor plugins without having to introduce a package.json and have more flags to prevent you from having to reach for a config file.

Changes

Fixed:

  • To prevent version compatibility issues using project commands from a globally-installed nwb, it will now exit with a warning if the project specifies a different version of nwb in package.json [#167]
    • The ability to run project commands like build, serve etc. from a global nwb install is provided so you don't have to reinstall the entirety of nwb when creating new projects, but it's recommended that you switch to a locally-installed version later, as relying on globally-installed tool versions is brittle.
  • Fix clean commands in paths with spaces [#181]

Added:

  • Added an inferno command for quick Inferno prototyping and building. Use inferno run <entry.js> to serve a module and inferno build <entry.js> [dist/] to build it.
  • Added a preact command for quick Preact prototyping and building. Use preact run <entry.js> to serve a module and preact build <entry.js> [dist/] to build it.
  • The inferno and preact commands use a render shim module by default which hooks into Inferno.render() and Preact.render() to intercept the incoming VNode and re-render it from the top when accepting Hot Module Replacement, so if you're calling render() yourself you don't have to specify a DOM node, or a root when re-rendering in Preact.
    • If you want to take full control of rendering, use the --force flag and nwb will skip the render shim and use your entry module directly.
    • The react command's render shim doesn't hook into ReactDOM.render() and only handles rendering exported components or elements for convenient prototyping, as react-transform-hmr handles the details of accepting Hot Module Replacement and patching/re-rendering at the component/module level.
  • Added new features which are available in the inferno and preact commands to the existing react command:
    • Added a --plugins option to specify nwb plugins which should be installed and used without having to set up a package.json.
    • Added a --force option to force use of the provided entry module directly instead of the render shim module which is used by default to support quick prototyping.
    • Added a --no-polyfill option to disable inclusion of nwb's default polyfills for Promise, fetch and Object.assign if you're not using them or don't need them polyfilled.
    • Inferno compat and Preact compat dependencies are now automatically installed if missing.
    • react build can now build a module which exports a React component or element, for quick sharing of prototypes.
  • Inferno and Preact apps are now configured to use their respective React compatibility modules by default if react or react-dom are imported, allowing use of existing React code out of the box.

Changed:

  • The Webpack manifest module is now generated when building an app (as well as being inlined into the generated index.html) - you will need to include this first if manually handling HTML generation after building.
  • Express middleware now supports Inferno, Preact and plain JavaScript apps, not just React.
  • When building a React app using the --inferno or --preact flags, the required compatibility dependencies are now installed automatically if they can't be resolved from your project directory.
  • When creating new projects, the latest version of dependencies will be installed, rather than using a a version range hardcoded in nwb.
  • Skip initialising a Git repo if a .git/ directory already exists, e.g. you may want to use nwb init in an existing repo.
  • The default build for a React component demo app now supports use of a demo/public/ directory for static content.
  • An args property is now included in the object passed to user configs which export a function - this contains parsed arguments, e.g. args.preact will be true if you passed --preact when calling nwb.

Removed:

  • Removed support for using --set-env-VAR_NAME arguments to set environment variables.
  • jsnext:main is no longer included package.json for new react-component and web-module projects - only the "more standard" module property is used to point to an ES2015 modules build [#215]

Dependencies:

  • autoprefixer: v6.5.3 → v6.6.1
  • babel-core: v6.20.1 → v6.21.0
  • babel-loader: v6.2.9 → v6.2.10 - Webpack 2 RC support
  • babel-plugin-inferno: v1.4.0 → v1.5.0 - use import instead of global Inferno reference
  • babel-plugin-istanbul: v3.0.0 → v3.1.2
  • babel-plugin-lodash: v3.2.10 → v3.2.11
  • detect-port: v1.0.6 → v1.0.7
  • diff: v3.1.0 → v3.2.0
  • html-webpack-plugin: v2.24.1 → v2.26.0 - Webpack 2 RC support
  • karma-webpack: v1.8.0 → v1.8.1 - Webpack 2 RC support
  • ora: v0.3.0 → v0.4.1
  • phantomjs-prebuilt: v2.1.13 → v2.1.14
  • postcss-loader: v1.2.0 → v1.2.1
  • resolve: v1.1.7 → v1.2.0
  • webpack-dev-middleware: v1.8.4 → v1.9.0 - Webpack 2 RC support
  • webpack-hot-middleware: v2.13.2 → v2.15.0 - add cache for warnings
  • webpack-merge: v1.0.2 → v2.3.1 - providing an empty array/object no longer overrides when merging

v0.13.8

31 Dec 06:06
Compare
Choose a tag to compare

Changed:

  • Inferno apps now use Inferno 1.x by default.

Dependencies:

  • babel-plugin-inferno: v1.3.0-beta17 → v1.4.0

v0.13.7

25 Dec 06:10
Compare
Choose a tag to compare

Fixed:

  • Updated Inferno Babel plugin to fix whitespace trimming issue.

Changed:

  • Updated default Inferno version for new apps to 1.0.0-beta42.

Dependencies:

  • babel-plugin-inferno: v1.2.0-beta13 → v1.3.0-beta17 - fixes whitespace trimming around newlines

v0.13.6

13 Dec 03:52
Compare
Choose a tag to compare

Fixed:

v0.13.5

13 Dec 00:55
Compare
Choose a tag to compare

Fixed:

v0.13.4

10 Dec 21:41
Compare
Choose a tag to compare

Fixed:

  • Fix default test in the preact-app template [#206 by @ntwcklng]