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
+26-5Lines changed: 26 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -143,8 +143,10 @@ See package.json and Gemfile for versions
143
143
### Basic Command Line
144
144
- Run all linters and tests: `rake`
145
145
- See all npm commands: `yarn run`
146
-
- To start all development processes: `foreman start -f Procfile.dev`
147
-
- To start only all Rails development processes: `foreman start -f Procfile.hot`
146
+
- To start development with HMR: `./bin/dev` (or `./bin/dev hmr`)
147
+
- To start with static assets: `./bin/dev static`
148
+
- To start with production-like assets: `./bin/dev prod`
149
+
- For help with options: `./bin/dev help`
148
150
149
151
## Rails Integration
150
152
**We're now using Webpack for all Sass and JavaScript assets so we can do CSS Modules within Rails!**
@@ -162,7 +164,7 @@ See package.json and Gemfile for versions
162
164
163
165
+ Be sure to see [Integration Test Notes](./docs/integration-test-notes.md) for advice on running your integration tests.
164
166
165
-
+ **Testing Mode**: When running tests, it is useful to run `foreman start -f Procfile.spec` in order to have webpack automatically recompile the static bundles. Rspec is configured to automatically check whether or not this process is running. If it is not, it will automatically rebuild the webpack bundle to ensure you are not running tests on stale client code. This is achieved via the `ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)`
167
+
+ **Testing Mode**: When running tests, it is useful to run `./bin/dev static` in order to have webpack automatically recompile the static bundles. Rspec is configured to automatically check whether or not this process is running. If it is not, it will automatically rebuild the webpack bundle to ensure you are not running tests on stale client code. This is achieved via the `ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)`
166
168
line in the `rails_helper.rb` file. If you are using this project as an example and are not using RSpec, you may want to implement similar logic in your own project.
The tutorial makes use of a custom font OpenSans-Light. We're doing this to show how to add assets for the CSS processing. The font files are located under [client/app/assets/fonts](client/app/assets/fonts) and are loaded by both the Rails asset pipeline and the Webpack HMR server.
204
206
205
207
## Process management during development
208
+
209
+
**Recommended approach** using the enhanced `bin/dev` script:
210
+
211
+
```bash
212
+
./bin/dev # HMR development (default)
213
+
./bin/dev static # Static assets development
214
+
./bin/dev prod # Production-like assets
215
+
./bin/dev help# See all options
216
+
```
217
+
218
+
**Advanced options:**
219
+
```bash
220
+
./bin/dev --route=comments # Custom route in URLs
221
+
./bin/dev prod --rails-env=production # Full production environment
222
+
```
223
+
224
+
**Alternative approach** using foreman directly:
206
225
```
207
226
bundle exec foreman start -f <Procfile>
208
227
```
209
228
210
-
1.[`Procfile.dev`](Procfile.dev): Starts the Webpack Dev Server and Rails with Hot Reloading.
211
-
1.[`Procfile.static`](Procfile.dev-static): Starts the Rails server and generates static assets that are used for tests.
229
+
Available Procfiles:
230
+
1.[`Procfile.dev`](Procfile.dev): Webpack Dev Server and Rails with Hot Reloading
231
+
1.[`Procfile.dev-static-assets`](Procfile.dev-static-assets): Rails server with static asset generation
232
+
1.[`Procfile.dev-prod-assets`](Procfile.dev-prod-assets): Rails server with production-optimized assets
212
233
213
234
## Contributors
214
235
[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