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: docs/advanced-topics/rails-engine-integration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,7 @@ As far as solving the assets issue, `lib/tasks/assets.rake` in `react_on_rails`
32
32
33
33
Another solution would be to detach this rake task from the `rails assets:precompile` task. This can be done by adding `REACT_ON_RAILS_PRECOMPILE=false` to your environment. If you do so, then React assets will have to be bundled separately from `rails assets:precompile`.
34
34
35
-
# Github Issues
35
+
##Github Issues
36
36
37
37
-[Integration with an engine #342](https://github.com/shakacode/react_on_rails/issues/342)
38
38
-[Feature: target destination option for the install generator #459](https://github.com/shakacode/react_on_rails/issues/459)
Copy file name to clipboardExpand all lines: docs/api-reference/generator-details.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Then you may run
39
39
40
40
Another good option is to create a simple test app per the [Tutorial](../getting-started/tutorial.md).
41
41
42
-
# Understanding the Organization of the Generated Client Code
42
+
##Understanding the Organization of the Generated Client Code
43
43
44
44
The generated client code follows our organization scheme. Each unique set of functionality is given its own folder inside of `app/javascript/app/bundles`. This encourages modularity of _domains_.
45
45
@@ -51,7 +51,7 @@ Inside the generated "HelloWorld" domain you will find the following folders:
51
51
52
52
You may also notice the `app/lib` folder. This is for any code that is common between bundles and therefore needs to be shared (for example, middleware).
53
53
54
-
## Redux
54
+
###Redux
55
55
56
56
If you have used the `--redux` generator option, you will notice the familiar additional redux folders in addition to the aforementioned folders. The Hello World example has also been modified to use Redux.
Copy file name to clipboardExpand all lines: docs/api-reference/redux-store-api.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,7 +98,7 @@ This method has the same API as the controller extension. **HOWEVER**, we recomm
98
98
99
99
Place this view helper (no parameters) at the end of your shared layout so ReactOnRails will render the redux store hydration data. Since we're going to be setting up the stores in the controllers, we need to know where on the view to put the client-side rendering of this hydration data, which is a hidden div with a matching class that contains a data props. For an example, see [spec/dummy/app/views/layouts/application.html.erb](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy/app/views/layouts/application.html.erb).
Copy file name to clipboardExpand all lines: docs/building-features/i18n.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ By default, the locales are generated as JSON, but you can also generate them as
92
92
)
93
93
```
94
94
95
-
# Notes
95
+
##Notes
96
96
97
97
- See why using JSON can perform better compared to JS for large amounts of data [https://v8.dev/blog/cost-of-javascript-2019#json](https://v8.dev/blog/cost-of-javascript-2019#json).
98
98
- See [Support for Rails' i18n pluralization #1000](https://github.com/shakacode/react_on_rails/issues/1000) for a discussion of issues around pluralization.
Copy file name to clipboardExpand all lines: docs/building-features/react-and-redux.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@
4
4
5
5
See [Sharing State Between Components](https://react.dev/learn/sharing-state-between-components).
6
6
7
-
# Redux Reducers
7
+
##Redux Reducers
8
8
9
9
The `helloWorld/reducers/index.jsx` example that results from running the generator with the Redux option may be slightly confusing because of its simplicity. For clarity, what follows is a more fleshed-out example of what a reducer might look like:
Which should you use? If you're already using the `Shakapacker` way to configure Webpack, then
21
21
you can keep things simple and use the `Shakapacker` options.
22
22
23
-
# Checking for stale assets using React on Rails
23
+
##Checking for stale assets using React on Rails
24
24
25
25
Because you will probably want to run RSpec tests that rely on compiled Webpack assets (typically, your integration/feature specs where `js: true`), you will want to ensure you don't accidentally run tests on missing or stale Webpack assets. If you did use stale Webpack assets, you will get invalid test results as your tests do not use the very latest JavaScript code.
Trying out **React on Rails** is super easy, so long as you have the basic prerequisites.
50
50
@@ -54,7 +54,7 @@ Trying out **React on Rails** is super easy, so long as you have the basic prere
54
54
-**yarn:** We use [yarn classic](https://classic.yarnpkg.com/) as our node package manager.
55
55
- You need to have either [Overmind](https://github.com/DarthSim/overmind) or [Foreman](https://rubygems.org/gems/foreman) as a process manager.
56
56
57
-
## Create a new Ruby on Rails App
57
+
###Create a new Ruby on Rails App
58
58
59
59
Then we need to create a fresh Rails application as follows.
60
60
@@ -72,7 +72,7 @@ cd test-react-on-rails
72
72
73
73
Note: You can use `--database=postgresql` option to use Postgresql for the database.
74
74
75
-
## Add the Shakapacker and react_on_rails gems
75
+
###Add the Shakapacker and react_on_rails gems
76
76
77
77
We recommend using the latest version of these gems. Otherwise, specify the
78
78
exact versions of both the gem and npm packages. In other words, don't use
@@ -86,7 +86,7 @@ bundle add shakapacker --strict
86
86
Note: The latest released React On Rails version is considered stable. Please use the latest
87
87
version to ensure you get all the security patches and the best support.
If you prefer to use React Hooks instead of Redux, run the basic installer without the `--redux` flag.
120
120
121
-
## Setting up your environment variables
121
+
###Setting up your environment variables
122
122
123
123
Add the following variable to your environment:
124
124
@@ -128,7 +128,7 @@ EXECJS_RUNTIME=Node
128
128
129
129
Then run the server with one of the following options:
130
130
131
-
## Running the app
131
+
###Running the app
132
132
133
133
```bash
134
134
./bin/dev # For HMR
@@ -138,7 +138,7 @@ Then run the server with one of the following options:
138
138
139
139
Visit [http://localhost:3000/hello_world](http://localhost:3000/hello_world) and see your **React On Rails** app running!
140
140
141
-
# HMR vs. React Hot Reloading
141
+
##HMR vs. React Hot Reloading
142
142
143
143
First, check that the `hmr` and the `inline` options are `true` in your `config/shakapacker.yml` file.
144
144
@@ -154,7 +154,7 @@ If you want to go further with HMR, take a look at these links:
154
154
155
155
React on Rails will automatically handle disabling server rendering if there is only one bundle file created by the Webpack development server by `shakapacker`.
156
156
157
-
# Deployment
157
+
##Deployment
158
158
159
159
Now that you have React on Rails working locally, you're ready to deploy to production!
160
160
@@ -171,9 +171,9 @@ These guides cover:
171
171
- Environment variables
172
172
- Troubleshooting common deployment issues
173
173
174
-
# Going Further
174
+
##Going Further
175
175
176
-
## Turning on Server Rendering
176
+
###Turning on Server Rendering
177
177
178
178
You can turn on server rendering by simply changing the `prerender` option to `true`:
179
179
@@ -217,9 +217,9 @@ For more details on server rendering, see:
217
217
-[Client vs. Server Rendering](../core-concepts/client-vs-server-rendering.md)
218
218
-[React Server Rendering](../core-concepts/react-server-rendering.md)
219
219
220
-
## Optional Configuration
220
+
###Optional Configuration
221
221
222
-
### Moving from the Rails default `/app/javascript` to the recommended `/client` structure
222
+
####Moving from the Rails default `/app/javascript` to the recommended `/client` structure
223
223
224
224
ShakaCode recommends that you use `/client` for your client side app. This way a non-Rails, front-end developer can be at home just by opening up the `/client` directory.
225
225
@@ -235,7 +235,7 @@ mv app/javascript client
235
235
source_path: client
236
236
```
237
237
238
-
### Custom IP & PORT setup (Cloud9 example)
238
+
#### Custom IP & PORT setup (Cloud9 example)
239
239
240
240
In case you are running some custom setup with different IP or PORT you should also edit Procfile.dev. For example, to be able to run on free Cloud9 IDE we are putting IP 0.0.0.0 and PORT 8080. The default generated file `Procfile.dev` uses `-p 3000`.
0 commit comments