-
-
Notifications
You must be signed in to change notification settings - Fork 631
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add more detailed description when adding --help option to generator. #161
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
ddc4a08
add more detailed description when adding --help option to generator.
yorzi efee64f
add default true/false to each option description
yorzi e99a3c4
keeping the width to 80 chars for description
yorzi aa60078
Update USAGE of generator.
yorzi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
Description: | ||
|
||
The react_on_rails:install generator combined with the example pull requests of | ||
generator runs will get you up and running efficiently. There's a fair bit of | ||
setup involved when ~with~ integrating Webpack with Rails. Defaults for options | ||
are such that the default is for the flag to be off. For example, the default for | ||
`-R` is that redux is off, and the default of -b means that skip-bootstrap is off. | ||
|
||
* Redux | ||
|
||
Passing the --redux generator option causes the generated Hello World example | ||
to integrate the Redux state container framework. The necessary node modules | ||
will be automatically included for you. | ||
|
||
The generator uses the organizational `paradigm of "bundles"`. These are like | ||
application domains and are used for grouping your code into webpack bundles | ||
in case you decide to create different bundles for deployment. This is also | ||
useful for separating out logical parts of your application. We recommend that | ||
that each bundle will have it's own Redux store. If you have code that you | ||
want to reuse across bundles, such as middleware or common utilities, place them | ||
under `/client/app/lib`. You can then import them in your client code: | ||
`import MyModule from 'lib/MyModule'`; since we have configured webpack to | ||
automatically resolve the word lib to point to this folder. | ||
|
||
* Using Images and Fonts | ||
|
||
The generator has amended the folders created in `client/assets/` to Rails's | ||
asset path. We recommend that if you have any existing assets that you want | ||
to use with your client code, you should move them to these folders and use | ||
webpack as normal. This allows webpack's development server to have access | ||
to your assets, as it will not be able to see any assets in the default Rails | ||
directories which are above the `/client` directory. | ||
|
||
Alternatively, if you have many existing assets and don't wish to move them, | ||
you could consider creating symlinks from `client/assets` that point to your | ||
Rails assets folders inside of `app/assets/`. The assets there will then be | ||
visible to both Rails and webpack. | ||
|
||
* Bootstrap Integration | ||
|
||
React on Rails ships with Twitter Bootstrap already integrated into the build. | ||
Note that the generator removes require_tree in both the application.js and | ||
application.css.scss files. This is to ensure the correct load order for the | ||
bootstrap integration, and is usually a good idea in general. You will therefore | ||
need to explicitly require your files. | ||
|
||
How the Bootstrap library is loaded depends upon whether one is using the Rails | ||
server or the HMR development server. | ||
|
||
1. Bootstrap via Rails Server | ||
|
||
The Rails server loads bootstrap-sprockets, provided | ||
by the bootstrap-sass ruby gem (added automatically to your Gemfile by | ||
the generator), via the `app/assets/stylesheets/_bootstrap-custom.scss` | ||
partial. | ||
|
||
This allows for using Bootstrap in your regular Rails stylesheets. If you | ||
wish to customize any of the Bootstrap variables, you can do so via the | ||
`client/assets/stylesheets/_pre-bootstrap.scss` partial. | ||
|
||
2. Bootstrap via Webpack Dev Server | ||
|
||
The webpack dev server does not go through Rails but instead loads bootstrap | ||
via the `bootstrap-sass-loader` webpack loader. You can configure the loader | ||
via the `client/bootstrap-sass-config.js` file. | ||
|
||
3. Keeping Custom Bootstrap Configurations Synced | ||
|
||
Because the webpack dev server and Rails each load Bootstrap via a different | ||
file (explained in the two sections immediately above), any changes to | ||
the way components are loaded in one file must also be made to the other | ||
file in order to keep styling consistent between the two. For example, | ||
if an import is excluded in _bootstrap-custom.scss, the same import should | ||
be excluded in `bootstrap-sass-config.js` so that styling in the Rails | ||
server and the webpack dev server will be the same. | ||
|
||
4. Skip Bootstrap Integration | ||
|
||
Bootstrap integration is enabled by default, but can be disabled by passing | ||
the --skip-bootstrap flag (alias -b). When you don't need Bootstrap in your | ||
existing project, just skip it as needed. | ||
|
||
* JavaScript Linters | ||
|
||
JavaScript linters are enabled by default, but can be disabled by passing the | ||
--skip-js-linters flag (alias j), and those that run in Node have been add to | ||
`client/package.json` under devDependencies. | ||
|
||
* Ruby Linters | ||
|
||
Ruby linters are disabled by default, but can be enabled by passing the | ||
`--ruby-linters` flag when generating. These linters have been added to your | ||
Gemfile in addition to the the appropriate Rake tasks. | ||
|
||
We really love using all the linters! Give them a try. | ||
|
||
More Details: | ||
|
||
`https://github.com/shakacode/react_on_rails#generator` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@justin808 I feel very strongly that this is adding confusion, not removing it. Now when we say the default is 'false,' is
--skip-bootstrap
false or isbootstrap
false? I think addingdefault
s for things is only necessary if we start using options that that are notdefault: false