Skip to content

Commit 9b2255f

Browse files
committed
updated to use react 0.13.2
1 parent ca8d203 commit 9b2255f

File tree

7 files changed

+19623
-66
lines changed

7 files changed

+19623
-66
lines changed

package.js

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,50 @@
1-
var meteorVersion = '1.0.3.1';
2-
var reactVersion = '0.12.2';
3-
var reactAddonsVersion = '0.9.0';
1+
var meteorVersion = '1.1.0.2',
2+
reactVersion = '0.13.2'
43

54
Package.describe({
6-
name: 'hipertracker:reactjs',
7-
summary: 'ReactJS + addons + JSX (--harmony) for Meteor',
8-
version: '0.0.8',
9-
git: 'https://github.com/hipertracker/meteor-reactjs.git'
10-
});
5+
name: 'rkstar:reactjs',
6+
summary: 'ReactJS + addons + JSX (--harmony) for Meteor',
7+
version: '0.0.9',
8+
git: 'https://github.com/rkstar/meteor-reactjs'
9+
})
1110

1211
Package._transitional_registerBuildPlugin({
13-
name: 'compileJSX',
14-
use: [],
15-
sources: [
16-
'plugin/compile-jsx.js'
17-
],
18-
npmDependencies: {
19-
'react': reactVersion,
20-
'react-tools': reactVersion
21-
}
22-
});
12+
name: 'compileJSX',
13+
use: [],
14+
sources: [
15+
'plugin/compile-jsx.js'
16+
],
17+
npmDependencies: {
18+
'react': reactVersion,
19+
'react-tools': reactVersion
20+
}
21+
})
2322

2423

2524
Package.onTest(function (api) {
26-
api.use('tinytest');
27-
api.use('hipertracker:reactjs');
28-
api.addFiles('hipertracker:reactjs-tests.js');
29-
});
25+
api.use('tinytest')
26+
api.use('rkstar:reactjs')
27+
api.addFiles('rkstar:reactjs-tests.js')
28+
})
3029

3130

3231
Package.on_use(function (api) {
33-
api.versionsFrom(meteorVersion);
32+
api.versionsFrom(meteorVersion)
3433

35-
// Standard distribution of React, same version as react-tools.
36-
api.add_files('vendor/react-' + reactVersion + '.js', 'client');
34+
// Standard distribution of React, same version as react-tools.
35+
api.add_files('vendor/react-' + reactVersion + '.js', 'client')
3736

38-
// On the server, we use the modules that ship with react.
39-
api.add_files('src/require-packages.js', 'server');
40-
api.export('React', 'server');
37+
// On the server, we use the modules that ship with react.
38+
api.add_files('src/require-packages.js', 'server')
39+
api.export('React', 'server')
4140

42-
// Meteor-enabled components should include this mixin via
43-
// React.createClass({ mixins: [ReactMeteor.Mixin], ... }).
44-
api.add_files('src/ReactMeteor.js', ['server', 'client']);
45-
api.export('ReactMeteor', ['server', 'client']);
46-
});
41+
// Meteor-enabled components should include this mixin via
42+
// React.createClass({ mixins: [ReactMeteor.Mixin], ... }).
43+
api.add_files('src/ReactMeteor.js', ['server', 'client'])
44+
api.export('ReactMeteor', ['server', 'client'])
45+
})
4746

4847

4948
Npm.depends({
50-
'react': reactVersion,
51-
'react-addons': reactAddonsVersion
52-
});
49+
'react': reactVersion
50+
})

plugin/compile-jsx.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
var reactTools = Npm.require('react-tools');
1+
var reactTools = Npm.require('react-tools')
22

3-
var handler = function (compileStep) {
4-
var source = compileStep.read().toString('utf8');
5-
var outputFile = compileStep.inputPath + '.js';
3+
var handler = function( compileStep ){
4+
var source = compileStep.read().toString('utf8')
5+
var outputFile = compileStep.inputPath + '.js'
66

77
compileStep.addJavaScript({
88
path: outputFile,
99
sourcePath: compileStep.inputPath,
1010
data: reactTools.transform(source, {harmony: true, sourceMap: true})
11-
});
12-
};
13-
14-
Plugin.registerSourceHandler('jsx', handler);
11+
})
12+
}
1513

14+
Plugin.registerSourceHandler('jsx', handler)

src/ReactMeteor.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,38 @@
11
var ReactMeteorMixin = {
22
_handleMeteorChange: function () {
33
if( this.getMeteorState !== undefined ){
4-
this.setState(this.getMeteorState());
4+
this.setState(this.getMeteorState())
55
}
66
},
77

8-
_cancelComputation: function () {
9-
if (this._meteorComputation) {
10-
this._meteorComputation.stop();
11-
this._meteorComputation = null;
8+
_cancelComputation: function(){
9+
if( this._meteorComputation ){
10+
this._meteorComputation.stop()
11+
this._meteorComputation = null
1212
}
1313
},
1414

15-
componentWillMount: function () {
16-
this._meteorComputation = Tracker.autorun(this._handleMeteorChange);
15+
componentWillMount: function(){
16+
this._meteorComputation = Tracker.autorun(this._handleMeteorChange)
1717
},
1818

19-
componentWillReceiveProps: function (nextProps) {
20-
var oldProps = this.props;
21-
this.props = nextProps;
22-
this._handleMeteorChange();
23-
this.props = oldProps;
19+
componentWillReceiveProps: function( nextProps ){
20+
var oldProps = this.props
21+
this.props = nextProps
22+
this._handleMeteorChange()
23+
this.props = oldProps
2424
},
2525

26-
componentWillUnmount: function () {
27-
this._cancelComputation();
26+
componentWillUnmount: function(){
27+
this._cancelComputation()
2828
}
29-
};
29+
}
3030

3131

32-
if (typeof exports === "object") {
33-
ReactMeteor = exports;
32+
if( typeof exports === "object" ){
33+
ReactMeteor = exports
3434
} else {
35-
ReactMeteor = {};
35+
ReactMeteor = {}
3636
}
3737

38-
ReactMeteor.Mixin = ReactMeteorMixin;
39-
38+
ReactMeteor.Mixin = ReactMeteorMixin

src/require-packages.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
React = Npm.require('react');
2-
React.addons = Npm.require('react-addons');
1+
React = Npm.require('react')

0 commit comments

Comments
 (0)