Skip to content

Commit

Permalink
Update to use react 0.14-rc1. bump version to 0.1.0
Browse files Browse the repository at this point in the history
(cherry picked from commit 12cf6fe)
  • Loading branch information
gianu authored and denis-sokolov committed Jun 9, 2017
1 parent 591ca18 commit 31843a2
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 17 deletions.
6 changes: 6 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
node_modules/
public/
.DS_Store
bin
client
gulpfile.js
2 changes: 1 addition & 1 deletion client/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2>Usage</h2>
<p>The Original jQuery Plugin is brought to you by <a href="http://paravelinc.com">Paravel</a></p>
</footer>
</div>
<script type="text/javascript" src="{%=o.htmlWebpackPlugin.assets.main%}" async></script>
<script type="text/javascript" src="{%=o.htmlWebpackPlugin.files.chunks['app'].entry%}" async></script>
<script src="assets/prism.js"></script>
</body>
</html>
3 changes: 2 additions & 1 deletion client/scripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require("../styles/index.styl");

var React = require("react");
var ReactDOM = require("react-dom");
var ReactFitText = require('../../lib/ReactFitText');

var Body = React.createClass({
Expand All @@ -23,4 +24,4 @@ var Body = React.createClass({
});


React.render(<Body />, document.querySelector('.js-fittext'));
ReactDOM.render(<Body />, document.querySelector('.js-fittext'));
16 changes: 12 additions & 4 deletions client/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
var Path = require("path"),
webpack = require("webpack"),
HtmlWebpackPlugin = require("html-webpack-plugin"),
nib = require("nib"),
webpackConfig,

IS_PRODUCTION = "production" === process.env.NODE_ENV,
JSX_WITH_HOT_LOEADERS = ["react-hot-loader", "jsx-loader?harmony"],
JSX_WITH_HOT_LOEADERS = ["react-hot-loader", "babel-loader?optional=runtime"],
CSS_LOADER = "style-loader!css-loader?root=../",

webpackConfig = module.exports = {
entry: "./client/scripts/index.js",
entry: {
app: [
"./client/scripts/index.js"
]
},
output: {
path: Path.resolve(__dirname, "../public/assets"),
publicPath: "assets/",
Expand All @@ -18,7 +23,7 @@ webpackConfig = module.exports = {
module: {
loaders: [
{ test: require.resolve("react/addons"), loader: "expose-loader?React" },
{ test: /\.js(x?)$/, loaders: JSX_WITH_HOT_LOEADERS },
{ test: /\.js(x?)$/, include: [/lib/, /client/], exclude: [/node_modules/], loaders: JSX_WITH_HOT_LOEADERS },
{ test: /\.jpg$/, loader: "file-loader" },
{ test: /\.png$/, loader: "url-loader?prefix=/public/&limit=10000&mimetype=image/png"},
{ test: /\.css$/, loader: CSS_LOADER },
Expand All @@ -30,7 +35,10 @@ webpackConfig = module.exports = {
template: "./client/index.html",
filename: "../index.html"
})
]
],
stylus: {
use: [nib()]
}
};

if (IS_PRODUCTION) {
Expand Down
3 changes: 2 additions & 1 deletion lib/ReactFitText.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
'use strict';

var React = require('react');
var ReactDOM = require('react-dom');
var ReactPropTypes = React.PropTypes;

module.exports = React.createClass({
Expand Down Expand Up @@ -40,7 +41,7 @@ module.exports = React.createClass({
},

_onBodyResize: function() {
var element = this._childRef;
var element = ReactDOM.findDOMNode(this);
var width = element.offsetWidth;
element.style.fontSize = Math.max(
Math.min((width / (this.props.compressor*10)),
Expand Down
23 changes: 13 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-fittext",
"version": "0.0.5",
"version": "0.1.0",
"description": "A React plugin to fit the text in the screen",
"main": "lib/ReactFitText.js",
"scripts": {
Expand Down Expand Up @@ -29,29 +29,32 @@
},
"homepage": "http://softwarepsychonaut.com/react-fittext",
"devDependencies": {
"babel": "^5.8.23",
"babel-core": "^5.8.25",
"babel-loader": "^5.3.2",
"babel-runtime": "^5.8.24",
"css-loader": "^0.9.0",
"expose-loader": "^0.5.3",
"file-loader": "^0.8.1",
"gulp": "~3.8.5",
"gulp-jshint": "^1.9.0",
"gulp-react": "^2.0.0",
"gulp-util": "^3.0.1",
"html-webpack-plugin": "^1.1.0",
"html-webpack-plugin": "^1.6.1",
"jest-cli": "^0.1.18",
"jsx-loader": "^0.12.1",
"nib": "^1.0.4",
"react-hot-loader": "^0.5.0",
"react-tools": "^0.12.0",
"nib": "^1.1.0",
"react-hot-loader": "^1.3.0",
"run-sequence": "^1.0.2",
"sass-loader": "^0.3.0",
"style-loader": "^0.8.1",
"stylus": "^0.49.3",
"stylus-loader": "^0.5.0",
"style-loader": "^0.12.4",
"stylus": "^0.52.4",
"stylus-loader": "^1.3.0",
"url-loader": "^0.5.5",
"webpack": "^1.4.7",
"webpack-dev-server": "^1.6.5"
},
"peerDependencies": {
"react": "~0.13.x"
"react": "^0.14.0-rc1",
"react-dom": "^0.14.0-rc1"
}
}

0 comments on commit 31843a2

Please sign in to comment.