You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-8
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ By Justin Gordon and the Shaka Code Team, [www.shakacode.com](http://www.shakaco
23
23
An outdated full tutorial article behind of the motivation of this system 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.
24
24
25
25
# NEWS
26
-
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:
26
+
We have not yet updated the `react_on_rails` gem generators for the following tasks, and we probably never will. *The tutorial* refers to this repo. The following changes have resulted in lots of differences for the webpack files and visual assets:
27
27
28
28
1. NOTE: Any references to localhost:3000 *might* need to use 0.0.0.0:3000 until Puma fixes an issue regarding this.
29
29
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!
@@ -81,9 +81,6 @@ See package.json and Gemfile for versions
81
81
1.`foreman start -f Procfile.hot`
82
82
1. Open a browser tab to http://localhost:3000 for the Rails app example with HOT RELOADING
83
83
2. Try Hot Reloading steps below!
84
-
1.`foreman start -f Procfile.express`
85
-
1. Open a browser tab to http://localhost:4000 for the Hot Module Replacement Example just using an express server (no Rails involved). This is good for fast prototyping of React components. However, this setup is not as useful now that we have hot reloading working for Rails!
86
-
2. Try Hot Reloading steps below!
87
84
1.`foreman start -f Procfile.static`
88
85
1. Open a browser tab to http://localhost:3000 for the Rails app example.
89
86
2. When you make changes, you have to refresh the browser page.
@@ -98,7 +95,6 @@ See package.json and Gemfile for versions
98
95
1. See all npm commands: `npm run`
99
96
1. Start all development processes: `foreman start -f Procfile.dev`
100
97
1. Start all Rails only development processes: `foreman start -f Procfile.hot`
101
-
1. Start development without Rails, using the Webpack Dev Server only: `npm start` (or `foreman start -f Procfile.express`)
102
98
103
99
104
100
# Javascript development without Rails using the Webpack Dev Server
@@ -138,7 +134,7 @@ line in the `rails_helper.rb` file. If you are using this project as an example
138
134
## Config Files
139
135
140
136
-`webpack.client.base.config.js`: Common **client** configuration file to minimize code duplication for `webpack.client.rails.build.config`, `webpack.client.rails.hot.config`, `webpack.client.express.config`
141
-
-`webpack.client.express.config.js`: Webpack configuration for [client/server-express.js](client/server-express.js)
137
+
-`webpack.client.express.config.js`: Webpack configuration for Express server [client/server-express.js](client/server-express.js)
142
138
-`webpack.client.rails.build.config.js`: Client side js bundle for deployment and tests.
143
139
-`webpack.client.rails.hot.config.js`: Webpack Dev Server bundler for serving rails assets on port 3500, used by [client/server-rails-hot.js](client/server-rails-hot.js), for hot reloading JS and CSS within Rails.
144
140
-`webpack.server.rails.build.config.js`: Server side js bundle, used by server rendering.
1.[`Procfile.dev`](Procfile.dev): Starts the Webpack Dev Server and Rails with Hot Reloading.
181
177
2.[`Procfile.hot`](Procfile.hot): Starts the Rails server and the webpack server to provide hot reloading of assets, JavaScript and CSS.
182
178
3.[`Procfile.static`](Procfile.static): Starts the Rails server and generates static assets that are used for tests.
183
-
4.[`Procfile.express`](Procfile.express): Starts only the Webpack Dev Server.
184
179
5.[`Procfile.spec`](Procfile.spec): Starts webpack to create the static files for tests. **Good to know:** If you want to start `rails s` separately to debug in `pry`, then run `Procfile.spec` to generate the assets and run `rails s` in a separate console.
185
180
6.[`Procfile.static.trace`](Procfile.static.trace): Same as `Procfile.static` but prints tracing information useful for debugging server rendering.
181
+
4.[`Procfile.express`](Procfile.express): Starts only the Webpack Dev Server for rendering your components with only an Express server.
182
+
183
+
In general, you want to avoid running more webpack watch processes than you need.
184
+
185
+
## Rendering With an Express Server
186
+
UPDATE: 2016-07-31
187
+
188
+
We no longer recommend using an express server with Rails. It's simply not necessary because:
189
+
190
+
1. Rails can hot reload
191
+
2. There's extra maintenance in keeping this synchronized.
192
+
3. React on Rails does not have a shared_store JS rendering, per [issue #504](https://github.com/shakacode/react_on_rails/issues/504)
193
+
194
+
### Here's how to run the express server setup
186
195
187
-
In general, you want to avoid running more webpack watch processes than you need. The `Procfile.dev`, for example, runs both the express server (Webpack dev server) and the Rails hot assets reloading server.
196
+
1.`foreman start -f Procfile.express`
197
+
2. Open a browser tab to http://localhost:4000 for the Hot Module Replacement Example just using an express server (no Rails involved). This is good for fast prototyping of React components. However, this setup is not as useful now that we have hot reloading working for Rails!
198
+
3. Try Hot Reloading steps below!
188
199
189
200
## Contributors
190
201
[The Shaka Code team!](http://www.shakacode.com/about/), led by [Justin Gordon](https://github.com/justin808/), along with with many others. See [contributors.md](docs/contributors.md)
0 commit comments