Skip to content

Commit a0f939c

Browse files
committedJan 27, 2016
Merge pull request shakacode#213 from shakacode/update-to-2-1-0
Update to 2.1.0
2 parents f8f454d + 9f4ccf9 commit a0f939c

14 files changed

+544
-635
lines changed
 

‎Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ gem "sdoc", group: :doc
3737
# Use Rails Html Sanitizer for HTML sanitization
3838
gem "rails-html-sanitizer"
3939

40-
gem "react_on_rails", "2.0.0"
40+
gem "react_on_rails"
4141

4242
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
4343
gem "therubyracer"

‎Gemfile.lock

+69-71
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actionmailer (4.2.5)
5-
actionpack (= 4.2.5)
6-
actionview (= 4.2.5)
7-
activejob (= 4.2.5)
4+
actionmailer (4.2.5.1)
5+
actionpack (= 4.2.5.1)
6+
actionview (= 4.2.5.1)
7+
activejob (= 4.2.5.1)
88
mail (~> 2.5, >= 2.5.4)
99
rails-dom-testing (~> 1.0, >= 1.0.5)
10-
actionpack (4.2.5)
11-
actionview (= 4.2.5)
12-
activesupport (= 4.2.5)
10+
actionpack (4.2.5.1)
11+
actionview (= 4.2.5.1)
12+
activesupport (= 4.2.5.1)
1313
rack (~> 1.6)
1414
rack-test (~> 0.6.2)
1515
rails-dom-testing (~> 1.0, >= 1.0.5)
1616
rails-html-sanitizer (~> 1.0, >= 1.0.2)
17-
actionview (4.2.5)
18-
activesupport (= 4.2.5)
17+
actionview (4.2.5.1)
18+
activesupport (= 4.2.5.1)
1919
builder (~> 3.1)
2020
erubis (~> 2.7.0)
2121
rails-dom-testing (~> 1.0, >= 1.0.5)
2222
rails-html-sanitizer (~> 1.0, >= 1.0.2)
23-
activejob (4.2.5)
24-
activesupport (= 4.2.5)
23+
activejob (4.2.5.1)
24+
activesupport (= 4.2.5.1)
2525
globalid (>= 0.3.0)
26-
activemodel (4.2.5)
27-
activesupport (= 4.2.5)
26+
activemodel (4.2.5.1)
27+
activesupport (= 4.2.5.1)
2828
builder (~> 3.1)
29-
activerecord (4.2.5)
30-
activemodel (= 4.2.5)
31-
activesupport (= 4.2.5)
29+
activerecord (4.2.5.1)
30+
activemodel (= 4.2.5.1)
31+
activesupport (= 4.2.5.1)
3232
arel (~> 6.0)
33-
activesupport (4.2.5)
33+
activesupport (4.2.5.1)
3434
i18n (~> 0.7)
3535
json (~> 1.7, >= 1.7.7)
3636
minitest (~> 5.1)
@@ -40,16 +40,14 @@ GEM
4040
archive-zip (0.7.0)
4141
io-like (~> 0.3.0)
4242
arel (6.0.3)
43-
ast (2.1.0)
44-
astrolabe (1.3.1)
45-
parser (~> 2.2)
46-
autoprefixer-rails (6.1.2)
43+
ast (2.2.0)
44+
autoprefixer-rails (6.3.1)
4745
execjs
4846
json
4947
awesome_print (1.6.1)
5048
binding_of_caller (0.7.2)
5149
debug_inspector (>= 0.0.1)
52-
brakeman (3.1.3)
50+
brakeman (3.1.4)
5351
erubis (~> 2.6)
5452
fastercsv (~> 1.5)
5553
haml (>= 3.0, < 5.0)
@@ -66,7 +64,8 @@ GEM
6664
bundler (~> 1.2)
6765
thor (~> 0.18)
6866
byebug (8.2.1)
69-
capybara (2.5.0)
67+
capybara (2.6.0)
68+
addressable
7069
mime-types (>= 1.16)
7170
nokogiri (>= 1.3.3)
7271
rack (>= 1.0.0)
@@ -75,15 +74,15 @@ GEM
7574
capybara-screenshot (1.0.11)
7675
capybara (>= 1.0, < 3)
7776
launchy
78-
childprocess (0.5.8)
77+
childprocess (0.5.9)
7978
ffi (~> 1.0, >= 1.0.11)
8079
chromedriver-helper (1.0.0)
8180
archive-zip (~> 0.7.0)
8281
nokogiri (~> 1.6)
8382
coderay (1.1.0)
84-
coffee-rails (4.1.0)
83+
coffee-rails (4.1.1)
8584
coffee-script (>= 2.2.0)
86-
railties (>= 4.0.0, < 5.0)
85+
railties (>= 4.0.0, < 5.1.x)
8786
coffee-script (2.4.1)
8887
coffee-script-source
8988
execjs
@@ -124,8 +123,8 @@ GEM
124123
i18n (0.7.0)
125124
interception (0.5)
126125
io-like (0.3.0)
127-
jbuilder (2.3.2)
128-
activesupport (>= 3.0.0, < 5)
126+
jbuilder (2.4.0)
127+
activesupport (>= 3.0.0, < 5.1)
129128
multi_json (~> 1.2)
130129
json (1.8.3)
131130
launchy (2.4.3)
@@ -138,13 +137,13 @@ GEM
138137
method_source (0.8.2)
139138
mime-types (2.99)
140139
mini_portile2 (2.0.0)
141-
minitest (5.8.3)
140+
minitest (5.8.4)
142141
multi_json (1.11.2)
143142
netrc (0.11.0)
144-
nokogiri (1.6.7)
143+
nokogiri (1.6.7.2)
145144
mini_portile2 (~> 2.0.0.rc2)
146-
parser (2.2.3.0)
147-
ast (>= 1.1, < 3.0)
145+
parser (2.3.0.2)
146+
ast (~> 2.2)
148147
pg (0.18.4)
149148
powerpack (0.1.1)
150149
pry (0.10.3)
@@ -169,57 +168,58 @@ GEM
169168
rack (1.6.4)
170169
rack-test (0.6.3)
171170
rack (>= 1.0)
172-
rails (4.2.5)
173-
actionmailer (= 4.2.5)
174-
actionpack (= 4.2.5)
175-
actionview (= 4.2.5)
176-
activejob (= 4.2.5)
177-
activemodel (= 4.2.5)
178-
activerecord (= 4.2.5)
179-
activesupport (= 4.2.5)
171+
rails (4.2.5.1)
172+
actionmailer (= 4.2.5.1)
173+
actionpack (= 4.2.5.1)
174+
actionview (= 4.2.5.1)
175+
activejob (= 4.2.5.1)
176+
activemodel (= 4.2.5.1)
177+
activerecord (= 4.2.5.1)
178+
activesupport (= 4.2.5.1)
180179
bundler (>= 1.3.0, < 2.0)
181-
railties (= 4.2.5)
180+
railties (= 4.2.5.1)
182181
sprockets-rails
183182
rails-deprecated_sanitizer (1.0.3)
184183
activesupport (>= 4.2.0.alpha)
185184
rails-dom-testing (1.0.7)
186185
activesupport (>= 4.2.0.beta, < 5.0)
187186
nokogiri (~> 1.6.0)
188187
rails-deprecated_sanitizer (>= 1.0.1)
189-
rails-html-sanitizer (1.0.2)
188+
rails-html-sanitizer (1.0.3)
190189
loofah (~> 2.0)
191190
rails_12factor (0.0.3)
192191
rails_serve_static_assets
193192
rails_stdout_logging
194193
rails_serve_static_assets (0.0.4)
195194
rails_stdout_logging (0.0.4)
196-
railties (4.2.5)
197-
actionpack (= 4.2.5)
198-
activesupport (= 4.2.5)
195+
railties (4.2.5.1)
196+
actionpack (= 4.2.5.1)
197+
activesupport (= 4.2.5.1)
199198
rake (>= 0.8.7)
200199
thor (>= 0.18.1, < 2.0)
201-
rainbow (2.0.0)
202-
rake (10.4.2)
203-
rdoc (4.2.0)
204-
react_on_rails (2.0.0)
200+
rainbow (2.1.0)
201+
rake (10.5.0)
202+
rdoc (4.2.1)
203+
json (~> 1.4)
204+
react_on_rails (2.1.0)
205205
connection_pool
206206
execjs (~> 2.5)
207207
rails (>= 3.2)
208-
rainbow (~> 2.0)
208+
rainbow (~> 2.1)
209209
ref (2.0.0)
210210
rest-client (1.8.0)
211211
http-cookie (>= 1.0.2, < 2.0)
212212
mime-types (>= 1.16, < 3.0)
213213
netrc (~> 0.7)
214-
rspec-core (3.4.1)
214+
rspec-core (3.4.2)
215215
rspec-support (~> 3.4.0)
216216
rspec-expectations (3.4.0)
217217
diff-lcs (>= 1.2.0, < 2.0)
218218
rspec-support (~> 3.4.0)
219-
rspec-mocks (3.4.0)
219+
rspec-mocks (3.4.1)
220220
diff-lcs (>= 1.2.0, < 2.0)
221221
rspec-support (~> 3.4.0)
222-
rspec-rails (3.4.0)
222+
rspec-rails (3.4.1)
223223
actionpack (>= 3.0, < 4.3)
224224
activesupport (>= 3.0, < 4.3)
225225
railties (>= 3.0, < 4.3)
@@ -230,43 +230,41 @@ GEM
230230
rspec-retry (0.4.5)
231231
rspec-core
232232
rspec-support (3.4.1)
233-
rubocop (0.35.1)
234-
astrolabe (~> 1.3)
235-
parser (>= 2.2.3.0, < 3.0)
233+
rubocop (0.36.0)
234+
parser (>= 2.3.0.0, < 3.0)
236235
powerpack (~> 0.1)
237236
rainbow (>= 1.99.1, < 3.0)
238237
ruby-progressbar (~> 1.7)
239-
tins (<= 1.6.0)
240-
ruby-lint (2.0.5)
238+
ruby-lint (2.1.0)
241239
parser (~> 2.2)
242240
slop (~> 3.4, >= 3.4.7)
243241
ruby-progressbar (1.7.5)
244242
ruby2ruby (2.2.0)
245243
ruby_parser (~> 3.1)
246244
sexp_processor (~> 4.0)
247-
ruby_parser (3.7.2)
245+
ruby_parser (3.7.3)
248246
sexp_processor (~> 4.1)
249247
rubyzip (1.1.7)
250248
safe_yaml (1.0.4)
251-
sass (3.4.20)
249+
sass (3.4.21)
252250
sass-rails (5.0.4)
253251
railties (>= 4.0.0, < 5.0)
254252
sass (~> 3.1)
255253
sprockets (>= 2.8, < 4.0)
256254
sprockets-rails (>= 2.0, < 4.0)
257255
tilt (>= 1.1, < 3)
258-
scss_lint (0.43.2)
259-
rainbow (~> 2.0)
256+
scss_lint (0.44.0)
257+
rake (~> 10.0)
260258
sass (~> 3.4.15)
261259
sdoc (0.4.1)
262260
json (~> 1.7, >= 1.7.7)
263261
rdoc (~> 4.0)
264-
selenium-webdriver (2.48.1)
262+
selenium-webdriver (2.49.0)
265263
childprocess (~> 0.5)
266264
multi_json (~> 1.0)
267265
rubyzip (~> 1.0)
268266
websocket (~> 1.0)
269-
sexp_processor (4.6.0)
267+
sexp_processor (4.6.1)
270268
simplecov (0.11.1)
271269
docile (~> 1.1.0)
272270
json (~> 1.8)
@@ -276,16 +274,16 @@ GEM
276274
temple (~> 0.7.3)
277275
tilt (>= 1.3.3, < 2.1)
278276
slop (3.6.0)
279-
spring (1.5.0)
277+
spring (1.6.2)
280278
spring-commands-rspec (1.0.4)
281279
spring (>= 0.9.1)
282280
sprockets (3.5.2)
283281
concurrent-ruby (~> 1.0)
284282
rack (> 1, < 3)
285-
sprockets-rails (2.3.3)
286-
actionpack (>= 3.0)
287-
activesupport (>= 3.0)
288-
sprockets (>= 2.8, < 4.0)
283+
sprockets-rails (3.0.0)
284+
actionpack (>= 4.0)
285+
activesupport (>= 4.0)
286+
sprockets (>= 3.0.0)
289287
sqlite3 (1.3.11)
290288
temple (0.7.6)
291289
term-ansicolor (1.3.2)
@@ -296,7 +294,7 @@ GEM
296294
ref
297295
thor (0.19.1)
298296
thread_safe (0.3.5)
299-
tilt (2.0.1)
297+
tilt (2.0.2)
300298
tins (1.6.0)
301299
turbolinks (2.5.3)
302300
coffee-rails
@@ -347,7 +345,7 @@ DEPENDENCIES
347345
rails-html-sanitizer
348346
rails_12factor
349347
rainbow
350-
react_on_rails (= 2.0.0)
348+
react_on_rails
351349
rspec-rails
352350
rspec-retry
353351
rubocop

‎README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
By Justin Gordon and the Shaka Code Team, [www.shakacode.com](http://www.shakacode.com)
1111

1212
- If this work interests you and you are looking for full or part-time remote work, please [click here](http://forum.shakacode.com/t/railsonmaui-is-hiring-and-partnering-part-time-remote-is-ok/156).
13-
- Please email us at [justin@shakacode.com](mailto:justin@shakacode.com) if you have a ReactJs + Rails project and are interested in help from our experienced team.
13+
- [ShakaCode](http://www.shakacode.com) is doing Skype plus Slack/Github based coaching for "React on Rails". [Click here](http://www.shakacode.com/work/index.html) for more information.
14+
- Please email us at [contact@shakacode.com](mailto:contact@shakacode.com) if you have a ReactJs + Rails project and are interested in help from our experienced team.
1415
- Please file issues for problems and feature requests.
1516
- Pull requests are welcome! (and a great way to get on the ShakaCode team)
1617
- Feel free to open discussions at [forum.shakacode.com](http://forum.shakacode.com). We love to help!
@@ -21,12 +22,12 @@ By Justin Gordon and the Shaka Code Team, [www.shakacode.com](http://www.shakaco
2122
A Full tutorial article can be found at: [Fast Rich Client Rails Development With Webpack and the ES6 Transpiler](http://www.railsonmaui.com/blog/2014/10/03/integrating-webpack-and-the-es6-transpiler-into-an-existing-rails-project/). Note, this source code repository is way ahead of the tutorial. We plan to update the tutorial article as soon as we can catch our breath!
2223

2324
# NEWS
24-
We have not yet updated the react_on_rails gem generators for the following tasks. We're looking for help to migrate this, if you're interested in contributing to the project. *The tutorial* refers to this repo. The following changes have resulted in lots of differences for the webpack files and visual assets:
25+
We have not yet updated the `react_on_rails` gem generators for the following tasks. We're looking for help to migrate this, if you're interested in contributing to the project. *The tutorial* refers to this repo. The following changes have resulted in lots of differences for the webpack files and visual assets:
2526

2627
1. **Handling of Sass and Bootstrap**: The tutorial uses CSS modules via Webpack. This is totally different than the older way of having Rails handle Sass/Bootstrap, and having NPM/Webpack handle the Webpack Dev Server. The tutorial now has NPM handle all visual assets. We are using this technique on a new app, and it's awesome!
2728
2. **Hot Reloading with Rails**: The tutorial has different startup scripts than the generators. The dev mode has the WebapackDev server providing the JS and CSS assets to the tutorial. This means you get **HOT RELOADING** of your JS and CSS within your Rails app.
2829

29-
If you did generate a fresh app from react_on_rails and want to move to CSS Modules, then see [PR 175: Babel 6 / CSS Modules / Rails hot reloading](https://github.com/shakacode/react-webpack-rails-tutorial/pull/175). Note, while there are probably fixes after this PR was accepted, this has the majority of the changes.
30+
If you did generate a fresh app from React On Rails and want to move to CSS Modules, then see [PR 175: Babel 6 / CSS Modules / Rails hot reloading](https://github.com/shakacode/react-webpack-rails-tutorial/pull/175). Note, while there are probably fixes after this PR was accepted, this has the majority of the changes.
3031

3132

3233
# Example Application

‎app/views/pages/_header.html.erb

+11
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
id: "git-commit-sha" %>
55
</p>
66
<ul>
7+
<li>
8+
<%= link_to "ShakaCode", "http://www.shakacode.com"%>
9+
is doing Skype plus Slack/Github based coaching for
10+
<%= link_to "React on Rails", "https://github.com/shakacode/react_on_rails" %>.
11+
<b><%= link_to "Click here", "http://www.shakacode.com/work/index.html" %></b> for more information.
12+
</li>
713
<li>
814
If this work interests you and you're a developer or designer looking for full or part-time remote work: please
915
visit <%= link_to "ShakaCode.com", "http://www.shakacode.com" %>,
@@ -19,5 +25,10 @@
1925
"https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/README.md" %>
2026
for details of how this example site was built.
2127
</li>
28+
<li>
29+
Be sure to read our new article
30+
<%= link_to "The React on Rails Doctrine",
31+
"http://www.shakacode.com/2016/01/26/the-react-on-rails-doctrine.html" %>.
32+
</li>
2233
</ul>
2334
<hr/>

‎client/app/bundles/comments/components/CommentBox/CommentList/CommentList.jsx

+8-9
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,17 @@ export default class CommentList extends BaseComponent {
3333

3434
render() {
3535
const { $$comments, cssTransitionGroupClassNames } = this.props;
36-
const commentNodes = $$comments.map($$comment => {
36+
const commentNodes = $$comments.map($$comment =>
37+
3738
// `key` is a React-specific concept and is not mandatory for the
3839
// purpose of this tutorial. if you're curious, see more here:
3940
// http://facebook.github.io/react/docs/multiple-components.html#dynamic-children
40-
return (
41-
<Comment
42-
key={$$comment.get('id')}
43-
author={$$comment.get('author')}
44-
text={$$comment.get('text')}
45-
/>
46-
);
47-
});
41+
<Comment
42+
key={$$comment.get('id')}
43+
author={$$comment.get('author')}
44+
text={$$comment.get('text')}
45+
/>
46+
);
4847

4948
return (
5049
<div>

‎client/npm-shrinkwrap.json

+402-467
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎client/package.json

+39-39
Original file line numberDiff line numberDiff line change
@@ -37,68 +37,68 @@
3737
"jscs": "jscs --verbose ."
3838
},
3939
"dependencies": {
40-
"autoprefixer": "^6.1.2",
41-
"axios": "^0.8.1",
42-
"babel": "^6.3.13",
43-
"babel-cli": "^6.3.17",
44-
"babel-core": "^6.3.17",
45-
"babel-loader": "^6.2.0",
40+
"autoprefixer": "^6.3.1",
41+
"axios": "^0.9.1",
42+
"babel": "^6.3.26",
43+
"babel-cli": "^6.4.5",
44+
"babel-core": "^6.4.5",
45+
"babel-loader": "^6.2.1",
4646
"babel-polyfill": "^6.3.14",
4747
"babel-preset-es2015": "^6.3.13",
4848
"babel-preset-react": "^6.3.13",
4949
"babel-preset-stage-0": "^6.3.13",
50-
"bootstrap-loader": "^1.0.0-rc",
51-
"bootstrap-sass": "^3.3.5",
52-
"css-loader": "^0.23.0",
53-
"es5-shim": "^4.3.1",
50+
"bootstrap-loader": "^1.0.7",
51+
"bootstrap-sass": "^3.3.6",
52+
"css-loader": "^0.23.1",
53+
"es5-shim": "^4.5.2",
5454
"expose-loader": "^0.7.1",
5555
"extract-text-webpack-plugin": "^1.0.1",
56-
"file-loader": "^0.8.4",
56+
"file-loader": "^0.8.5",
5757
"history": "^2.0.0-rc2",
58-
"immutable": "^3.7.5",
58+
"immutable": "^3.7.6",
5959
"imports-loader": "^0.6.5",
60-
"jquery": "^2.1.4",
60+
"jquery": "^2.2.0",
6161
"jquery-ujs": "^1.1.0-1",
62-
"loader-utils": "^0.2.11",
63-
"lodash": "^4.0.0",
62+
"loader-utils": "^0.2.12",
63+
"lodash": "^4.0.1",
6464
"marked": "^0.3.5",
6565
"node-sass": "^3.4.2",
6666
"node-uuid": "^1.4.7",
6767
"postcss-loader": "^0.8.0",
68-
"react": "^0.14.3",
69-
"react-addons-pure-render-mixin": "^0.14.3",
70-
"react-bootstrap": "^0.28.1",
71-
"react-dom": "^0.14.3",
72-
"react-on-rails": "^2.0.0",
73-
"react-redux": "^4.0.0",
74-
"react-router": "^2.0.0-rc4",
75-
"redux": "^3.0.4",
76-
"redux-promise": "^0.5.0",
77-
"redux-thunk": "^1.0.0",
68+
"react": "^0.14.6",
69+
"react-addons-pure-render-mixin": "^0.14.6",
70+
"react-bootstrap": "^0.28.2",
71+
"react-dom": "^0.14.6",
72+
"react-on-rails": "^2.1.0",
73+
"react-redux": "^4.0.6",
74+
"react-router": "^2.0.0-rc5",
75+
"redux": "^3.0.6",
76+
"redux-promise": "^0.5.1",
77+
"redux-thunk": "^1.0.3",
7878
"resolve-url-loader": "^1.4.3",
79-
"sass-loader": "^3.1.1",
80-
"sass-resources-loader": "1.0.1",
79+
"sass-loader": "^3.1.2",
80+
"sass-resources-loader": "1.0.2",
8181
"style-loader": "^0.13.0",
82-
"url-loader": "^0.5.6",
83-
"webpack": "^1.12.8"
82+
"url-loader": "^0.5.7",
83+
"webpack": "^1.12.11"
8484
},
8585
"devDependencies": {
8686
"babel-eslint": "^5.0.0-beta6",
87-
"babel-plugin-react-transform": "^2.0.0-beta1",
88-
"body-parser": "^1.14.1",
87+
"babel-plugin-react-transform": "^2.0.0",
88+
"body-parser": "^1.14.2",
8989
"chai": "^3.4.1",
9090
"chai-immutable": "^1.5.3",
9191
"eslint": "^1.10.3",
92-
"eslint-config-airbnb": "^3.0.2",
93-
"eslint-plugin-react": "^3.11.3",
94-
"express": "^4.13.3",
92+
"eslint-config-airbnb": "^4.0.0",
93+
"eslint-plugin-react": "^3.16.1",
94+
"express": "^4.13.4",
9595
"jade": "^1.11.0",
96-
"jscs": "^2.7.0",
97-
"jsdom": "^7.0.2",
98-
"mocha": "^2.3.4",
99-
"react-addons-test-utils": "^0.14.3",
96+
"jscs": "^2.9.0",
97+
"jsdom": "^7.2.2",
98+
"mocha": "^2.4.2",
99+
"react-addons-test-utils": "^0.14.6",
100100
"react-transform-hmr": "^1.0.1",
101101
"sleep": "^3.0.0",
102-
"webpack-dev-server": "^1.12.1"
102+
"webpack-dev-server": "^1.14.1"
103103
}
104104
}

‎client/server-express.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ var server = new WebpackDevServer(webpack(config), {
2828
server.app.use(bodyParser.json(null));
2929
server.app.use(bodyParser.urlencoded({ extended: true }));
3030

31-
server.app.get('/comments.json', function(req, res) {
31+
server.app.get('/comments.json', (req, res) => {
3232
sleep.sleep(1);
3333
res.setHeader('Content-Type', 'application/json');
3434
res.send(JSON.stringify(comments));
3535
});
3636

37-
server.app.post('/comments.json', function(req, res) {
37+
server.app.post('/comments.json', (req, res) => {
3838
const comment = req.body.comment;
3939
comment.id = uuid.v4();
4040

@@ -47,16 +47,16 @@ server.app.post('/comments.json', function(req, res) {
4747
res.send(JSON.stringify(comment));
4848
});
4949

50-
server.app.use('/', function(req, res) {
50+
server.app.use('/', (req, res) => {
5151
var locals = {
5252
props: JSON.stringify(comments),
5353
};
54-
var layout = process.cwd() + '/index.jade';
54+
var layout = `${process.cwd()}/index.jade`;
5555
var html = jade.compileFile(layout, { pretty: true })(locals);
5656
res.send(html);
5757
});
5858

59-
server.listen(4000, 'localhost', function(err) {
59+
server.listen(4000, 'localhost', (err) => {
6060
if (err) console.log(err);
6161
console.log('Listening at localhost:4000...');
6262
});

‎client/server-rails-hot.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const hotRailsPort = process.env.HOT_RAILS_PORT || 3500;
1010
const compiler = webpack(webpackConfig);
1111

1212
const devServer = new WebpackDevServer(compiler, {
13-
contentBase: 'http://lvh.me:' + hotRailsPort,
13+
contentBase: `http://lvh.me:${hotRailsPort}`,
1414
publicPath: webpackConfig.output.publicPath,
1515
hot: true,
1616
inline: true,
@@ -30,6 +30,6 @@ const devServer = new WebpackDevServer(compiler, {
3030
devServer.listen(3500, 'localhost', err => {
3131
if (err) console.error(err);
3232
console.log(
33-
'=> 🔥 Webpack development server is running on port ' + hotRailsPort
33+
`=> 🔥 Webpack development server is running on port ${hotRailsPort}`
3434
);
3535
});

‎client/webpack.client.express.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ config.entry.vendor.push('bootstrap-loader');
1111
config.entry.app.push(
1212

1313
// Webpack dev server
14-
'webpack-dev-server/client?http://localhost:' + hotPort,
14+
`webpack-dev-server/client?http://localhost:${hotPort}`,
1515
'webpack/hot/dev-server'
1616
);
1717

‎client/webpack.client.rails.hot.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const config = require('./webpack.client.base.config');
1111
const hotRailsPort = process.env.HOT_RAILS_PORT || 3500;
1212

1313
config.entry.app.push(
14-
'webpack-dev-server/client?http://localhost:' + hotRailsPort,
14+
`webpack-dev-server/client?http://localhost:${hotRailsPort}`,
1515
'webpack/hot/only-dev-server'
1616
);
1717

‎docs/linters.md

-1
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,3 @@
2323
5. [scss-lint](https://github.com/brigade/scss-lint)
2424
6. [brakeman](http://brakemanscanner.org/)
2525
7. [bundle-audit](https://github.com/rubysec/bundler-audit)
26-

‎spec/rails_helper.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040

4141
RSpec.configure do |config|
4242
# Next line will ensure that assets are built if webpack -w is not running
43-
config.include ReactOnRails::EnsureAssetsCompiled, type: :feature
43+
ReactOnRails.configure_rspec_to_compile_assets(config)
4444

4545
# config taken directly from RSpec example in the DatabaseCleaner README
4646
config.before(:suite) do

‎spec/support/ensure_assets_compiled.rb

-34
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.