Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
robwise authored and justin808 committed Feb 7, 2016
1 parent a68a8d6 commit d98ad3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ We're definitely not doing that. With react_on_rails, webpack is mainly generati
1. Add the following to your Gemfile and bundle install:
```ruby
gem "react_on_rails", "~> 2.0.0"
gem "react_on_rails", "~> 3"
```
2. See help for the generator:
Expand Down
8 changes: 6 additions & 2 deletions docs/additional_reading/rspec_configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ RSpec.configure do |config|
ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)
```

You can pass an RSpec metatag as an optional second parameter to this helper method if you want this helper to run on examples other than where `js: true` (default). The helper will compile webpack files at most once per test run.
You can pass an RSpec metatag as an optional second parameter to this helper method if you want this helper to run on examples other than where `js: true` (default). The helper will compile webpack files at most once per test run. The helper will not compile the webpack files unless they are out of date (stale).

If you do not want to be slowed down by re-compiling webpack assets from scratch every test run, you can call `npm run build:client` (and `npm run build:server` if doing server rendering) to have webpack recompile these files in the background, which will be *much* faster. The helper looks for these processes and will abort recompiling if it finds them to be running.
Please take note of the following:
- This utility assumes your build tasks for the static generated files are `npm run build:client` and `npm run build:server` and do not have the `--watch` option enabled.
- By default, the webpack processes look for the `app/assets/javascripts/generated` and `app/assets/stylesheets/generated` folders. If these folders are missing, are empty, or contain files with `mtime`s older than any of the files in your `client` folder, the helper will recompile your assets. You can override this inside of `config/initializers/react_on_rails.rb` by passing an array of filepaths (relative to the root of the app) to the `generated_assets_dirs` configuration option.

If you want to speed up the re-compiling process, you can call `npm run build:dev:client` (and `npm run build:dev:server` if doing server rendering) to have webpack run in "watch" mode and recompile these files in the background, which will be much faster when making incremental changes than compiling from scratch.

If you want to use a testing framework other than RSpec, please submit let us know on the changes you need to do and we'll update the docs.

Expand Down

0 comments on commit d98ad3e

Please sign in to comment.