nwb

A toolkit for React, Preact, Inferno & vanilla JS apps, React libraries and other npm modules for the web, with no configuration (until you need it)

OTHER License

Downloads
14K
Stars
5.6K
Committers
33

Bot releases are hidden (Show)

nwb -

Published by insin over 7 years ago

0.16.1 / 2017-05-31

Fixed:

  • Fixed bad render shim paths which were breaking the nwb react, nwb preact and nwb inferno quick development commands.
  • Fixed nwb preact commands and nwb react's --preact[-compat] when used with Preact 8 by removing a workaround for an old preact-compat distribution issue.

Added:

Dependencies:

  • css-loader: v0.28.3 → v0.28.4 - preserve leading underscore in class names
nwb -

Published by insin over 7 years ago

Breaking Changes:

  • Global react, preact, and inferno commands are no longer installed when nwb is installed globally [#308]

    These are now subcommands of the global nwb command, to avoid conflicting with global commands installed by official tools for these libraries, e.g. preact-cli is now available, which provides a global preact command.

  • Node.js v4.6.0 is now the minimum required version, based on the engines config of nwb's dependencies,

  • A separate Webpack rule for stylesheets imported from node_modules/ is no longer created by default.

    For backwards compatibility you can set webpack.style config to 'old' to use the old default behaviour - this capability will be removed in a future release.

  • The Babel plugin for Inferno now requires Inferno >= 1.5 and is not backwards-compatible with 1.4.

  • Default Webpack config now sets module.strictExportPresence = true so a missing export is now a compile error.

Added:

  • You can now control how Webpack rules are created for stylesheets via webpack.styles config.

    This allows you to set up multiple rules for your own stylesheets (e.g. using CSS Modules only for stylesheets in a particular directory) and to provide rules for dependencies which need a specific Webpack rule for their stylesheets.

    You can also disable creation of stylesheet rules by setting webpack.styles to false.

  • Re-enabled the react-constant-elements transform for React production builds, due to significant bug fixes.

  • Added a --no-hmre flag for use when serving a React app, to disable use of React Transform to attempt to automatically handle Hot Module Replacement for React components and display an overlay with render() errors [#263]

  • Added support for intl and react-intl in webpack.compat config [#260] [grahamlyus]

  • You can now provide a webpack.config() function which will be given the generated Webpack config to do whatever it wants with [#256]

  • You can now provide use config with a list of loaders in webpack.rules to replace a rule's default loader with chained loaders [#256]

  • You can now disable a default Webpack config rule by setting it to false [#256]

Changed:

  • Default options are no longer used if you provide a custom loader for a rule in webpack.rules [#256]
  • React project templates now use classes and React.Component instead of React.createClass(), which is deprecated as of React v15.5 [#216]

Fixed:

  • Fixed chunk hash not changing when imports in a split chunk are changed, by dropping use of the webpack-md5-hash plugin [#301] [grahamlyus]
  • Added missing config for CopyWebpackPlugin when serving a react-component project's demo app, so any static content in demo/public/ will be also served by the dev server [#307]
  • Removed node_modules/ caching from default Travis CI config in project skeletons, as it's been reported to cause build failures [#271]
  • An output directory specified with a trailing slash is now cleaned properly when creating a build.
  • A loader configured for a Webpack rule is no longer moved into the options object when an options object hasn't been explicitly configured [#256]
  • Fixed cleaning nested dirs, including a demo app's demo/dist/ dir.
  • Fixed cleaning output directories specified with a trailing slash.

Dependencies:

  • autoprefixer: v6.7.0 → v7.1.1
  • babel-cli: v6.22.2 → v6.24.1
  • babel-core: v6.22.1 → v6.24.1
  • babel-loader: v6.2.10 → v7.0.0
  • babel-plugin-inferno: v1.7.0 → v3.2.0 - adds support for Inferno 1.5, not backwards-compatible with 1.4
  • babel-plugin-istanbul: v3.1.2 → v4.1.4 - drop support for Node.js v0.10 and v0.12
  • babel-plugin-transform-react-jsx: v6.22.0 → v6.24.1
  • babel-plugin-transform-react-remove-prop-types: v0.2.11 → v0.4.5 - dropped support for React.createClass() in favour of the new create-react-class package
  • babel-plugin-transform-runtime: v6.22.0 → v6.23.0
  • babel-polyfill: v6.22.0 → v6.23.0
  • babel-preset-es2015: v6.22.0 → v6.24.1
  • babel-preset-es2016: v6.22.0 → v6.24.1
  • babel-preset-react: v6.22.0 → v6.24.1
  • babel-preset-stage-0: v6.22.0 → v6.24.1
  • babel-preset-stage-1: v6.22.0 → v6.24.1
  • babel-preset-stage-2: v6.22.0 → v6.24.1
  • babel-preset-stage-3: v6.22.0 → v6.24.1
  • babel-runtime: v6.22.0 → v6.23.0
  • case-sensitive-paths-webpack-plugin: v1.1.4 → v2.0.0 - use the file system exposed by the compiler
  • css-loader: v0.26.1 → v0.28.3 - added an alias option
  • detect-port: v1.1.0 → v1.1.3
  • express: v4.14.0 → v4.15.3
  • file-loader: v0.9.0 → v0.11.1 - added useRelativePath option
  • filesize: v3.4.3 → v3.5.10
  • inquirer: v3.0.1 → v3.0.6
  • karma: v1.4.0 → v1.7.0
  • karma-chrome-launcher: v2.0.0 → v2.1.1 - add support for headless Chrome/ChromeCanary
  • karma-mocha-reporter: v2.2.2 → v2.2.3
  • karma-phantomjs-launcher: v1.0.2 → v1.0.4 - fixed more path issues
  • karma-webpack: v2.0.1 → v2.0.3 - don't swallow configuration errors
  • mocha: v3.2.0 → v3.4.2
  • ora: v1.1.0 → v1.2.0 - added warn() and info() utilities
  • postcss-loader: v1.2.2 → v2.0.5 - validate options
  • resolve: v1.2.0 → v1.3.3
  • style-loader: v0.13.1 → v0.18.1
  • url-loader: v0.5.7 → v0.5.8 - fix loader util deprecation warning
  • webpack: v2.2.1 → v2.6.1 - import() can now configure a chunk name, require.ensure() can now take an error callback, added module.strictExportPresence
  • webpack-dev-middleware: v1.9.0 → v1.10.2 - CORS security fix
  • webpack-hot-middleware: v2.15.0 → v2.18.0 - client overlay style can now be customised with CSS using #webpack-hot-middleware-clientOverlay
  • webpack-merge: v2.4.0 → v4.1.0
  • whatwg-fetch: v2.0.2 → v2.0.3

Internal:

  • Use fs and fs-extra instead of glob and rimraf, which are now only devDependencies.
nwb -

Published by insin over 7 years ago

This release fixes dependency issues from v0.15.7

Dependencies:

  • extract-text-webpack-plugin: v2.1.0 - fix bad scoped version in nwb v0.15.7
  • html-webpack-plugin: v2.26.0 → v2.28.0 - revert relative loader resolving change from v2.25.0 back to a full path
  • webpack: v2.2.0 → v2.2.1 - ident is now automatic, fixes issue passing options to postcss-loader
nwb -

Published by insin over 7 years ago

Added:

Changed:

Fixed:

  • Fixed typo in clean command in react-component skeleton [#283] [totaldis]

Docs:

nwb -

Published by insin over 7 years ago

Changed:

  • Explicitly call process.exit(0) from the nwb command when there are no errors running a command [#262]
nwb -

Published by insin over 7 years ago

Fixed:

  • Fixed blank version being set for the React peerDependency in new react-component projects.
    • getstorybook now works in a new react-component project again
  • Use the transpiled ES5 version of preact-compat for compatibility builds using react build with the --preact flag, to prevent UglifyJS errors [#244]
nwb -

Published by insin over 7 years ago

Changed:

  • Support the Array version of deprecated webpack.postcss config.

    conemu64_2017-01-26_04-44-52

  • Tell the user they're including redundant config if they've manually configured inferno-compat or preact-compat aliases for React modules [#247]

    conemu64_2017-01-26_03-11-37

nwb -

Published by insin over 7 years ago

Fixed:

  • Added a missing .default to the Preact project skeleton where CommonJS require() was being used to import an ES module [#245]

    .default must now be used to access the default export from an ES module when importing with CommonJS require() as Webpack 2 prevents module format mixing, which was previously used to provide CommonJS interop.

75019261

nwb -

Published by insin over 7 years ago

Fixed:

  • Use the transpiled ES5 version of preact-compat, as UglifyJS can't handle the ES module build [#244]
nwb -

Published by insin over 7 years ago

Removed:

  • Remove hints about possibly not needing babel.cherryPick due to Webpack 2 tree shaking, as this doesn't currently appear to be true.
nwb -

Published by insin over 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 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]
nwb -

Published by insin over 7 years ago

Fixed:

nwb -

Published by insin almost 8 years ago

Fixed:

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

Published by insin almost 8 years ago

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

Published by insin almost 8 years ago

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

Published by insin almost 8 years ago

Changed:

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

Dependencies:

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

Published by insin almost 8 years ago

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

Published by insin almost 8 years ago

Fixed:

nwb -

Published by insin almost 8 years ago

Fixed:

  • Fix bad char in initial Git commit [#182 by @ntwcklng]
nwb -

Published by insin almost 8 years ago

Fixed:

  • Fix default test in the preact-app template [#206 by @ntwcklng]
Package Rankings
Top 1.04% on Npmjs.org
Badges
Extracted from project README
Travis Appveyor npm package Coveralls
Related Projects