Skip to content

Commit 3c78fe7

Browse files
authored
Update React on Rails to 6.9.3 (shakacode#370)
* Update React on Rails to 6.9.3 * Update to reflect switch from npm to yarn * Ensure Webpack builds files for all tests 2 parts: 1. Pass extra param of :feature_spec to the call configure_respec_to_compile_assets. 2. Tag all specs in the features direction as `:feature_spec`
1 parent 4f37cf9 commit 3c78fe7

14 files changed

+103
-84
lines changed

Diff for: .travis.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ install:
2929
- npm install npm@latest -g
3030
- npm install -g yarn
3131
- npm --version
32-
- npm install
32+
- yarn install
3333
- rake react_on_rails:locale
34-
- cd client && npm run build:test
3534
- rake db:setup
3635

3736
# Tip: No need to run xvfb if running headless testing. However, we're going to start with

Diff for: Gemfile

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

41-
gem "react_on_rails", "~> 6.7.1"
41+
gem "react_on_rails", "6.9.3"
4242

4343
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
4444
# mini_racer is probably faster than therubyracer

Diff for: Gemfile.lock

+42-42
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (5.0.1)
5-
actionpack (= 5.0.1)
6-
nio4r (~> 1.2)
4+
actioncable (5.0.2)
5+
actionpack (= 5.0.2)
6+
nio4r (>= 1.2, < 3.0)
77
websocket-driver (~> 0.6.1)
8-
actionmailer (5.0.1)
9-
actionpack (= 5.0.1)
10-
actionview (= 5.0.1)
11-
activejob (= 5.0.1)
8+
actionmailer (5.0.2)
9+
actionpack (= 5.0.2)
10+
actionview (= 5.0.2)
11+
activejob (= 5.0.2)
1212
mail (~> 2.5, >= 2.5.4)
1313
rails-dom-testing (~> 2.0)
14-
actionpack (5.0.1)
15-
actionview (= 5.0.1)
16-
activesupport (= 5.0.1)
14+
actionpack (5.0.2)
15+
actionview (= 5.0.2)
16+
activesupport (= 5.0.2)
1717
rack (~> 2.0)
1818
rack-test (~> 0.6.3)
1919
rails-dom-testing (~> 2.0)
2020
rails-html-sanitizer (~> 1.0, >= 1.0.2)
21-
actionview (5.0.1)
22-
activesupport (= 5.0.1)
21+
actionview (5.0.2)
22+
activesupport (= 5.0.2)
2323
builder (~> 3.1)
2424
erubis (~> 2.7.0)
2525
rails-dom-testing (~> 2.0)
26-
rails-html-sanitizer (~> 1.0, >= 1.0.2)
27-
activejob (5.0.1)
28-
activesupport (= 5.0.1)
26+
rails-html-sanitizer (~> 1.0, >= 1.0.3)
27+
activejob (5.0.2)
28+
activesupport (= 5.0.2)
2929
globalid (>= 0.3.6)
30-
activemodel (5.0.1)
31-
activesupport (= 5.0.1)
32-
activerecord (5.0.1)
33-
activemodel (= 5.0.1)
34-
activesupport (= 5.0.1)
30+
activemodel (5.0.2)
31+
activesupport (= 5.0.2)
32+
activerecord (5.0.2)
33+
activemodel (= 5.0.2)
34+
activesupport (= 5.0.2)
3535
arel (~> 7.0)
36-
activesupport (5.0.1)
36+
activesupport (5.0.2)
3737
concurrent-ruby (~> 1.0, >= 1.0.2)
3838
i18n (~> 0.7)
3939
minitest (~> 5.1)
4040
tzinfo (~> 1.1)
41-
addressable (2.5.0)
41+
addressable (2.5.1)
4242
public_suffix (~> 2.0, >= 2.0.2)
4343
archive-zip (0.7.0)
4444
io-like (~> 0.3.0)
@@ -136,12 +136,12 @@ GEM
136136
libv8 (~> 5.3)
137137
minitest (5.10.1)
138138
multi_json (1.12.1)
139-
nio4r (1.2.1)
140-
nokogiri (1.7.0.1)
139+
nio4r (2.0.0)
140+
nokogiri (1.7.1)
141141
mini_portile2 (~> 2.1.0)
142142
parser (2.3.2.0)
143143
ast (~> 2.2)
144-
pg (0.19.0)
144+
pg (0.20.0)
145145
poltergeist (1.11.0)
146146
capybara (~> 2.1)
147147
cliver (~> 0.3.1)
@@ -170,26 +170,26 @@ GEM
170170
rack (2.0.1)
171171
rack-test (0.6.3)
172172
rack (>= 1.0)
173-
rails (5.0.1)
174-
actioncable (= 5.0.1)
175-
actionmailer (= 5.0.1)
176-
actionpack (= 5.0.1)
177-
actionview (= 5.0.1)
178-
activejob (= 5.0.1)
179-
activemodel (= 5.0.1)
180-
activerecord (= 5.0.1)
181-
activesupport (= 5.0.1)
173+
rails (5.0.2)
174+
actioncable (= 5.0.2)
175+
actionmailer (= 5.0.2)
176+
actionpack (= 5.0.2)
177+
actionview (= 5.0.2)
178+
activejob (= 5.0.2)
179+
activemodel (= 5.0.2)
180+
activerecord (= 5.0.2)
181+
activesupport (= 5.0.2)
182182
bundler (>= 1.3.0, < 2.0)
183-
railties (= 5.0.1)
183+
railties (= 5.0.2)
184184
sprockets-rails (>= 2.0.0)
185185
rails-dom-testing (2.0.2)
186186
activesupport (>= 4.2.0, < 6.0)
187187
nokogiri (~> 1.6)
188188
rails-html-sanitizer (1.0.3)
189189
loofah (~> 2.0)
190-
railties (5.0.1)
191-
actionpack (= 5.0.1)
192-
activesupport (= 5.0.1)
190+
railties (5.0.2)
191+
actionpack (= 5.0.2)
192+
activesupport (= 5.0.2)
193193
method_source
194194
rake (>= 0.8.7)
195195
thor (>= 0.18.1, < 2.0)
@@ -199,7 +199,7 @@ GEM
199199
rb-inotify (0.9.7)
200200
ffi (>= 0.5.0)
201201
rdoc (4.3.0)
202-
react_on_rails (6.7.1)
202+
react_on_rails (6.9.3)
203203
addressable
204204
connection_pool
205205
execjs (~> 2.5)
@@ -277,7 +277,7 @@ GEM
277277
thread_safe (0.3.6)
278278
tilt (2.0.5)
279279
tins (1.12.0)
280-
tzinfo (1.2.2)
280+
tzinfo (1.2.3)
281281
thread_safe (~> 0.1)
282282
uglifier (3.0.3)
283283
execjs (>= 0.3.0, < 3)
@@ -329,7 +329,7 @@ DEPENDENCIES
329329
rails
330330
rails-html-sanitizer
331331
rainbow
332-
react_on_rails (~> 6.7.1)
332+
react_on_rails (= 6.9.3)
333333
redis
334334
rspec-rails (~> 3)
335335
rspec-retry
@@ -348,4 +348,4 @@ RUBY VERSION
348348
ruby 2.3.1p112
349349

350350
BUNDLED WITH
351-
1.13.6
351+
1.14.6

Diff for: README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ See package.json and Gemfile for versions
120120
1. Check that you have Postgres installed. Run `which postgres` to check. Use 9.4 or greater.
121121
1. Check that you have `qmake` installed. Run `which qmake` to check. If missing, follow these instructions: [Installing Qt and compiling capybara-webkit](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit)
122122
1. `bundle install`
123-
1. `npm install -g yarn`
123+
1. `brew install yarn`
124124
1. `yarn`
125125
1. `rake db:setup`
126126
1. `foreman start -f Procfile.hot`
@@ -132,7 +132,7 @@ See package.json and Gemfile for versions
132132

133133
### Basic Command Line
134134
1. Run all linters and tests: `rake`
135-
1. See all npm commands: `npm run`
135+
1. See all npm commands: `yarn run`
136136
1. To start all development processes: `foreman start -f Procfile.dev`
137137
1. To start only all Rails development processes: `foreman start -f Procfile.hot`
138138

@@ -146,7 +146,7 @@ See package.json and Gemfile for versions
146146

147147
We include a sample setup for developing your JavaScript files without Rails. However, this is no longer recommended as it's best to create your APIs in Rails, and take advantage of the hot reloading of your react components provided by this project.
148148

149-
1. Run the node server with file `server-express.js` with command `npm run` or `cd client && node server-express.js`.
149+
1. Run the node server with file `server-express.js` with command `yarn run` or `cd client && node server-express.js`.
150150
2. Point your browser to [http://localhost:4000](http://localhost:4000)
151151

152152
Save a change to a JSX file and see it update immediately in the browser! Note, any browser state still exists, such as what you've typed in the comments box. That's totally different than [Live Reload](http://livereload.com/) which refreshes the browser. Note, we just got this working with your regular Rails server! See above for **Hot Loading**.

Diff for: client/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"react-bootstrap": "^0.30.7",
7777
"react-dom": "^15.4.1",
7878
"react-intl": "^2.2.2",
79-
"react-on-rails": "^6.2.1",
79+
"react-on-rails": "^6.9.3",
8080
"react-redux": "^4.4.6",
8181
"react-router": "^3.0.0",
8282
"react-router-redux": "^4.0.7",

Diff for: client/webpack.client.rails.build.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{"functions": "never", "arrays": "only-multiline", "objects": "only-multiline"} ] */
33

44
// Run like this:
5-
// cd client && npm run build:client
5+
// cd client && yarn run build:client
66
// Note that Foreman (Procfile.dev) has also been configured to take care of this.
77

88
const path = require('path');

Diff for: client/yarn.lock

+36-19
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,12 @@ argparse@^1.0.7:
130130
dependencies:
131131
sprintf-js "~1.0.2"
132132

133+
aria-query@^0.3.0:
134+
version "0.3.0"
135+
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-0.3.0.tgz#cb8a9984e2862711c83c80ade5b8f5ca0de2b467"
136+
dependencies:
137+
ast-types-flow "0.0.7"
138+
133139
arr-diff@^2.0.0:
134140
version "2.0.0"
135141
resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
@@ -215,6 +221,10 @@ assertion-error@^1.0.1:
215221
version "1.0.2"
216222
resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.0.2.tgz#13ca515d86206da0bac66e834dd397d87581094c"
217223

224+
225+
version "0.0.7"
226+
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
227+
218228
async-each@^1.0.0:
219229
version "1.0.1"
220230
resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.1.tgz#19d386a1d9edc6e7c1c85d388aedbcc56d33602d"
@@ -1867,6 +1877,10 @@ elliptic@^6.0.0:
18671877
minimalistic-assert "^1.0.0"
18681878
minimalistic-crypto-utils "^1.0.0"
18691879

1880+
emoji-regex@^6.1.0:
1881+
version "6.4.1"
1882+
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.4.1.tgz#77486fe9cd45421d260a6238b88d721e2fad2050"
1883+
18701884
emojis-list@^2.0.0:
18711885
version "2.1.0"
18721886
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
@@ -2015,22 +2029,22 @@ escope@^3.6.0:
20152029
esrecurse "^4.1.0"
20162030
estraverse "^4.1.1"
20172031

2018-
eslint-config-airbnb-base@^10.0.0:
2019-
version "10.0.1"
2020-
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-10.0.1.tgz#f17d4e52992c1d45d1b7713efbcd5ecd0e7e0506"
2032+
eslint-config-airbnb-base@^11.1.0:
2033+
version "11.1.2"
2034+
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-11.1.2.tgz#259209a7678bf693e31cbe8f953f206b6aa7ccc3"
20212035

2022-
eslint-config-airbnb@^13.0.0:
2023-
version "13.0.0"
2024-
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-13.0.0.tgz#688d15d3c276c0c753ae538c92a44397d76ae46e"
2036+
eslint-config-airbnb@^14.1.0:
2037+
version "14.1.0"
2038+
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-14.1.0.tgz#355d290040bbf8e00bf8b4b19f4b70cbe7c2317f"
20252039
dependencies:
2026-
eslint-config-airbnb-base "^10.0.0"
2040+
eslint-config-airbnb-base "^11.1.0"
20272041

2028-
eslint-config-shakacode@^13.2.0-beta.1:
2029-
version "13.2.1"
2030-
resolved "https://registry.yarnpkg.com/eslint-config-shakacode/-/eslint-config-shakacode-13.2.1.tgz#93194d101101ede72bc2c7cfbe3214deac1c86c4"
2042+
eslint-config-shakacode@^14.1.1:
2043+
version "14.1.1"
2044+
resolved "https://registry.yarnpkg.com/eslint-config-shakacode/-/eslint-config-shakacode-14.1.1.tgz#bc31841c20799435c14ae7b008f04fc8e1d7f97a"
20312045
dependencies:
20322046
babel-eslint "^7.1.1"
2033-
eslint-config-airbnb "^13.0.0"
2047+
eslint-config-airbnb "^14.1.0"
20342048

20352049
eslint-import-resolver-node@^0.2.0:
20362050
version "0.2.3"
@@ -2078,15 +2092,18 @@ eslint-plugin-import@^2.2.0:
20782092
minimatch "^3.0.3"
20792093
pkg-up "^1.0.0"
20802094

2081-
eslint-plugin-jsx-a11y@^2.2.3:
2082-
version "2.2.3"
2083-
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-2.2.3.tgz#4e35cb71b8a7db702ac415c806eb8e8d9ea6c65d"
2095+
eslint-plugin-jsx-a11y@^4.0.0:
2096+
version "4.0.0"
2097+
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-4.0.0.tgz#779bb0fe7b08da564a422624911de10061e048ee"
20842098
dependencies:
2099+
aria-query "^0.3.0"
2100+
ast-types-flow "0.0.7"
20852101
damerau-levenshtein "^1.0.0"
2102+
emoji-regex "^6.1.0"
20862103
jsx-ast-utils "^1.0.0"
20872104
object-assign "^4.0.1"
20882105

2089-
eslint-plugin-react@^6.7.1:
2106+
eslint-plugin-react@^6.10.3:
20902107
version "6.10.3"
20912108
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-6.10.3.tgz#c5435beb06774e12c7db2f6abaddcbf900cd3f78"
20922109
dependencies:
@@ -2096,7 +2113,7 @@ eslint-plugin-react@^6.7.1:
20962113
jsx-ast-utils "^1.3.4"
20972114
object.assign "^4.0.4"
20982115

2099-
eslint@^3.10.2:
2116+
eslint@^3.18.0:
21002117
version "3.18.0"
21012118
resolved "https://registry.yarnpkg.com/eslint/-/eslint-3.18.0.tgz#647e985c4ae71502d20ac62c109f66d5104c8a4b"
21022119
dependencies:
@@ -4629,9 +4646,9 @@ react-intl@^2.2.2:
46294646
intl-relativeformat "^1.3.0"
46304647
invariant "^2.1.1"
46314648

4632-
react-on-rails@^6.2.1:
4633-
version "6.8.2"
4634-
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-6.8.2.tgz#756bdec765efea4154acf44457307c292ef3c033"
4649+
react-on-rails@^6.9.3:
4650+
version "6.9.3"
4651+
resolved "https://registry.yarnpkg.com/react-on-rails/-/react-on-rails-6.9.3.tgz#71aa3c6d0995e387e2c406359f7988991ac4180e"
46354652

46364653
react-overlays@^0.6.12:
46374654
version "0.6.12"

Diff for: config/initializers/react_on_rails.rb

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@
1717
# If you are using the ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)
1818
# with rspec then this controls what npm command is run
1919
# to automatically refresh your webpack assets on every test run.
20-
config.npm_build_test_command = "npm run build:test"
20+
config.npm_build_test_command = "yarn run build:test"
2121

2222
# This configures the script to run to build the production assets by webpack. Set this to nil
2323
# if you don't want react_on_rails building this file for you.
24-
config.npm_build_production_command = "npm run build:production"
24+
config.npm_build_production_command = "yarn run build:production"
2525

2626
################################################################################
2727
# CLIENT RENDERING OPTIONS
@@ -75,8 +75,6 @@
7575
################################################################################
7676
# MISCELLANEOUS OPTIONS
7777
################################################################################
78-
# Default is false, enable if your content security policy doesn't include `style-src: 'unsafe-inline'`
79-
config.skip_display_none = false
8078

8179
# This allows you to add additional values to the Rails Context. Implement one static method
8280
# called `custom_context(view_context)` and return a Hash.

Diff for: docs/bourbon-integration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
To use [bourbon](https://github.com/thoughtbot/bourbon) take the following steps:
44

5-
- Install node-bourbon `cd client && npm install --save node-bourbon`
5+
- Install node-bourbon `cd client && yarn install --save node-bourbon`
66
- Update [bootstrap-sass.js](https://github.com/shakacode/react-webpack-rails-tutorial/blob/master/client/bootstrap-sass.config.js) to use the right paths:
77
```
88
// Add this

Diff for: docs/tests-and-ci.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,25 @@ We have:
1010

1111
From the root of the project, you can run all specs+tests+linter with
1212

13-
npm run test
13+
yarn run test
1414

1515
Run the feature specs individually with `rspec`.
1616

1717
Run the React unit tests (all .js and .jsx files) from the `client` dir with;
1818

1919
cd client
20-
npm run test --silent
20+
yarn run test --silent
2121

2222
In lieu of having `mocha --watch` working properly (pull request welcome!), you can have your js tests continually running with `watch`
2323

24-
npm install -g watch
24+
yarn install -g watch
2525
cd client
26-
watch 'npm run test --silent' test/ app/
26+
watch 'yarn run test --silent' test/ app/
2727

2828

2929
## CI configuration
3030
Add those lines to your CI scripts after `bundle install`
3131

3232
```sh
33-
npm install
34-
cd client && npm run build:client && npm run build:server
33+
yarn install
3534
```

0 commit comments

Comments
 (0)