From 9c2ff3440103f810ec250c47cd68fc9050c48b8c Mon Sep 17 00:00:00 2001 From: Bang Wu Date: Mon, 23 May 2016 15:59:45 +0800 Subject: [PATCH 1/7] support the React 15v --- index.js | 4 +++- package.json | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 664c11a..3fed520 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ var React = require('react'); +var ReactDOMServer = require('react-dom/server'); var evaluate = require('eval'); // src can be either a filename or a chunk name @@ -15,6 +16,7 @@ ReactToHtmlWebpackPlugin.prototype.apply = function(compiler) { try { var asset = findAsset(this.src, compiler, webpackStatsJson); + if (!asset) { throw new Error('Output file not found: "' + this.src + '"'); } @@ -22,7 +24,7 @@ ReactToHtmlWebpackPlugin.prototype.apply = function(compiler) { var source = asset.source(); var Component = evaluate(source, /* filename: */ undefined, /* scope: */ undefined, /* includeGlobals: */ true); var renderMethod = this.options.static ? 'renderToStaticMarkup' : 'renderToString'; - var html = React[renderMethod](React.createElement(Component)); + var html = ReactDOMServer[renderMethod](React.createElement(Component)); var template = this.options.template; diff --git a/package.json b/package.json index e772cb4..dcfbfca 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "eval": "^0.1.0" }, "peerDependencies": { - "react": "0.12.x || >=0.13.0-beta.1" + "react": "^15.1.0", + "react-dom": "^15.1.0" } } From 01be4822da1296604e7638e5873fd4fd85bee531 Mon Sep 17 00:00:00 2001 From: Bang Wu Date: Mon, 21 Nov 2016 16:49:18 +0800 Subject: [PATCH 2/7] support react 15 --- .travis.yml | 12 ++++++++++++ CHANGELOG.md | 16 ++++++++-------- README.md | 8 ++++---- package.json | 10 +++++----- 4 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..08dc2f4 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,12 @@ +language: node_js +node_js: + - "6" + - "5.11" +deploy: + provider: npm + email: ohwubang@gmail.com + api_key: + secure: D+66esLlGtDv3AYF2tGsbKu+7DYxS2RTSd1qvDruPpaq093LlFYK3OaiY1BonAJgJypApFfBAje15RUJpWuMJc0Lx9bPrL4I1YmZ1ar11xzpq8xwHpZctlvfZcRnB3N4MhF2wNiKifgSvF6pfMYcjRVHxxBHxGBUSyfQBTz5sJH+z5j3XVeyP1/ycpTu7resp0ijHC8hN0JdGsY6ky3VbDES3wiYHztFkgLcWrVtha8khv91aZGT+JztWpXIeF/3j382YMMCERMKO5ogtDhonM/gPYoS1MIFzE7KPGTFuP3CX6oVbe4GyxdIzXCBCiTqYac8JAceBenYt1MhjIMzr+PrF+I7z8hfzdWiBXkQyaZDJncPO39fhczUBFJdHSXBHFXzTvK1U0G+piD3rPZf1sYdLQ2FQiih6gte7mBZpMY7jSR4elS/Ld+Hr2ZodFR3vVxMm4+/tslSSknndHyWftq/jGJyLjwgxS9t0SJVENQlCVHRihAyaOAr3m0SHh6vRW+VjBV0ebeOLN5q7LtA0ET26+iOY4EbsLBXv5KxSXoFv15v3OVtBfh7rV2UfMxnYigob4Tq8FIzMjmn1y6a63qU8aCMZaWCO2rEQNQzdNPumMXe5drfczAFX6/k/xZFeJkiZVPiYPsDf4w+M56bfj/+nMwb18Gb0UiGa/oDKI0= + on: + tags: true + repo: bangwu/webpack-plugin-react-to-html diff --git a/CHANGELOG.md b/CHANGELOG.md index 46aeda1..1ab0ee5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,9 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). -## [Unreleased][unreleased] -### Changed -- Nothing yet. +## [2.2.1] - 2016-11-21 +### Added +- Let the package to support React 15 ## [2.2.0] - 2015-07-22 ### Added @@ -28,8 +28,8 @@ This project adheres to [Semantic Versioning](http://semver.org/). ### Added - Basic support for rendering factories without props to HTML. -[unreleased]: https://github.com/markdalgleish/react-to-html-webpack-plugin/compare/v2.2.0...HEAD -[2.2.0]: https://github.com/markdalgleish/react-to-html-webpack-plugin/compare/v2.1.0...v2.2.0 -[2.1.0]: https://github.com/markdalgleish/react-to-html-webpack-plugin/compare/v2.0.1...v2.1.0 -[2.0.1]: https://github.com/markdalgleish/react-to-html-webpack-plugin/compare/v2.0.0...v2.0.1 -[2.0.0]: https://github.com/markdalgleish/react-to-html-webpack-plugin/compare/v1.0.0...v2.0.0 +[2.2.1]: https://github.com/bangwu/react-to-html-webpack-plugin/compare/v2.2.0...V2.2.1 +[2.2.0]: https://github.com/bangwu/react-to-html-webpack-plugin/compare/v2.1.0...v2.2.0 +[2.1.0]: https://github.com/bangwu/react-to-html-webpack-plugin/compare/v2.0.1...v2.1.0 +[2.0.1]: https://github.com/bangwu/react-to-html-webpack-plugin/compare/v2.0.0...v2.0.1 +[2.0.0]: https://github.com/bangwu/react-to-html-webpack-plugin/compare/v1.0.0...v2.0.0 diff --git a/README.md b/README.md index b550bcc..6ffdcd6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![npm](https://img.shields.io/npm/v/react-to-html-webpack-plugin.svg?style=flat-square)](https://npmjs.org/package/react-to-html-webpack-plugin) [![Dependency Status](https://img.shields.io/david/markdalgleish/react-to-html-webpack-plugin.svg?style=flat-square)](https://david-dm.org/markdalgleish/react-to-html-webpack-plugin) +[![npm version](https://badge.fury.io/js/webpack-plugin-react-to-html.svg)](https://badge.fury.io/js/ # React-to-HTML Webpack Plugin @@ -11,7 +11,7 @@ Components are rendered after all source files have been compiled, so JSX works ## Install ```bash -$ npm install --save-dev react-to-html-webpack-plugin +$ npm install --save-dev webpack-plugin-react-to-html ``` ## Basic Usage @@ -21,7 +21,7 @@ This basic example assumes that the React component renders `` as the root ### webpack.config.js ```js -var ReactToHtmlPlugin = require('react-to-html-webpack-plugin'); +var ReactToHtmlPlugin = require('webpack-plugin-react-to-html'); module.exports = { @@ -70,7 +70,7 @@ module.exports = MyComponent; ### webpack.config.js ```js -var ReactToHtmlPlugin = require('react-to-html-webpack-plugin'); +var ReactToHtmlPlugin = require('webpack-plugin-react-to-html'); module.exports = { diff --git a/package.json b/package.json index dcfbfca..209d6a5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "react-to-html-webpack-plugin", - "version": "2.2.0", + "name": "webpack-plugin-react-to-html", + "version": "2.2.1", "description": "Webpack plugin that renders React components to HTML files", "main": "index.js", "scripts": { @@ -8,16 +8,16 @@ }, "repository": { "type": "git", - "url": "git@github.com:markdalgleish/react-to-html-webpack-plugin.git" + "url": "git@github.com:bangwu/react-to-html-webpack-plugin.git" }, "author": { "name": "Mark Dalgleish" }, "license": "MIT", "bugs": { - "url": "https://github.com/markdalgleish/react-to-html-webpack-plugin/issues" + "url": "https://github.com/bangwu/react-to-html-webpack-plugin/issues" }, - "homepage": "https://github.com/markdalgleish/react-to-html-webpack-plugin", + "homepage": "https://github.com/bangwu/react-to-html-webpack-plugin", "dependencies": { "eval": "^0.1.0" }, From b80ecdd3f266b148be2741c6df323e7902f726b5 Mon Sep 17 00:00:00 2001 From: Bang Wu Date: Mon, 21 Nov 2016 16:53:24 +0800 Subject: [PATCH 3/7] fix test --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 209d6a5..b25d2ff 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Webpack plugin that renders React components to HTML files", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "test": "echo \"Error: no test specified\"" }, "repository": { "type": "git", From 35ac78e265b27811dfa5422fe1beef4dc259f459 Mon Sep 17 00:00:00 2001 From: Bang Wu Date: Mon, 21 Nov 2016 17:06:39 +0800 Subject: [PATCH 4/7] fix the travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 08dc2f4..2967ecb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ deploy: secure: D+66esLlGtDv3AYF2tGsbKu+7DYxS2RTSd1qvDruPpaq093LlFYK3OaiY1BonAJgJypApFfBAje15RUJpWuMJc0Lx9bPrL4I1YmZ1ar11xzpq8xwHpZctlvfZcRnB3N4MhF2wNiKifgSvF6pfMYcjRVHxxBHxGBUSyfQBTz5sJH+z5j3XVeyP1/ycpTu7resp0ijHC8hN0JdGsY6ky3VbDES3wiYHztFkgLcWrVtha8khv91aZGT+JztWpXIeF/3j382YMMCERMKO5ogtDhonM/gPYoS1MIFzE7KPGTFuP3CX6oVbe4GyxdIzXCBCiTqYac8JAceBenYt1MhjIMzr+PrF+I7z8hfzdWiBXkQyaZDJncPO39fhczUBFJdHSXBHFXzTvK1U0G+piD3rPZf1sYdLQ2FQiih6gte7mBZpMY7jSR4elS/Ld+Hr2ZodFR3vVxMm4+/tslSSknndHyWftq/jGJyLjwgxS9t0SJVENQlCVHRihAyaOAr3m0SHh6vRW+VjBV0ebeOLN5q7LtA0ET26+iOY4EbsLBXv5KxSXoFv15v3OVtBfh7rV2UfMxnYigob4Tq8FIzMjmn1y6a63qU8aCMZaWCO2rEQNQzdNPumMXe5drfczAFX6/k/xZFeJkiZVPiYPsDf4w+M56bfj/+nMwb18Gb0UiGa/oDKI0= on: tags: true - repo: bangwu/webpack-plugin-react-to-html + repo: bangwu/react-to-html-webpack-plugin From 9328a51a6edd3c17501fa1850a9424eff148e301 Mon Sep 17 00:00:00 2001 From: Bang Wu Date: Mon, 21 Nov 2016 17:18:20 +0800 Subject: [PATCH 5/7] change the security key --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2967ecb..37e7528 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,12 @@ language: node_js node_js: - - "6" - - "5.11" +- '6' +- '5.11' deploy: provider: npm email: ohwubang@gmail.com api_key: - secure: D+66esLlGtDv3AYF2tGsbKu+7DYxS2RTSd1qvDruPpaq093LlFYK3OaiY1BonAJgJypApFfBAje15RUJpWuMJc0Lx9bPrL4I1YmZ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BOh6nDArQzXUjiqwNMAhF3JcAs9YQSjW2jGB+kFCSJlazCyL4+SC3E3fxvMNUJDBO67uCjgUsoZpeOwC3kLOo35hnFZk3jLWRGnQewf+vu4dbJF6W/pyIuTxf/sUF+hdTo8OLGcqpPfLM2Q/mOXpU6rKBKUPu7r0Gqi6YGQC35JQr0C73fBTzs= on: tags: true repo: bangwu/react-to-html-webpack-plugin From d55a1af216dfdad107c3011270021437a0a9f830 Mon Sep 17 00:00:00 2001 From: Bang Wu Date: Mon, 21 Nov 2016 17:24:35 +0800 Subject: [PATCH 6/7] change the readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6ffdcd6..090834d 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![npm version](https://badge.fury.io/js/webpack-plugin-react-to-html.svg)](https://badge.fury.io/js/ +[![npm version](https://badge.fury.io/js/webpack-plugin-react-to-html.svg)](https://badge.fury.io/js/) # React-to-HTML Webpack Plugin From 6b0d479eaaf53f16e4165881528cd06ed9782a68 Mon Sep 17 00:00:00 2001 From: Bang Wu Date: Mon, 21 Nov 2016 21:50:27 +0800 Subject: [PATCH 7/7] add the npm ignore file --- .npmignore | 1 + README.md | 1 + package.json | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..e623fa5 --- /dev/null +++ b/.npmignore @@ -0,0 +1 @@ +.travis.yml \ No newline at end of file diff --git a/README.md b/README.md index 090834d..b6f7bc6 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![npm version](https://badge.fury.io/js/webpack-plugin-react-to-html.svg)](https://badge.fury.io/js/) +[![npm version](https://badge.fury.io/js/polyfills-webpack-plugin.svg)](https://badge.fury.io/js/polyfills-webpack-plugin) # React-to-HTML Webpack Plugin diff --git a/package.json b/package.json index b25d2ff..19a09cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "webpack-plugin-react-to-html", - "version": "2.2.1", + "version": "2.2.2", "description": "Webpack plugin that renders React components to HTML files", "main": "index.js", "scripts": {