Skip to content

Commit de23424

Browse files
committed
Format everything Prettier recognizes
1 parent acbc3ea commit de23424

File tree

88 files changed

+1615
-1154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1615
-1154
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Create a report to help us improve
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

109
A bug is a crash or incorrect behavior. If you have a debugging or troubleshooting question, please open [a discussion](https://github.com/shakacode/react_on_rails/discussions).

.github/ISSUE_TEMPLATE/feature_request.md

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ about: Suggest an idea for this project
44
title: ''
55
labels: ''
66
assignees: ''
7-
87
---
98

109
**Is your feature request related to a problem? Please describe.**

.github/PULL_REQUEST_TEMPLATE.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ these bugs have open GitHub issues, be sure to tag them here as well,
66
to keep the conversation linked together._
77

88
### Pull Request checklist
9+
910
_Remove this line after checking all the items here. If the item is not applicable to the PR, both check it out and wrap it by `~`._
1011

1112
- [ ] Add/update test to cover these changes
1213
- [ ] Update documentation
13-
- [ ] Update CHANGELOG file
14-
_Add the CHANGELOG entry at the top of the file._
14+
- [ ] Update CHANGELOG file
15+
16+
_Add the CHANGELOG entry at the top of the file._
1517

1618
### Other Information
1719

1820
_Remove this paragraph and mention any other important and relevant information such as benchmarks._
19-

.prettierrc

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ bracketSameLine: false
1010
overrides:
1111
- files: '*.@(css|scss)'
1212
options:
13-
parser: css
1413
singleQuote: false
1514
printWidth: 120
1615
- files: '*.@(json)'

CHANGELOG.md

+385-59
Large diffs are not rendered by default.

CONTRIBUTING.md

+40-22
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# Tips for Contributors
22

3-
* [docs/contributor-info/Releasing](./docs/contributor-info/releasing.md) for instructions on releasing.
4-
* [docs/contributor-info/pull-requests](./docs/contributor-info/pull-requests.md)
5-
* See other docs in [docs/contributor-info](./docs/contributor-info)
3+
- [docs/contributor-info/Releasing](./docs/contributor-info/releasing.md) for instructions on releasing.
4+
- [docs/contributor-info/pull-requests](./docs/contributor-info/pull-requests.md)
5+
- See other docs in [docs/contributor-info](./docs/contributor-info)
66

77
## To run tests:
8-
* [Yalc](https://github.com/whitecolor/yalc) must be installed globally for most local development.
9-
* After updating code via Git, to prepare all examples:
8+
9+
- [Yalc](https://github.com/whitecolor/yalc) must be installed globally for most local development.
10+
- After updating code via Git, to prepare all examples:
11+
1012
```sh
1113
cd react_on_rails/
1214
bundle && yarn && rake shakapacker_examples:gen_all && rake node_package && rake
@@ -16,22 +18,25 @@ See [Dev Initial Setup](#dev-initial-setup) below for, well... initial setup,
1618
and [Running tests](#running-tests) for more details on running tests.
1719

1820
# IDE/IDE SETUP
21+
1922
It's critical to configure your IDE/editor to ignore certain directories. Otherwise your IDE might slow to a crawl!
2023

21-
* /coverage
22-
* /tmp
23-
* /gen-examples
24-
* /node_package/lib
25-
* /node_modules
26-
* /spec/dummy/app/assets/webpack
27-
* /spec/dummy/log
28-
* /spec/dummy/node_modules
29-
* /spec/dummy/client/node_modules
30-
* /spec/dummy/tmp
31-
* /spec/react_on_rails/dummy-for-generators
24+
- /coverage
25+
- /tmp
26+
- /gen-examples
27+
- /node_package/lib
28+
- /node_modules
29+
- /spec/dummy/app/assets/webpack
30+
- /spec/dummy/log
31+
- /spec/dummy/node_modules
32+
- /spec/dummy/client/node_modules
33+
- /spec/dummy/tmp
34+
- /spec/react_on_rails/dummy-for-generators
3235

3336
# Configuring your test app to use your local fork
37+
3438
You can test the `react-on-rails` gem using your own external test app or the gem's internal `spec/dummy` app. The `spec/dummy` app is an example of the various setup techniques you can use with the gem.
39+
3540
```
3641
├── test_app
3742
| └── client
@@ -41,6 +46,7 @@ You can test the `react-on-rails` gem using your own external test app or the ge
4146
```
4247

4348
## Testing the Ruby Gem
49+
4450
If you want to test the ruby parts of the gem with an application before you release a new version of the gem, you can specify the path to your local version via your test app's Gemfile:
4551

4652
```ruby
@@ -50,6 +56,7 @@ gem "react_on_rails", path: "../path-to-react-on-rails"
5056
Note that you will need to bundle install after making this change, but also that **you will need to restart your Rails application if you make any changes to the gem**.
5157

5258
## Testing the Node package for react-on-rails via Yalc
59+
5360
In addition to testing the Ruby parts out, you can also test the node package parts of the gem with an external application. First, be **sure** to build the NPM package:
5461

5562
```sh
@@ -70,8 +77,10 @@ yalc add react-on-rails
7077
```
7178

7279
The workflow is:
80+
7381
1. Make changes to the node package.
7482
2. We need yalc to push and then run yarn:
83+
7584
```
7685
cd <top dir>
7786
# Will send the updates to other folders
@@ -93,6 +102,7 @@ Don't forget you may need to run yarn after adding packages with yalc to install
93102
```
94103

95104
#### Example: Testing NPM changes with the dummy app
105+
96106
1. Add `console.log('Hello!')` to [clientStartup.ts, function render](https://github.com/shakacode/react_on_rails/blob/master/node_package/src/clientStartup.ts in `/node_package/src/clientStartup.js` to confirm we're getting an update to the node package client side. Do the same for function `serverRenderReactComponent` in `/node_package/src/serverRenderReactComponent.ts`.
97107
2. Refresh the browser if the server is already running or start the server using `foreman start` from `react_on_rails/spec/dummy` and navigate to `http://localhost:5000/`. You will now see the `Hello!` message printed in the browser's console. If you did not see that message, then review the steps above for the workflow of making changes and pushing them via yalc.
98108

@@ -101,13 +111,14 @@ Don't forget you may need to run yarn after adding packages with yalc to install
101111
## Dev Initial Setup
102112

103113
### Prereqs
114+
104115
After checking out the repo, making sure you have rvm and nvm setup (setup ruby and node), cd to `spec/dummy` and run `bin/setup` to install ruby dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
105116

106117
### Local Node Package
107118

108119
Note, the example and dummy apps will use your local node_package folder as the react-on-rails node package. This will also be done automatically for you via the `rake examples:gen_all` rake task.
109120

110-
*Side note: It's critical to use the alias section of the webpack config to avoid a double inclusion error. This has already been done for you in the example and dummy apps, but for reference:*
121+
_Side note: It's critical to use the alias section of the webpack config to avoid a double inclusion error. This has already been done for you in the example and dummy apps, but for reference:_
111122

112123
```js
113124
resolve: {
@@ -129,7 +140,6 @@ yarn build
129140
Or run this which builds the yarn package, then the webpack files for spec/dummy, and runs tests in
130141
spec/dummy.
131142

132-
133143
```sh
134144
# Optionally change default capybara driver
135145
export DRIVER=selenium_firefox
@@ -171,9 +181,11 @@ yarn run check
171181
```
172182

173183
### Starting the Dummy App
184+
174185
To run the dummy app, it's **CRITICAL** to not just run `rails s`. You have to run `foreman start` with one of the Procfiles. If you don't do this, then `webpack` will not generate a new bundle, and you will be seriously confused when you change JavaScript and the app does not change. If you change the webpack configs, then you need to restart foreman. If you change the JS code for react-on-rails, you need to run `yarn run build`. Since the react-on-rails package should be sym linked, you don't have to `yarn react-on-rails` after every change.
175186

176187
### RSpec Testing
188+
177189
Run `rake` for testing the gem and `spec/dummy`. Otherwise, the `rspec` command only works for testing within the sample apps, like `spec/dummy`.
178190

179191
If you run `rspec` at the top level, you'll see this message: `require': cannot load such file -- rails_helper (LoadError)`
@@ -189,15 +201,16 @@ Run `rake -T` or `rake -D` to see testing options.
189201
See below for verifying changes to the generators.
190202

191203
### Install Generator
204+
192205
In your Rails app add this gem with a path to your fork.
193206

194207
```ruby
195208
gem 'react_on_rails', path: '../relative/path/to/react_on_rails'
196-
```
209+
```
197210

198211
Then run `bundle`.
199212

200-
The main installer can be run with ```rails generate react_on_rails:install```
213+
The main installer can be run with `rails generate react_on_rails:install`
201214

202215
Then use yalc to add the npm module.
203216

@@ -214,19 +227,22 @@ yalc add react-on-rails
214227
```
215228

216229
### Testing the Generator
230+
217231
The generators are covered by generator tests using Rails's generator testing helpers, but it never hurts to do a sanity check and explore the API. See [generator_testing_script.md](generator_testing_script.md) for a script on how to run the generator on a fresh project.
218232

219233
`rake run_rspec:example_basic` is a great way to run tests on one generator. Once that works, you should run `rake run_rspec:examples`. Be aware that this will create a hug number of files under a `/gen-examples` directory. You should be sure to exclude this directory from your IDE and delete it once your testing is done.
220234

221235
### Linting
236+
222237
All linting is performed from the docker container for CI. You will need docker and docker-compose installed locally to lint code changes via the lint container. You can lint locally by running `npm run lint && npm run flow`
223238

224-
* [Install Docker Toolbox for Mac](https://www.docker.com/toolbox)
225-
* [Install Docker Compose for Linux](https://docs.docker.com/compose/install/)
239+
- [Install Docker Toolbox for Mac](https://www.docker.com/toolbox)
240+
- [Install Docker Compose for Linux](https://docs.docker.com/compose/install/)
226241

227242
Once you have docker and docker-compose running locally, run `docker-compose build lint`. This will build the `reactonrails_lint` docker image and docker-compose `lint` container. The initial build is slow, but after the install, startup is very quick.
228243

229244
### Linting Commands
245+
230246
Run `rake lint`.
231247

232248
Alternately with Docker:
@@ -238,12 +254,14 @@ You can run specific linting for directories or files by using `docker-compose r
238254
`docker-compose run lint bash` sets you up to run from the container command line.
239255

240256
### Updating Rubocop
257+
241258
2 files require updating to update the Rubocop version:
242259

243260
1. `react_on_rails.gemspec`
244261
2. `spec/dummy/Gemfile`
245262

246263
### Docker CI - Test and Linting
264+
247265
Docker CI and Tests containers have a xvfd server automatically started for headless browser testing with selenium and Firefox.
248266

249267
Run `docker-compose build ci` to build the CI container. Run `docker-compose run ci` to start all rspec tests and linting. `docker-compose run --entrypoint=/bin/bash` will override the default CI action and place you inside the CI container in a bash session. This is what is run on Travis-CI.

KUDOS.md

+22-1
Original file line numberDiff line numberDiff line change
@@ -11,83 +11,104 @@ I'm looking for quotes on why you like using React on Rails. You might mention a
1111
![2017-10-07_00-18-43](https://user-images.githubusercontent.com/1118459/31306902-341a537a-aaf5-11e7-8014-28c126a7c975.png)
1212

1313
## June 9, 2017
14+
1415
By Github Issue [#868](https://github.com/shakacode/react_on_rails/issues/868)
1516

1617
![image](https://user-images.githubusercontent.com/1118459/26994714-9aac5bb4-4d1d-11e7-8091-a3b08da9b319.png)
1718

1819
### May 6, 2017
20+
1921
By Email
2022

2123
![image](https://cloud.githubusercontent.com/assets/1118459/25869348/b1bd27ce-349b-11e7-912c-11d05ab2bf4d.png)
2224

2325
### April 6, 2017
26+
2427
Tyler Swayne on Medium: [Adding react to your node app](https://medium.com/@Tswaynee/adding-react-to-your-node-app-8707c5464b3)
2528

2629
![2017-04-06_16-11-51](https://cloud.githubusercontent.com/assets/1118459/24786595/75bb2b9c-1afe-11e7-8051-8c9046c4e007.png)
2730

2831
### March 23, 2017
32+
2933
Github issue [#766](https://github.com/shakacode/react_on_rails/issues/766).
3034

3135
![2017-03-23_17-43-17](https://cloud.githubusercontent.com/assets/1118459/24279884/badab166-0ff0-11e7-87ab-94253f55a3d9.png)
3236

3337
### March 21, 2017
38+
3439
Twitter from [@rfc2616](https://twitter.com/rfc2616)
3540

3641
![2017-03-24_20-20-20](https://cloud.githubusercontent.com/assets/1118459/24319983/7adfd57a-10cf-11e7-9a50-5c23d5d5bcab.png)
3742

3843
### March 2, 2017
44+
3945
![2017-03-05_21-34-34](https://cloud.githubusercontent.com/assets/1118459/23600716/0d8c40d6-01ec-11e7-998d-4ce9e6abcacb.png)
4046

4147
### February 24, 2017
48+
4249
"I ❤️ React on Rails because it's easy to drop into a Rails project and still get all the power of native JavaScript tooling. The generators are great and the community is so awesome and welcoming. In fact, I love it so much I made a [course for learning React with Rails](https://goo.gl/uzu36X) using the react_on_rails gem!"
4350
![The Complete React on Rails course](https://raw.githubusercontent.com/learnetto/calreact/whyror/public/why_react_on_rails_gem.png)
4451

4552
### December 20, 2016
53+
4654
![2016-12-25_10-02-17](https://cloud.githubusercontent.com/assets/1118459/21472700/70242a1e-ca89-11e6-9522-fb45f7835bbb.png)
4755

4856
### December 12, 2016
57+
4958
![2016-12-17_13-23-21](https://cloud.githubusercontent.com/assets/1118459/21290377/1adacdf2-c45c-11e6-97c1-f726ab749b2d.png)
5059

5160
### November 15, 2016
61+
5262
![2016-11-15_18-15-31](https://cloud.githubusercontent.com/assets/1118459/20334680/23eaab0c-ab60-11e6-8830-8528c2f829a3.png)
5363

5464
### November 9, 2016, in our Slack Room for ShakaCode
65+
5566
![2016-11-09_19-28-32](https://cloud.githubusercontent.com/assets/1118459/20163679/405229ca-a6b3-11e6-8dff-6dc3f59bf341.png)
5667

5768
### November 6, 2016
69+
5870
https://github.com/shakacode/react_on_rails/pull/591#issuecomment-258685925
5971
![2016-11-15_08-36-29](https://cloud.githubusercontent.com/assets/1118459/20318599/ec4882b0-ab0e-11e6-83e2-7f398e2cdf5b.png)
6072

6173
### October 29, 2016
74+
6275
by Email
6376
![2016-10-29_17-10-25](https://cloud.githubusercontent.com/assets/1118459/20163712/72307a82-a6b3-11e6-9c46-aee526192b23.png)
6477

6578
### September 11, 2016
79+
6680
![2016-09-11_17-55-46](https://cloud.githubusercontent.com/assets/1118459/18424209/0c8bdade-7849-11e6-96a7-3b58b26308ce.png)
6781

6882
### August 9, 2016
83+
6984
![2016-08-09_13-39-08](https://cloud.githubusercontent.com/assets/1118459/17543077/bf7c2c6a-5e69-11e6-8370-d714015c0296.png)
7085

7186
### June 15, 2016
87+
7288
![2016-06-15_08-57-25](https://cloud.githubusercontent.com/assets/1118459/16093324/33077310-32d7-11e6-88f3-69aa73bd7d9f.png)
7389

74-
### May 11, 2016
90+
### May 11, 2016
91+
7592
![2016-05-11_01-17-57](https://cloud.githubusercontent.com/assets/1118459/15179255/47418adc-1716-11e6-975e-c659a7de54d7.png)
7693

7794
![2016-05-11_00-54-57](https://cloud.githubusercontent.com/assets/1118459/15178739/1549ec2a-1713-11e6-961c-dc064186fc69.png)
7895

7996
### May 10, 2016
97+
8098
![2016-05-10_18-19-32](https://cloud.githubusercontent.com/assets/1118459/15170483/f00e344c-16e1-11e6-93f6-ded2637b227b.png)
8199

82100
### March 30, 2016
101+
83102
"Gone are the days of using bower or rails gems to manage front end dependencies! React on Rails provides webpack integration to give us a modern build process, es6 syntax and the entire npm ecosystem of libraries to use, along with view helpers to make React integration with Rails feel better than a cool summer breeze." - [@kalamyty](https://twitter.com/kalamyty), [flynfish](https://github.com/flynfish).
84103

85104
### March 25, 2016
105+
86106
https://twitter.com/ollieglass/status/713372606804729856
87107

88108
![2016-03-25_07-40-01](https://cloud.githubusercontent.com/assets/1118459/14053652/d05480f0-f276-11e5-9d9a-62d1146cd82d.png)
89109

90110
### March 23, 2016, Compared to Browserify
111+
91112
See comments [here](https://lorefnon.me/2015/11/15/a-minimal-setup-for-using-es6-modules-in-rails.html)
92113

93114
![2016-03-23_16-24-51](https://cloud.githubusercontent.com/assets/1118459/14006786/ebf8cac2-f114-11e5-80f9-4a6d437dd071.png)

0 commit comments

Comments
 (0)