Skip to content

Commit 2250175

Browse files
committed
Don't use JSX. Updated dependencies. React 0.13 compatible.
1 parent a586f97 commit 2250175

9 files changed

+25
-18
lines changed

package.json

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "react-inline-css",
33
"description": "Inline CSS in your React components, namespaced automatically.",
4-
"version": "1.0.2",
4+
"version": "1.1.0",
55
"license": "BSD-3",
66
"repository": {
77
"type": "git",
@@ -11,24 +11,26 @@
1111
"keywords": [
1212
"react",
1313
"inline",
14-
"css"
14+
"css",
15+
"react-component"
1516
],
1617
"main": "src/react-inline-css",
1718
"scripts": {
18-
"start": "eval 'webpack-dev-server --config webpack.client-watch.js >tmp/server.log 2>&1 & SERVER_PID=$!'; sleep 1; open http://localhost:8080; tail -f tmp/*.log; kill $SERVER_PID;",
19-
"build": "webpack -cv --display-error-details --config webpack.client.js",
20-
"watch-client": "webpack -cv --display-error-details --config webpack.client-watch.js",
21-
"watch": "eval 'npm run watch-client >tmp/client.log 2>&1 & CLIENT_PID=$!'; sleep 3; npm run start; kill $CLIENT_PID;"
19+
"localhost": "sleep 2; which open && open http://localhost:8080",
20+
"build": "webpack --verbose --colors --display-error-details --config webpack.client.js",
21+
"watch-client": "webpack --verbose --colors --display-error-details --config webpack.client-watch.js && webpack-dev-server --config webpack.client-watch.js",
22+
"watch": "concurrent --kill-others 'npm run watch-client' 'npm run localhost'"
2223
},
2324
"dependencies": {
24-
"react": "^0.12.2"
25+
"react": ">= 0.12.0"
2526
},
2627
"devDependencies": {
27-
"babel-core": "4.7.1",
28-
"babel-loader": "4.1.0",
28+
"babel-core": "4.7.12",
29+
"babel-loader": "4.2.0",
30+
"concurrently": "0.0.5",
2931
"json-loader": "0.5.1",
30-
"react-hot-loader": "1.1.7",
31-
"webpack": "1.7.2",
32+
"react-hot-loader": "1.2.3",
33+
"webpack": "1.7.3",
3234
"webpack-dev-server": "1.7.0"
3335
}
3436
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

src/react-inline-css.jsx renamed to src/react-inline-css.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var refCounter = 0;
66
* @module InlineCss
77
*/
88
var InlineCss = React.createClass({
9-
displayName: 'InlineCss',
9+
displayName: "InlineCss",
1010
propTypes: {
1111
stylesheet: React.PropTypes.string.isRequired,
1212
namespace: React.PropTypes.string,
@@ -27,10 +27,15 @@ var InlineCss = React.createClass({
2727
var namespace = this.props.namespace || "InlineCss-" + refCounter++;
2828
var transformedSheet = this._transformSheet(this.props.stylesheet, namespace);
2929

30-
return <Wrapper id={namespace}>
31-
{this.props.children}
32-
<style scoped dangerouslySetInnerHTML={{__html: transformedSheet}} />
33-
</Wrapper>;
30+
return React.createElement(
31+
Wrapper,
32+
{id: namespace},
33+
this.props.children,
34+
React.createElement("style", {
35+
scoped: true,
36+
dangerouslySetInnerHTML: {__html: transformedSheet}
37+
})
38+
);
3439
}
3540
});
3641

webpack.client-watch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ config.entry.unshift(
1313
config.module = {
1414
loaders: [
1515
{include: /\.json$/, loaders: ["json-loader"]},
16-
{include: /\.jsx?$/, loaders: ["react-hot", "babel-loader"], exclude: /node_modules/}
16+
{include: /\.js$/, loaders: ["react-hot", "babel-loader"], exclude: /node_modules/}
1717
]
1818
};
1919

webpack.client.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ module.exports = {
2222
module: {
2323
loaders: [
2424
{include: /\.json$/, loaders: ["json-loader"]},
25-
{include: /\.jsx?$/, loaders: ["babel-loader"], exclude: /node_modules/}
25+
{include: /\.js$/, loaders: ["babel-loader"], exclude: /node_modules/}
2626
]
2727
},
2828
resolve: {

0 commit comments

Comments
 (0)