react_on_rails 6.1.2 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -3
- data/KUDOS.md +13 -0
- data/PROJECTS.md +8 -1
- data/README.md +11 -6
- data/docs/additional-reading/heroku-deployment.md +1 -1
- data/docs/additional-reading/hot-reloading-rails-development.md +1 -1
- data/docs/additional-reading/rspec-configuration.md +1 -1
- data/docs/additional-reading/turbolinks.md +5 -0
- data/docs/basics/installation-overview.md +2 -2
- data/lib/generators/react_on_rails/base_generator.rb +5 -5
- data/lib/generators/react_on_rails/react_no_redux_generator.rb +1 -1
- data/lib/generators/react_on_rails/react_with_redux_generator.rb +1 -2
- data/lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt +1 -1
- data/lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/components/HelloWorld.jsx.tt +29 -0
- data/lib/generators/react_on_rails/templates/base/base/client/package.json.tt +3 -10
- data/lib/generators/react_on_rails/templates/base/base/package.json.tt +1 -0
- data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/{HelloWorld.jsx → HelloWorldContainer.jsx} +4 -6
- data/lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt +2 -2
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/actions/helloWorldActionCreators.jsx +7 -7
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/constants/helloWorldConstants.jsx +2 -12
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/containers/HelloWorldContainer.jsx +13 -0
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx +12 -16
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt +7 -11
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/store/helloWorldStore.jsx +6 -30
- data/lib/react_on_rails/version.rb +1 -1
- data/package.json +1 -1
- data/yarn.lock +4254 -0
- metadata +6 -6
- data/lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/components/HelloWorldWidget.jsx.tt +0 -42
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/containers/HelloWorld.jsx +0 -42
- data/lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/index.jsx +0 -13
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: react_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Gordon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|
@@ -380,7 +380,7 @@ files:
|
|
380
380
|
- lib/generators/react_on_rails/templates/base/base/app/views/hello_world/index.html.erb.tt
|
381
381
|
- lib/generators/react_on_rails/templates/base/base/client/.babelrc
|
382
382
|
- lib/generators/react_on_rails/templates/base/base/client/REACT_ON_RAILS_CLIENT_README.md
|
383
|
-
- lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/components/
|
383
|
+
- lib/generators/react_on_rails/templates/base/base/client/app/bundles/HelloWorld/components/HelloWorld.jsx.tt
|
384
384
|
- lib/generators/react_on_rails/templates/base/base/client/package.json.tt
|
385
385
|
- lib/generators/react_on_rails/templates/base/base/client/webpack.config.js
|
386
386
|
- lib/generators/react_on_rails/templates/base/base/config/initializers/react_on_rails.rb.tt
|
@@ -390,15 +390,14 @@ files:
|
|
390
390
|
- lib/generators/react_on_rails/templates/dev_tests/spec/rails_helper.rb
|
391
391
|
- lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb
|
392
392
|
- lib/generators/react_on_rails/templates/dev_tests/spec/spec_helper.rb
|
393
|
-
- lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/
|
393
|
+
- lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/containers/HelloWorldContainer.jsx
|
394
394
|
- lib/generators/react_on_rails/templates/no_redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt
|
395
395
|
- lib/generators/react_on_rails/templates/node/base/client/node/package.json
|
396
396
|
- lib/generators/react_on_rails/templates/node/base/client/node/server.js
|
397
397
|
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/actions/helloWorldActionCreators.jsx
|
398
398
|
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/constants/helloWorldConstants.jsx
|
399
|
-
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/containers/
|
399
|
+
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/containers/HelloWorldContainer.jsx
|
400
400
|
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
|
401
|
-
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/index.jsx
|
402
401
|
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/startup/HelloWorldApp.jsx.tt
|
403
402
|
- lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/store/helloWorldStore.jsx
|
404
403
|
- lib/react_on_rails.rb
|
@@ -440,6 +439,7 @@ files:
|
|
440
439
|
- script/release
|
441
440
|
- script/setup
|
442
441
|
- script/test
|
442
|
+
- yarn.lock
|
443
443
|
homepage: https://github.com/shakacode/react_on_rails
|
444
444
|
licenses:
|
445
445
|
- MIT
|
@@ -1,42 +0,0 @@
|
|
1
|
-
// HelloWorldWidget is an arbitrary name for any "dumb" component. We do not recommend suffixing
|
2
|
-
// all your dumb component names with Widget.
|
3
|
-
|
4
|
-
import React, { PropTypes } from 'react';
|
5
|
-
|
6
|
-
// Simple example of a React "dumb" component
|
7
|
-
export default class HelloWorldWidget extends React.Component {
|
8
|
-
static propTypes = {
|
9
|
-
// If you have lots of data or action properties, you should consider grouping them by
|
10
|
-
// passing two properties: "data" and "actions".
|
11
|
-
updateName: PropTypes.func.isRequired,
|
12
|
-
name: PropTypes.string.isRequired,
|
13
|
-
};
|
14
|
-
|
15
|
-
// React will automatically provide us with the event `e`
|
16
|
-
handleChange(e) {
|
17
|
-
const name = e.target.value;
|
18
|
-
this.props.updateName(name);
|
19
|
-
}
|
20
|
-
|
21
|
-
render() {
|
22
|
-
const { name } = this.props;
|
23
|
-
return (
|
24
|
-
<div className="container">
|
25
|
-
<h3>
|
26
|
-
Hello, {name}!
|
27
|
-
</h3>
|
28
|
-
<hr />
|
29
|
-
<form className="form-horizontal">
|
30
|
-
<label>
|
31
|
-
Say hello to:
|
32
|
-
</label>
|
33
|
-
<input
|
34
|
-
type="text"
|
35
|
-
value={name}
|
36
|
-
onChange={e => this.handleChange(e)}
|
37
|
-
/>
|
38
|
-
</form>
|
39
|
-
</div>
|
40
|
-
);
|
41
|
-
}
|
42
|
-
}
|
@@ -1,42 +0,0 @@
|
|
1
|
-
import React, { PropTypes } from 'react';
|
2
|
-
import HelloWorldWidget from '../components/HelloWorldWidget';
|
3
|
-
import { connect } from 'react-redux';
|
4
|
-
import { bindActionCreators } from 'redux';
|
5
|
-
import Immutable from 'immutable';
|
6
|
-
import * as helloWorldActionCreators from '../actions/helloWorldActionCreators';
|
7
|
-
|
8
|
-
function select(state) {
|
9
|
-
// Which part of the Redux global state does our component want to receive as props?
|
10
|
-
// Note the use of `$$` to prefix the property name because the value is of type Immutable.js
|
11
|
-
return { $$helloWorldStore: state.$$helloWorldStore };
|
12
|
-
}
|
13
|
-
|
14
|
-
// Simple example of a React "smart" component
|
15
|
-
const HelloWorld = (props) => {
|
16
|
-
const { dispatch, $$helloWorldStore } = props;
|
17
|
-
const actions = bindActionCreators(helloWorldActionCreators, dispatch);
|
18
|
-
const { updateName } = actions;
|
19
|
-
const name = $$helloWorldStore.get('name');
|
20
|
-
|
21
|
-
// This uses the ES2015 spread operator to pass properties as it is more DRY
|
22
|
-
// This is equivalent to:
|
23
|
-
// <HelloWorldWidget $$helloWorldStore={$$helloWorldStore} actions={actions} />
|
24
|
-
return (
|
25
|
-
<HelloWorldWidget {...{ updateName, name }} />
|
26
|
-
);
|
27
|
-
};
|
28
|
-
|
29
|
-
HelloWorld.propTypes = {
|
30
|
-
dispatch: PropTypes.func.isRequired,
|
31
|
-
|
32
|
-
// This corresponds to the value used in function select above.
|
33
|
-
// We prefix all property and variable names pointing to Immutable.js objects with '$$'.
|
34
|
-
// This allows us to immediately know we don't call $$helloWorldStore['someProperty'], but
|
35
|
-
// instead use the Immutable.js `get` API for Immutable.Map
|
36
|
-
$$helloWorldStore: PropTypes.instanceOf(Immutable.Map).isRequired,
|
37
|
-
};
|
38
|
-
|
39
|
-
// Don't forget to actually use connect!
|
40
|
-
// Note that we don't export HelloWorld, but the redux "connected" version of it.
|
41
|
-
// See https://github.com/reactjs/react-redux/blob/master/docs/api.md#examples
|
42
|
-
export default connect(select)(HelloWorld);
|
@@ -1,13 +0,0 @@
|
|
1
|
-
// This file is our manifest of all reducers for the app.
|
2
|
-
// See also /client/app/bundles/HelloWorld/store/helloWorldStore.jsx
|
3
|
-
// A real world app will likely have many reducers and it helps to organize them in one file.
|
4
|
-
import helloWorldReducer from './helloWorldReducer';
|
5
|
-
import { $$initialState as $$helloWorldState } from './helloWorldReducer';
|
6
|
-
|
7
|
-
export default {
|
8
|
-
$$helloWorldStore: helloWorldReducer,
|
9
|
-
};
|
10
|
-
|
11
|
-
export const initialStates = {
|
12
|
-
$$helloWorldState,
|
13
|
-
};
|