+
+
+ Hello,
+ Stranger!
+
+
+
+
+
```
For more details on server rendering, see:
- + [Client vs. Server Rendering](https://www.shakacode.com/react-on-rails/docs/guides/client-vs-server-rendering/)
- + [React Server Rendering](https://www.shakacode.com/react-on-rails/docs/guides/react-server-rendering/)
+- [Client vs. Server Rendering](https://www.shakacode.com/react-on-rails/docs/guides/client-vs-server-rendering/)
+- [React Server Rendering](https://www.shakacode.com/react-on-rails/docs/guides/react-server-rendering/)
## Moving from the Rails default `/app/javascript` to the recommended `/client` structure
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.
-
1. Move the directory:
```bash
@@ -338,18 +357,17 @@ When you change and save a JSX file, the browser will automatically refresh!
So you get some basics from HMR with no code changes. If you want to go further, take a look at these links:
-* [webpack-dev-server](https://github.com/rails/webpacker/blob/5-x-stable/docs/webpack-dev-server.md)
-* [DevServer](https://webpack.js.org/configuration/dev-server/)
-* [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/)
+- [webpack-dev-server](https://github.com/rails/webpacker/blob/5-x-stable/docs/webpack-dev-server.md)
+- [DevServer](https://webpack.js.org/configuration/dev-server/)
+- [Hot Module Replacement](https://webpack.js.org/concepts/hot-module-replacement/)
React on Rails will automatically handle disabling server rendering if there is only one bundle file created by the Webpack development server by `shakapcker`.
-
## Custom IP & PORT setup (Cloud9 example)
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`.
-``` Procfile.dev
+```Procfile.dev
web: rails s -p 8080 -b 0.0.0.0
```
@@ -359,12 +377,12 @@ Then visit https://your-shared-addr.c9users.io:8080/hello_world
It's super important to exclude certain directories from RubyMine or else it will slow to a crawl as it tries to parse all the npm files.
-* Generated files, per the settings in your `config/shakapacker.yml`, which default to `public/packs` and `public/packs-test`
-* `node_modules`
+- Generated files, per the settings in your `config/shakapacker.yml`, which default to `public/packs` and `public/packs-test`
+- `node_modules`
# Conclusion
-* Browse the docs on [our documentation website](https://www.shakacode.com/react-on-rails/docs/)
+- Browse the docs on [our documentation website](https://www.shakacode.com/react-on-rails/docs/)
Feedback is greatly appreciated! As are stars on github!
diff --git a/docs/guides/upgrading-react-on-rails.md b/docs/guides/upgrading-react-on-rails.md
index 4700c37b2..029cc7624 100644
--- a/docs/guides/upgrading-react-on-rails.md
+++ b/docs/guides/upgrading-react-on-rails.md
@@ -1,6 +1,7 @@
# Upgrading React on Rails
## Need Help Migrating?
+
If you would like help in migrating between React on Rails versions or help with implementing server rendering, please contact [justin@shakacode.com](mailto:justin@shakacode.com) for more information about our [React on Rails Pro Support](https://www.shakacode.com/react-on-rails-pro).
We specialize in helping companies to quickly and efficiently upgrade. The older versions use the Rails asset pipeline to package client assets. The current and recommended way is to use Webpack 4+ for asset preparation. You may also need help migrating from the `rails/webpacker`'s Webpack configuration to a better setup ready for Server Side Rendering.
@@ -8,6 +9,7 @@ We specialize in helping companies to quickly and efficiently upgrade. The older
## Upgrading to v13
### Breaking Change
+
Previously, the gem `webpacker` was a Gem dependency.
v13 has changed slightly to switch to `shakapacker`.
@@ -21,17 +23,21 @@ In summary:
3. Other updates, depending on what version of `rails/webpacker` that you had.
## Upgrading to v12
+
### Recent versions
+
Make sure that you are on a relatively more recent version of rails and webpacker. Yes, the [rails/webpacker](https://github.com/rails/webpacker) gem is required!
v12 is tested on Rails 6. It should work on Rails v5. If you're on any older version,
and v12 doesn't work, please file an issue.
### Removed Configuration config.symlink_non_digested_assets_regex
+
Remove `config.symlink_non_digested_assets_regex` from your `config/initializers/react_on_rails.rb`.
If you still need that feature, please file an issue.
### i18n default format changed to JSON
-* If you're using the internalization helper, then set `config.i18n_output_format = 'js'`. You can
+
+- If you're using the internalization helper, then set `config.i18n_output_format = 'js'`. You can
later update to the default JSON format as you will need to update your usage of that file. A JSON
format is more efficient.
@@ -46,36 +52,42 @@ more information on what a Render-Function is.
##### Update required for registered functions taking exactly 2 params.
Registered Objects are of the following type:
-1. **Function that takes only zero or one params and you return a React Element**, often JSX. If the function takes zero or one params, there is **no migration needed** for that function.
- ```js
- export default (props) =>