react_webpack_rails 0.1.0 → 0.1.2
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 +7 -0
- data/README.md +6 -11
- data/Rakefile +1 -1
- data/bin/setup +1 -5
- data/js/src/version.js +1 -1
- data/lib/generators/react_webpack_rails/templates/webpack.config.js +1 -1
- data/lib/react_webpack_rails/version.rb +1 -1
- data/lib/react_webpack_rails/view_helpers.rb +3 -2
- data/package.json +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95002a306fa194b5eb678dca9b9837d366db9df0
|
4
|
+
data.tar.gz: e14adcbbec3aab1e87f6025718c111754fc40f96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c56369c886b81056e4d774ca417efc81f6a12cad2129b8df634c7cccb4b3f68848a43dcbf02c0d7122488c8255f13261f7be6925dd259878bf094dd6d0064fb
|
7
|
+
data.tar.gz: c7cda2c3749e953e5313ce232392906d2f7285f9b4a4dbd8e9db4f4b801c4c6c197793381f62f0f416d8ad239b7570079e3d5d099d4c4d5465b04f60232a729e
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## 0.1.2 (February 3, 2015)
|
2
|
+
* fix camelize_props
|
3
|
+
* allow camelize for AMS objects
|
4
|
+
|
5
|
+
## 0.1.1 (February 2, 2015)
|
6
|
+
* fix for hot-reload mode
|
7
|
+
|
1
8
|
## 0.1.0 (January 27, 2015)
|
2
9
|
* `config.react.camelize_props = true` will camelize `react_component` prop keys
|
3
10
|
* Babel updated to version 6
|
data/README.md
CHANGED
@@ -16,10 +16,6 @@ Execute:
|
|
16
16
|
|
17
17
|
$ bundle
|
18
18
|
|
19
|
-
Or install it yourself as:
|
20
|
-
|
21
|
-
$ gem install react_webpack_rails
|
22
|
-
|
23
19
|
Then run installation:
|
24
20
|
|
25
21
|
$ rails g react_webpack_rails:install
|
@@ -75,7 +71,7 @@ By default, `react-webpack-rails` uses Babel Stage 1 - Proposal. If you want to
|
|
75
71
|
|
76
72
|
## Usage
|
77
73
|
##### Check [docs](https://github.com/netguru/react_webpack_rails/tree/master/docs) for detailed api description.
|
78
|
-
|
74
|
+
#### to use hot-reloading add partial in your application.html.erb to `<body>`:
|
79
75
|
(it's not needed when you want to use just webpack in watch mode without hot-reloading)
|
80
76
|
```erb
|
81
77
|
<%= render 'layouts/react_hot_assets' %>
|
@@ -101,7 +97,7 @@ const element = $('#my-element');
|
|
101
97
|
renderComponent('customComponentName', {user_id: 1}, element);
|
102
98
|
```
|
103
99
|
|
104
|
-
### Development
|
100
|
+
### Development environment
|
105
101
|
Run webpack in watch mode using script:
|
106
102
|
|
107
103
|
$ npm start
|
@@ -115,7 +111,7 @@ Or manually:
|
|
115
111
|
$ webpack -w --config YOUR_CONFIG
|
116
112
|
|
117
113
|
|
118
|
-
### Production
|
114
|
+
### Production environment
|
119
115
|
Run webpack in production mode before compiling assets using script:
|
120
116
|
|
121
117
|
$ npm run build
|
@@ -127,11 +123,10 @@ or manually:
|
|
127
123
|
#### Deployment
|
128
124
|
Check [docs/deployment.md](docs/deployment.md)
|
129
125
|
|
130
|
-
##
|
131
|
-
|
132
|
-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
126
|
+
## Gem development
|
133
127
|
|
134
|
-
|
128
|
+
After checking out the repo, run `bundle exec rake setup:all` to install dependencies. Then, run `rake` to run the tests (includes gem, test app and node module).
|
129
|
+
Run `bundle exec rake -T` to check available development commands.
|
135
130
|
|
136
131
|
## Contributing
|
137
132
|
|
data/Rakefile
CHANGED
data/bin/setup
CHANGED
data/js/src/version.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export default '0.1.
|
1
|
+
export default '0.1.2';
|
@@ -11,7 +11,8 @@ module ReactWebpackRails
|
|
11
11
|
content_tag(html_tag, '', html_options, &block)
|
12
12
|
end
|
13
13
|
|
14
|
-
def react_component(name,
|
14
|
+
def react_component(name, raw_props = {}, options = { ssr: false })
|
15
|
+
props = raw_props.as_json
|
15
16
|
props = camelize_props_key(props) if Rails.application.config.react.camelize_props
|
16
17
|
react_element('react-component', { props: props, name: name }, options)
|
17
18
|
end
|
@@ -24,7 +25,7 @@ module ReactWebpackRails
|
|
24
25
|
|
25
26
|
def camelize_props_key(props)
|
26
27
|
return props unless props.is_a?(Hash)
|
27
|
-
props.
|
28
|
+
props.inject({}) do |h, (k, v)|
|
28
29
|
h[k.to_s.camelize(:lower)] = v.is_a?(Hash) ? camelize_props_key(v) : v
|
29
30
|
h
|
30
31
|
end
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: react_webpack_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rafał Gawlik
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-02-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|