Skip to content

Commit 8bef504

Browse files
committed
Update dependencies and npm run scripts
1 parent b85aee8 commit 8bef504

File tree

10 files changed

+173
-140
lines changed

10 files changed

+173
-140
lines changed

Gemfile.lock

+8-8
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ GEM
4747
awesome_print (1.6.1)
4848
binding_of_caller (0.7.2)
4949
debug_inspector (>= 0.0.1)
50-
brakeman (3.1.4)
50+
brakeman (3.1.5)
5151
erubis (~> 2.6)
5252
fastercsv (~> 1.5)
5353
haml (>= 3.0, < 5.0)
@@ -64,7 +64,7 @@ GEM
6464
bundler (~> 1.2)
6565
thor (~> 0.18)
6666
byebug (8.2.1)
67-
capybara (2.6.0)
67+
capybara (2.6.2)
6868
addressable
6969
mime-types (>= 1.16)
7070
nokogiri (>= 1.3.3)
@@ -100,7 +100,7 @@ GEM
100100
debug_inspector (0.0.2)
101101
diff-lcs (1.2.5)
102102
docile (1.1.5)
103-
domain_name (0.5.25)
103+
domain_name (0.5.20160128)
104104
unf (>= 0.0.5, < 1.0.0)
105105
erubis (2.7.0)
106106
execjs (2.6.0)
@@ -164,7 +164,7 @@ GEM
164164
pry-stack_explorer (0.4.9.2)
165165
binding_of_caller (>= 0.7)
166166
pry (>= 0.9.11)
167-
puma (2.15.3)
167+
puma (2.16.0)
168168
rack (1.6.4)
169169
rack-test (0.6.3)
170170
rack (>= 1.0)
@@ -201,7 +201,7 @@ GEM
201201
rake (10.5.0)
202202
rdoc (4.2.1)
203203
json (~> 1.4)
204-
react_on_rails (2.1.0)
204+
react_on_rails (2.3.0)
205205
connection_pool
206206
execjs (~> 2.5)
207207
rails (>= 3.2)
@@ -259,7 +259,7 @@ GEM
259259
sdoc (0.4.1)
260260
json (~> 1.7, >= 1.7.7)
261261
rdoc (~> 4.0)
262-
selenium-webdriver (2.49.0)
262+
selenium-webdriver (2.50.0)
263263
childprocess (~> 0.5)
264264
multi_json (~> 1.0)
265265
rubyzip (~> 1.0)
@@ -280,7 +280,7 @@ GEM
280280
sprockets (3.5.2)
281281
concurrent-ruby (~> 1.0)
282282
rack (> 1, < 3)
283-
sprockets-rails (3.0.0)
283+
sprockets-rails (3.0.1)
284284
actionpack (>= 4.0)
285285
activesupport (>= 4.0)
286286
sprockets (>= 3.0.0)
@@ -306,7 +306,7 @@ GEM
306306
unf (0.1.4)
307307
unf_ext
308308
unf_ext (0.0.7.1)
309-
web-console (3.0.0)
309+
web-console (3.1.1)
310310
activemodel (>= 4.2)
311311
debug_inspector
312312
railties (>= 4.2)

Procfile.hot

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
rails: REACT_ON_RAILS_ENV=HOT rails s
88

99
# Run the hot reload server for client development
10-
rails-assets: sh -c 'rm app/assets/webpack/* || true && HOT_RAILS_PORT=3500 npm run build:dev:client'
10+
rails-assets: sh -c 'npm run build:dev:client:once && HOT_RAILS_PORT=3500 npm run hot-assets'
1111

1212
# Keep the JS fresh for server rendering. Remove if not server rendering
1313
rails-server-assets: sh -c 'npm run build:dev:server'

Procfile.static

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Run Rails without hot reloading (static assets)
22
rails: rails s
33

4-
# Keep the JS fresh for server rendering. Remove if not server rendering
4+
# Build client assets, watching for changes.
5+
rails-client-assets: sh -c 'npm run build:dev:client'
6+
7+
# Build server assets, watching for changes. Remove if not server rendering.
58
rails-server-assets: sh -c 'npm run build:dev:server'
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
1-
// This is a manifest file that'll be compiled into application.js, which will include all the files
2-
// listed below.
3-
//
4-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5-
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6-
//
7-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8-
// compiled file.
9-
//
10-
// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details
11-
// about supported directives.
12-
131
// All webpack assets in development will be loaded via webpack dev server
142
// It's important to include them in layout view above this asset
153
// b/c it exposes jQuery for turbolinks and another non-webpack JS (if any)
164

17-
// This one depends on jQuery
185
//= require turbolinks
196

207
//= require rails_startup

app/views/layouts/application.html.erb

+3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22
<html>
33
<head>
44
<title>RailsReactTutorial</title>
5+
56
<%= env_stylesheet_link_tag(static: 'application_static',
67
hot: 'application_non_webpack',
78
media: 'all',
89
'data-turbolinks-track' => true) %>
10+
911
<!-- These do not use turbolinks -->
1012
<%= env_javascript_include_tag(hot: ['http://localhost:3500/vendor-bundle.js',
1113
'http://localhost:3500/app-bundle.js']) %>
14+
1215
<!-- These do use turbolinks -->
1316
<%= env_javascript_include_tag(static: 'application_static',
1417
hot: 'application_non_webpack',

client/app/bundles/comments/startup/clientRegistration.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import RouterApp from './ClientRouterApp';
33
import SimpleCommentScreen from '../components/SimpleCommentScreen/SimpleCommentScreen';
44
import ReactOnRails from 'react-on-rails';
55

6+
ReactOnRails.setOptions({
7+
traceTurbolinks: TRACE_TURBOLINKS,
8+
});
9+
610
ReactOnRails.register(
711
{
812
App,

0 commit comments

Comments
 (0)