Skip to content

Releases: insin/nwb

v0.13.3

10 Dec 11:28
Compare
Choose a tag to compare

Fixed:

  • Fix npm scripts in the inferno-app template.

v0.13.2

10 Dec 05:20
Compare
Choose a tag to compare

Fixed:

  • Initialise a Git repo for a new project after installing dependencies, so package.json includes dependencies saved by npm in the initial commit.

v0.13.1

10 Dec 04:23
Compare
Choose a tag to compare

Added:

  • Added a --copy-files flag for React component builds to copy files which will not be transpiled over to the build directories [#58]

v0.13.0

09 Dec 07:22
Compare
Choose a tag to compare

Added:

  • Added new project types: inferno-app and preact-app - use these with nwb new or nwb init to develop Inferno and Preact apps [#194]
  • Added an --inferno flag to React app builds to create an inferno-compat build [#194]
  • react-jsx-source and react-jsx-self Babel transforms are now enabled for React apps in development mode for improved debugging.
  • A Git repo with an initial commit is now created by default when creating a new project. Pass a --no-git flag to disable this.
  • Added project-specific variants of nwb test: nwb test-react, nwb-test-inferno and nwb-test-preact.
  • Added an audio loader and an svg loader.

Removed:

  • Removed hardcoded React preset from default Babel config when running tests - instead, nwb test will run the new nwb test-react command if you have a react-app or react-component project type in nwb.config.js.
  • Dependencies are no longer bundled. As a result, Babel 6 dependencies will no longer be deduplicated for npm2 users, so an nwb install will be slower and larger - consider upgrading to npm3 or yarn if you can.
  • Removed support for deprecated webpack.plugins config in nwb.config.js - this config must now be moved up into webpack instead.

Changed:

  • Handling of.svg files has been moved from the graphics loader to the new svg loader so inlining can be configured separately. This matters if you're using a sprite system, as base64 inlining SVGs breaks fragment identifiers.
  • Changed babel-plugin-transform-runtime configuration to make use of new moduleName config; Webpack module resolution no longer uses a blanket fallback to nwb's node_modules/ for serving and builds.
  • webpack.uglify config can now be set to false to disable use of UglifyJSPlugin in production builds for debugging [#160]

Dependencies:

  • autoprefixer: v6.4.0 → v6.5.3
  • babel-cli: v6.11.4 → v6.18.0
  • babel-core: v6.13.2 → v6.20.0
  • babel-loader: v6.2.4 → v6.2.9 - better syntax error messages
  • babel-plugin-istanbul: v2.0.0 → v3.0.0
  • babel-plugin-lodash: v3.2.8 → v3.2.10
  • babel-plugin-transform-react-remove-prop-types: v0.2.9 → v0.2.11
  • babel-plugin-transform-runtime: v6.12.0 → v6.15.0 - add moduleName config to specify runtime path
  • babel-polyfill: v6.13.0 → v6.20.0
  • babel-preset-es2015: v6.14.0 → v6.18.0
  • babel-preset-es2016: v6.11.3 → v6.16.0
  • babel-preset-react: v6.11.1 → v6.16.0
  • babel-preset-stage-0: v6.5.0 → v6.16.0
  • babel-preset-stage-1: v6.13.0 → v6.16.0
  • babel-preset-stage-2: v6.13.0 → v6.18.0
  • babel-preset-stage-3: v6.11.0 → v6.17.0
  • babel-runtime: v6.11.6 → v6.20.0
  • case-sensitive-paths-webpack-plugin: v1.1.3 → v1.1.4 - handle cwd being incorrect case
  • copy-webpack-plugin: v3.0.1 → v4.0.1
  • css-loader: v0.23.1 → v0.26.1 - cssnano's use of autoprefixer is now disabled by default
  • detect-port: v1.0.0 → v1.0.6
  • diff: v2.2.3 → v3.1.0
  • figures: v1.7.0 → v2.0.0
  • html-webpack-plugin: v2.22.0 → v2.24.1
  • inquirer: v1.1.2 → 2.0.0
  • glob: v7.0.5 → v7.1.1
  • karma: v1.2.0 → v1.3.0
  • karma-chrome-launcher: v1.0.1 → v2.0.0 - chromium support
  • karma-mocha: v1.1.1 → v1.3.0
  • karma-mocha-reporter: v2.1.0 → v2.2.1
  • karma-phantomjs-launcher: v1.0.1 → v1.0.2 - fix phantomjs path calculation
  • mocha: v3.0.2 → v3.2.0
  • phantomjs-prebuilt: v2.1.12 → v2.1.13
  • postcss-loader: v0.10.0 → v1.2.0
  • qs: v6.2.1 → v6.3.0
  • webpack: v1.13.1 → v1.14.0 - updated node-libs-browser and uglifyjs versions - screw_ie8 is now enabled by default; fix for Babel sourcemap issue
  • webpack-merge: v0.14.1 → v1.0.2
  • webpack-dev-middleware: v1.6.1 → v1.8.4
  • webpack-hot-middleware: v2.12.2 → v2.13.2
  • whatwg-fetch: v1.0.0 → v2.0.1 - changes behaviour of Headers to be spec-compliant

v0.12.2

29 Sep 05:42
Compare
Choose a tag to compare

Removed:

  • Dropped the production react-constant-elements transform for now due to bugs.

v0.12.1

14 Sep 16:38
Compare
Choose a tag to compare

Experimental:

  • react run can now run modules which export a React component or element.

Added:

  • Added a reload option to Express middleware to enable reloading the page if Hot Module Reloading is unsuccessful [#168]

v0.12.0

16 Aug 11:00
Compare
Choose a tag to compare

Breaking Changes:

  • Dropped Node.js v0.12 support

    Based on the engines config of nwb's dependencies, Node.js v4.2.0 is now the minimum required version.

  • Upgraded from Babel 5 to Babel 6 [#12] [#31] [@geowarin]

    Babel 6 introduced a number of breaking changes which you may need to account for in your codebase if you're using nwb or were otherwise using Babel 5.

    babel config in nwb.config.js is no longer directly equivalent to what you would put in a .babelrc file.

  • Added support for long-term caching [#73]

    A deterministic hash is now included in the filenames of generated .js and .css files.

    The Webpack manifest (required for module loading) is now extracted and automatically injected prior to the </body> tag, so your HTML template must have a </body> tag.

    If you do any post-build processing on generated files it might need to be updated, as production app builds will now generate files as [name].[hash].[ext] instead of [name].[ext].

  • Dropped support for the .jsx extension

    It's dead, Jim.

    You can use webpack.loaders config to set /\.jsx?$/ as babel-loader's test config and webpack.extra config to add .jsx back to the resolve.extensions list if you're using .jsx files and can't reasonably migrate away.

  • Dropped build-module and build-umd/clean-umdcommands

    These were a confusing middle layer which split the implementation of building a React component or browser-focused npm module in two. They both required a config file to provide a project type for nwb to figure out what to do.

    They've been replaced with build-react-component and build-web-module commands, which are now used in package.json scripts in the corresponding project templates.

    As a result having a config file is now optional for all project types. If you don't need configuration, you can delete the nwb.config.js file created as a convenience by project templates.

    A config file is now only required if you want to use the generic build, clean and serve commands.

  • Changed ES6 module build directory from es6/ to es/

    Upgrade steps:

    • Replace "es6/index.js" with "es/index.js" in package.json "jsnext:main" config
    • Also add "module": "es/index.js", as this is part of a proposal for native module support which is being supported by multiple bundlers.
    • Replace "es6" with "es" in package.json files config
  • Dropped webpack.vendorBundle config in favour of a --no-vendor flag

    Making this feature toggle a command line argument makes it easier to try, and to combine with other feature toggles like --preact.

    Tweak your package.json "build" script instead if you were using webpack.vendorBundle: false config:

    {
      "scripts": {
        "build": "nwb build-react-app --no-vendor"
      }
    }

nwb.config.js Config Format Changes:

For deprecations, nwb v0.12 will support the old format, display warning messages about the changes required, and adapt the old format for use in the current build where possible.

  • build config is deprecated in favour of new npm config, which is a slightly different format.

    nwb will adapt any build config it finds for the current build and log out the equivalent npm config.

    // < v0.12                             // v0.12
    module.exports = {                     module.exports = {
      build: {                         =>    npm: {
        jsNext: true,                          esModules: true,
        umd: true,                     =>      umd: {
        global: 'MyComponent',                   global: 'MyComponent',
        externals: {'react': 'React'}            externals: {'react': 'React'}
      }                                        }
    }                                        }
                                           }
    
    // < v0.12               // v0.12 - simple UMD config without externals
    module.exports = {       module.exports = {
      build: {           =>    npm: {
        jsNext: true,            esModules: true,
        umd: true,       =>      umd: 'myLib'
        global: 'MyLib'        }
      }                      }
    }
    
  • The Babel runtime transform is now configured using new babel.runtime config instead of Babel 5's optional config.

    The runtime transform is now partially-enabled by default to support use of async/await and generators, so update your configuration accordingly. nwb will adapt ['runtime'] config for the current build by converting it to true.

    // < v0.12                     // v0.12 - enabled by default for regenerator
    module.exports = {
      babel: {
        optional: ['runtime']  =>  // You can remove your config if you were
      }                            // using it for async/await or generators
    }
    
    // < v0.12                     // v0.12 - also import helpers from
    module.exports = {             module.exports = {
      babel: {                       babel: {
        optional: ['runtime']  =>      runtime: 'helpers'
      }                              }
    }                              }
    
  • babel.loose config is now Boolean instead of Babel 5's string config.

Loose mode is now enabled by default, so loose config is only used if you need to disable loose mode.

// < v0.12              // v0.12 - enabled by default
module.exports = {
  babel: {
    loose: 'all'    =>  (none)
  }
}
// < v0.12 - loose mode not used      // v0.12 - disabling loose mode
                                      module.exports = {
                                        babel: {
(none)                            =>      loose: false
                                        }
                                      }
  • karma.tests config is deprecated in favour of new karma.testContext and karma.testFiles config, depending on which was being specified. If karma.tests is present, nwb will attempt to detect the appropriate new config to use it for, or will otherwise fall back to the new default config.

    // < v0.12                         // v0.12 - using a Webpack context module
    module.exports = {                 module.exports = {
      karma: {                           karma: {
        tests: 'tests.webpack.js'  =>      testContext: 'tests.webpack.js'
      }                                  }
    }                                  }
    
    // < v0.12                         // v0.12 - custom test file glob
    module.exports = {                 module.exports = {
      karma: {                           karma: {
        tests: 'test/**.test.js'   =>      testFiles: 'test/**.test.js'
      }                                  }
    }                                  }
    

Developer Experience Improvements:

  • Added a check-config command which checks your nwb configuration file for errors and deprecated usage, and provides some usage hints (e.g. where more convenient config is available).

    Run this after upgrading your nwb version and it will tell you what needs to be changed.

  • New user-friendly output for Webpack builds based on create-react-app's.

    This provides friendlier error and warning reporting, reports the gzipped size of generated files and uses a persistent console for development server logging.

    Windows Note: running a development server will clear the current screen in your console - in Windows the escape codes used to do this have the unfortunate effect of clearing all the scrollback history in your current console.

    To avoid this use the start command to spawn a new command window when running the development server in Windows, e.g.:

    start npm start
    start react run app.js
    
  • Apps can now use fetch, async/await and generators out of the box without any configuration.

    Promise, fetch, Object.assign polyfills and the regenerator runtime are now provided by default.

  • You can now transform destructured imports to cherry-picked imports for specified modules using new babel.cherryPick config [#141]

  • Case-sensitivity of require/import paths is now enforced by CaseSensitivePathsPlugin, avoiding an easy-to-overlook cause of CI build failure if you don't develop on Linux.

  • If the intended dev server port is not available, you will now be prompted to continue with a different, fr...

Read more

v0.11.1

16 Jul 03:24
Compare
Choose a tag to compare

Fixed:

  • PostCSS config was not being created for the vendor/node_modules/ loader for CSS preprocessor plugins [#129]

v0.11.0

07 Jun 16:58
Compare
Choose a tag to compare

Breaking Changes:

  • Replaced the deprecated autoprefixer-loader with postcss-loader in default style pipelines - it's configured to do the same autoprefixing by default [#57]
    • If you were configuring vendor prefixing using webpack.loaders.autoprefixer, you will now need to manage an autprefixer dependency yourself and use webpack.postcss to perform this configuration.

nwb.config.js Config Format Changes:

For deprecations, nwb v0.11 will support the old format and display warning messages about the changes required.

  • webpack.plugins is deprecated - config under webpack.plugins should be moved up into webpack instead. Having certain config under a plugins prop was an implementation detail which wasn't relevant to end-users [#113]

    // < v0.11
    module.exports = {
      webpack: {
        plugins: {
          define: {...},
          html: {...}
        }
      }
    }
    // v0.11
    module.exports = {
      webpack: {
        define: {...},
        html: {...}
      }
    }
  • Support for flatter Webpack loader configuration was added. Having a query object is now optional - loader query configuration can now be placed directly under the loader's id [#113]

    // < v0.11
    module.exports = {
      webpack: {
        loaders: {
          css: {
            query: {
              modules: true
            }
          }
        }
      }
    }
    // v0.11
    module.exports = {
      webpack: {
        loaders: {
          css: {
            modules: true
          }
        }
      }
    }

Added:

  • Installing globally now adds a react command for quick React development starting from a single file.
    • react run entry.js runs a development server.
    • react build entry.js creates a static build.
    • For these commands, Babel is preconfigured to allow you to use all of its Stage 0 features out of the box, including async/await.
    • These are implemented by (the previously undocumented) serve-react and (new) build-react nwb commands.
  • The entry point for apps and npm module UMD builds can now be specified as an argument to build and serve commands. The default is still src/index.js. [#115]
  • The directory web apps are built into can now be specified as an argument to build, clean and serve commands. The default is still dist/.
  • Added webpack.compat config to enable compatibility tweaks for modules which are known to be problematic with Webpack - initially this includes support for Enzyme, Moment.js and Sinon.js 1.x [#108]
  • Added webpack.postcss config to customise the PostCSS plugins applied to each style pipeline [#57]
  • Added webpack.vendorBundle config to disable automatically extracting anything imported from node_modules/ out into a separate vendor chunk [#106]
  • Added documentation for creating and using a test context module if there's code you need to run prior to tests running, such as configuring your assertion library with additional assertions.
  • Added a --config option to allow you to specify your own config file instead of nwb.config.js.

Changed:

  • Apps are no longer required to provide their own HTML template. The default template path of src/index.html will continue to be used if a file exists there. If an alternative template is not provided via webpack.html config, nwb will now fall back to using a basic template.
  • Restored default use of the Babel polyfill in Karma config so tests (and their dependencies) can assume a modern environment.
  • Default babel-loader config now uses cacheDirectory: true for a speedup.
  • Improved debug output (activated with a DEBUG=nwb environment variable) to print config objects in full - if you're configuring plugin objects (e.g. PostCSS plugins), it's recommended to create instances of them if you want to use debug output.
  • webpack.optimize.DedupePlugin is now only used for production builds, as recommended in the Webpack docs.

Dependencies:

v0.10.0

16 May 09:31
Compare
Choose a tag to compare

Breaking Changes:

  • React v15 is now installed into React app/component skeletons by default.

Changed:

  • Default Karma config now includes showDiff: true config for the default Mocha reporter.
  • The dev server now logs an initial webpack building... message so you know you're waiting for the initial build.
  • npm scripts in the skeletons generated for react-app and web-app projects now use project type-specific commands, so the nwb.config.js included with them can be deleted if you don't need any config tweaks.
  • nwb now passes the --save option to npm when installing React dependencies, to honour any npm save-exact (recommended!) or save-prefix config you have set.

Added:

  • Extra Karma config can now be configured via a karma.extra Object.
  • Added a --react option to allow you to set the version of React which will be installed when creating apps or components. This defaults to whatever the stable version of React was when the version of nwb you're using was released.

Dependencies:

  • chalk: v1.1.1 → v1.1.3 - update deps
  • cross-spawn: v2.1.5 → v2.2.3 - update deps
  • expect: v1.16.0 → v1.20.1
  • fs-extra: v0.26.7 → v0.30.0
  • html-webpack-plugin: v2.14.0 → v2.17.0
  • inquirer: v0.12.0 → v1.0.2 - switch to Promise-based API
  • karma-coverage: v0.5.5 → v1.0.0
  • karma-mocha: v0.2.2 → v1.0.1
  • karma-mocha-reporter: v2.0.0 → v2.0.3
  • npm-install-webpack-plugin: v3.0.0 → v3.1.2 [#77]
  • phantomjs-prebuilt: v2.1.6 → v2.1.7
  • qs v6.1.0 → v6.2.0
  • webpack: v1.12.14 → v1.13.0
  • webpack-merge: v0.8.4 → v0.12.0