Releases: insin/nwb
v0.15.0
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
orexport
syntax,exports
will beundefined
andmodule.exports
will be read-only andundefined
.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'sexport default
.If you used nwb's Preact project skeleton, the
init()
function inindex.js
needs to have a.default
tacked on when theApp
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 viawebpack.rules
instead of having its own specialwebpack.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, runnwb check-config
after updating nwb to find out if there's anything you need to change.
-
Deprecated
karma.testDirs
, renaming this config tokarma.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 towebpack.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 - anoptions
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 usingwebpack.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
inwebpack.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 tolib/
, targeting Node.js v4 [#233] - Use ES2015
String
methods available in Node.js v4 instead ofString.prototype.indexOf
comparisons [#222]
v0.14.3
v0.14.2
v0.14.1
v0.14.0
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 inpackage.json
[#167]- The ability to run project commands like
build
,serve
etc. from a globalnwb
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.
- The ability to run project commands like
- Fix
clean
commands in paths with spaces [#181]
Added:
- Added an
inferno
command for quick Inferno prototyping and building. Useinferno run <entry.js>
to serve a module andinferno build <entry.js> [dist/]
to build it. - Added a
preact
command for quick Preact prototyping and building. Usepreact run <entry.js>
to serve a module andpreact build <entry.js> [dist/]
to build it. - The
inferno
andpreact
commands use a render shim module by default which hooks intoInferno.render()
andPreact.render()
to intercept the incoming VNode and re-render it from the top when accepting Hot Module Replacement, so if you're callingrender()
yourself you don't have to specify a DOM node, or aroot
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 intoReactDOM.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.
- If you want to take full control of rendering, use the
- Added new features which are available in the
inferno
andpreact
commands to the existingreact
command:- Added a
--plugins
option to specify nwb plugins which should be installed and used without having to set up apackage.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 forPromise
,fetch
andObject.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.
- Added a
- Inferno and Preact apps are now configured to use their respective React compatibility modules by default if
react
orreact-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 usenwb 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 betrue
if you passed--preact
when callingnwb
.
Removed:
- Removed support for using
--set-env-VAR_NAME
arguments to set environment variables. jsnext:main
is no longer includedpackage.json
for newreact-component
andweb-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
v0.13.7
v0.13.6
Fixed:
-
Don't configure the babel runtime transform's
moduleName
path when transpiling code for npm [#205]If you depend on
babel-runtime
in a React component or Web module (by usingasync
/await
or enabling any of the runtime transform's other features) it needs to be resolvable from the end-user's dependencies, so should be added to your project'speerDependencies
.