From ca3f923bf0c9ac6c0bf1fac609899c274983b04e Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 12 Oct 2015 08:28:43 +0200 Subject: [PATCH] Added new version of react-webpack-template as dependency. Now using React 0.14 as base. --- CHANGELOG.md | 6 ++++++ README.md | 8 +++----- generators/component/templates/components/Base.js | 2 +- generators/component/templates/tests/Base.js | 5 ++--- package.json | 4 ++-- 5 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..f589077 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,6 @@ +# generator-react-webpack - Changelog + +## 2.2.0: +___Upgrades:___ + +1. Added new version of react-webpack-template, including support for React 0.14. diff --git a/README.md b/README.md index 8a0af26..7a0ed7e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,9 @@ Out of the box it comes with support for: - Ability to unit test components via Karma and Mocha/Chai ## Changes in Version 2.0 -The new version of generator-react-webpack does __NOT__ include support for Flux-Frameworks directly. Instead, we will use it as a base for other generators to build upon. This will make the base generator easier to use and update. +Tthis generator is written in ES2015. This means it is ___not compatible with node.js versions before 4.0___. + +It also does __NOT__ include support for Flux-Frameworks anymore. Instead, we will use it as a base for other generators to build upon. This will make the base generator easier to use and update. If you are interested, feel free to write your own generator and use generator-react-webpack as a base (via composition). @@ -82,13 +84,9 @@ We have opted to follow [@floydophone](https://twitter.com/floydophone) conventi Each component is a module and can be required using the [Webpack](http://webpack.github.io/) module system. [Webpack](http://webpack.github.io/) uses [Loaders](http://webpack.github.io/docs/loaders.html) which means you can also require CSS and a host of other file types. Read the [Webpack documentation](http://webpack.github.io/docs/home.html) to find out more. ## Props - -Thanks to all who contributed to [generator-angular](https://github.com/yeoman/generator-angular) as the majority of code here has been shamelessy sourced from that repo. - Thanks to [Edd Hannay](https://github.com/eddhannay) for his Webpack optimisations, my local merge and testing meant his additions lost his signature (my fault, sorry). So, big thanks Edd. ## Contribute - Contributions are welcomed. When submitting a bugfix, write a test that exposes the bug and fails before applying your fix. Submit the test alongside the fix. ### Running Tests diff --git a/generators/component/templates/components/Base.js b/generators/component/templates/components/Base.js index 27f20e6..4008db2 100644 --- a/generators/component/templates/components/Base.js +++ b/generators/component/templates/components/Base.js @@ -1,6 +1,6 @@ 'use strict'; -import React from 'react/addons'; +import React from 'react'; require('<%= style.webpackPath %>'); diff --git a/generators/component/templates/tests/Base.js b/generators/component/templates/tests/Base.js index 4282623..92cf2ba 100644 --- a/generators/component/templates/tests/Base.js +++ b/generators/component/templates/tests/Base.js @@ -4,8 +4,7 @@ 'use strict'; // Uncomment the following lines to use the react test utilities -// import React from 'react/addons'; -// const TestUtils = React.addons.TestUtils; +// import TestUtils from 'react-addons-test-utils'; import createComponent from 'helpers/shallowRenderHelper'; import <%= component.className %> from '<%= component.webpackPath %>'; @@ -18,6 +17,6 @@ describe('<%= component.className %>', () => { }); it('should have its component name as default className', () => { - expect(component._store.props.className).to.equal('<%= style.className %>'); + expect(component.props.className).to.equal('<%= style.className %>'); }); }); diff --git a/package.json b/package.json index 250bd2c..d02a44b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "generator-react-webpack", "version": "2.1.0", - "description": "Yeoman generator for using React with Webpack", + "description": "Yeoman generator for using React with Webpack via Babel", "keywords": [ "yeoman-generator", "react", @@ -37,7 +37,7 @@ "test": "mocha" }, "dependencies": { - "react-webpack-template": "^0.1.0", + "react-webpack-template": "^0.2.0", "underscore.string": "^3.2.2", "yeoman-generator": "^0.20.3", "yeoman-welcome": "^1.0.1"