react_on_rails 11.2.2 → 11.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +4 -2
- data/CHANGELOG.md +11 -3
- data/Gemfile +1 -1
- data/README.md +12 -7
- data/SUMMARY.md +2 -1
- data/docs/api/view-helpers-api.md +1 -1
- data/docs/basics/minitest-configuration.md +31 -0
- data/docs/basics/rspec-configuration.md +2 -2
- data/docs/basics/upgrading-react-on-rails.md +11 -1
- data/docs/testimonials/testimonials.md +3 -3
- data/docs/tutorial.md +4 -4
- data/lib/react_on_rails/helper.rb +7 -1
- data/lib/react_on_rails/react_component/render_options.rb +4 -0
- data/lib/react_on_rails/version.rb +1 -1
- data/package.json +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0bb16eb9dbe881e26404d0348b398cbf8fe74cc635b070830444b590b603b680
|
4
|
+
data.tar.gz: ff2fc0cde5a0a74959a6539ffec333f5350c913de8d14fe8650d3b9980a3d8c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c868503c83f7af1b8cf3c2a6a297b045606cb26eaec5580d07ac1567e8d768071720cd5f7c497c576113cd78d0a70bfc677be125d54840b49480766c4662b47
|
7
|
+
data.tar.gz: 8dcaf2739c09a9689782a7a3e0f58036b86b88ce01092369e58296fc6235ffac4f18df3f8f19ead5db5d21c8ba53860da789d0b59994b220e96935d0fe39c904
|
data/.travis.yml
CHANGED
@@ -7,7 +7,7 @@ rvm:
|
|
7
7
|
- 2.3.8
|
8
8
|
- 2.4.5
|
9
9
|
- 2.5.3
|
10
|
-
- 2.
|
10
|
+
- 2.6.0
|
11
11
|
- 2.2.10
|
12
12
|
services:
|
13
13
|
- docker
|
@@ -37,7 +37,7 @@ before_install:
|
|
37
37
|
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen scn 1600x1200x16"
|
38
38
|
|
39
39
|
install:
|
40
|
-
- travis_retry gem install bundler
|
40
|
+
- travis_retry gem install bundler -v '<2' # Ruby 2.2 and Rails 3.2 & 4.2 depend on bundler 1.x.
|
41
41
|
- travis_retry nvm install 8.11.3
|
42
42
|
- node -v
|
43
43
|
- travis_retry npm i -g yarn
|
@@ -60,6 +60,8 @@ matrix:
|
|
60
60
|
rvm: 2.4.5
|
61
61
|
- gemfile: spec/dummy_no_webpacker/Gemfile.rails32
|
62
62
|
rvm: 2.5.3
|
63
|
+
- gemfile: spec/dummy_no_webpacker/Gemfile.rails32
|
64
|
+
rvm: 2.6.0
|
63
65
|
- gemfile: spec/dummy/Gemfile
|
64
66
|
rvm: 2.2.10
|
65
67
|
|
data/CHANGELOG.md
CHANGED
@@ -15,6 +15,13 @@ Please follow the recommendations outlined at [keepachangelog.com](http://keepac
|
|
15
15
|
Changes since last non-beta release.
|
16
16
|
|
17
17
|
*Please add entries here for your pull requests that are not yet released.*
|
18
|
+
### [11.3.0] - 2019-04-20
|
19
|
+
#### Added
|
20
|
+
- Added method for retrieving any option from `render_options` [PR 1213](https://github.com/shakacode/react_on_rails/pull/1213)
|
21
|
+
by [ashgaliyev](https://github.com/ashgaliyev).
|
22
|
+
|
23
|
+
- html_options can now has option for 'tag' to add dynamically html element. like this: `html_options: { tag: "span" }`.
|
24
|
+
[PR 1208](https://github.com/shakacode/react_on_rails/pull/1208) by [tahsin352](https://github.com/tahsin352).
|
18
25
|
|
19
26
|
### [11.2.2] - 2018-12-24
|
20
27
|
#### Improved
|
@@ -25,9 +32,9 @@ Changes since last non-beta release.
|
|
25
32
|
- If using **React on Rails Pro**, upgrade react_on_rails_pro to a version >= 1.3.
|
26
33
|
|
27
34
|
#### Improved
|
28
|
-
- To support React v16, updated API for manually calling `ReactOnRails.render(name, props, domNodeId, hydrate)`. Added 3rd @param hydrate Pass truthy to update server rendered html. Default is falsey Any truthy values calls hydrate rather than render. (https://github.com/shakacode/react_on_rails/pull/1159) by [justin808](https://github.com/justin808) and [coopersamuel](https://github.com/coopersamuel).
|
35
|
+
- To support React v16, updated API for manually calling `ReactOnRails.render(name, props, domNodeId, hydrate)`. Added 3rd @param hydrate Pass truthy to update server rendered html. Default is falsey Any truthy values calls hydrate rather than render. [PR 1159](https://github.com/shakacode/react_on_rails/pull/1159) by [justin808](https://github.com/justin808) and [coopersamuel](https://github.com/coopersamuel).
|
29
36
|
|
30
|
-
- Enabled the use of webpack-dev-server with Server-side rendering. (https://github.com/shakacode/react_on_rails/pull/1173) by [justin808](https://github.com/justin808) and [judahmeek](https://github.com/judahmeek).
|
37
|
+
- Enabled the use of webpack-dev-server with Server-side rendering. [PR 1173](https://github.com/shakacode/react_on_rails/pull/1173) by [justin808](https://github.com/justin808) and [judahmeek](https://github.com/judahmeek).
|
31
38
|
|
32
39
|
#### Changed
|
33
40
|
- Changed the default for:
|
@@ -864,7 +871,8 @@ Best done with Object destructing:
|
|
864
871
|
##### Fixed
|
865
872
|
- Fix several generator related issues.
|
866
873
|
|
867
|
-
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/11.
|
874
|
+
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/11.3.0...master
|
875
|
+
[11.3.0]: https://github.com/shakacode/react_on_rails/compare/11.2.2...11.3.0
|
868
876
|
[11.2.2]: https://github.com/shakacode/react_on_rails/compare/11.2.1...11.2.2
|
869
877
|
[11.2.1]: https://github.com/shakacode/react_on_rails/compare/11.1.8...11.2.1
|
870
878
|
[11.1.8]: https://github.com/shakacode/react_on_rails/compare/11.1.7...11.1.8
|
data/Gemfile
CHANGED
@@ -30,11 +30,11 @@ gem "web-console", group: :development
|
|
30
30
|
# below are copied from spec/dummy/Gemfile
|
31
31
|
gem "capybara"
|
32
32
|
gem "capybara-screenshot"
|
33
|
-
gem "chromedriver-helper"
|
34
33
|
gem "launchy"
|
35
34
|
gem "rspec-rails"
|
36
35
|
gem "rspec-retry"
|
37
36
|
gem "selenium-webdriver"
|
37
|
+
gem "webdrivers", "~> 3.0"
|
38
38
|
gem "webpacker"
|
39
39
|
|
40
40
|
gem "equivalent-xml", github: "mbklein/equivalent-xml"
|
data/README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
# ReactOnRails
|
2
2
|
|
3
|
-
[![License](https://img.shields.io/badge/license-mit-green.svg)](./LICENSE.md) [![Build Status](https://travis-ci.org/shakacode/react_on_rails.svg?branch=master)](https://travis-ci.org/shakacode/react_on_rails) [![
|
3
|
+
[![License](https://img.shields.io/badge/license-mit-green.svg)](./LICENSE.md) [![Build Status](https://travis-ci.org/shakacode/react_on_rails.svg?branch=master)](https://travis-ci.org/shakacode/react_on_rails) [![Gem Version](https://badge.fury.io/rb/react_on_rails.svg)](https://badge.fury.io/rb/react_on_rails) [![npm version](https://badge.fury.io/js/react-on-rails.svg)](https://badge.fury.io/js/react-on-rails) [![Code Climate](https://codeclimate.com/github/shakacode/react_on_rails/badges/gpa.svg)](https://codeclimate.com/github/shakacode/react_on_rails) [![Coverage Status](https://coveralls.io/repos/shakacode/react_on_rails/badge.svg?branch=master&service=github)](https://coveralls.io/github/shakacode/react_on_rails?branch=master) [![](https://ruby-gem-downloads-badge.herokuapp.com/react_on_rails?type=total)](https://rubygems.org/gems/react_on_rails)
|
4
4
|
|
5
5
|
React on Rails integrates Rails with (server rendering of) Facebook's [React](https://github.com/facebook/react) front-end framework.
|
6
6
|
|
7
|
-
Interested in optimizing your webpack setup for React on Rails including code splitting with react-router v4, webpack v4, and react-loadable? [Contact
|
7
|
+
Interested in optimizing your webpack setup for React on Rails including code splitting with react-router v4, webpack v4, and react-loadable with server side rendering? [Contact Justin Gordon](mailto:justin@shakacode.com).
|
8
8
|
|
9
9
|
# Intro
|
10
10
|
|
@@ -17,12 +17,13 @@ To provide an opinionated and optimal framework for integrating Ruby on Rails wi
|
|
17
17
|
Given that rails/webpacker gem already provides basic React integration, why would you use "React on Rails"?
|
18
18
|
|
19
19
|
1. Server rendering, often used for SEO crawler indexing and UX performance, is not offered by rails/webpacker.
|
20
|
-
1. The easy passing of props directly from your Rails view to your React components rather than having your Rails view load and then make a separate
|
21
|
-
1. [Redux](https://github.com/reactjs/redux) and [React Router](https://github.com/reactjs/react-router) integration.
|
20
|
+
1. The easy passing of props directly from your Rails view to your React components rather than having your Rails view load and then make a separate request to your API.
|
21
|
+
1. [Redux](https://github.com/reactjs/redux) and [React Router](https://github.com/reactjs/react-router) integration with server-side-rendering.
|
22
22
|
1. [Internationalization (I18n) and (localization)](https://github.com/shakacode/react_on_rails/blob/master/docs/basics/i18n.md)
|
23
|
-
1. [RSpec Test Helpers Configuration](docs/basics/rspec-configuration.md) to ensure your Webpack bundles are ready for tests.
|
23
|
+
1. [RSpec Test Helpers Configuration](docs/basics/rspec-configuration.md) to ensure your Webpack bundles are ready for tests. _(and for [Minitest](docs/basics/minitest-configuration.md))._
|
24
24
|
1. A supportive community. This [web search shows how live public sites are using React on Rails](https://publicwww.com/websites/%22react-on-rails%22++-undeveloped.com/).
|
25
|
-
1. [Reason ML Support](https://github.com/shakacode/reason-react-on-rails-example)
|
25
|
+
1. [Reason ML Support](https://github.com/shakacode/reason-react-on-rails-example).
|
26
|
+
|
26
27
|
|
27
28
|
See the [react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial) for an example of a live implementation and code.
|
28
29
|
|
@@ -325,10 +326,14 @@ Bug reports and pull requests are welcome. See [Contributing](CONTRIBUTING.md) t
|
|
325
326
|
|
326
327
|
# Supporters
|
327
328
|
|
328
|
-
The following companies support this open source project, and ShakaCode uses their products! Justin writes React on Rails on [RubyMine](https://www.jetbrains.com/ruby/). We use [Scout](https://scoutapp.com/) to monitor the live performance of [HawaiiChee.com](https://www.hawaiichee.com),
|
329
|
+
The following companies support this open source project, and ShakaCode uses their products! Justin writes React on Rails on [RubyMine](https://www.jetbrains.com/ruby/). We use [Scout](https://scoutapp.com/) to monitor the live performance of [HawaiiChee.com](https://www.hawaiichee.com), [BrowserStack](https://www.browserstack.com) to solve problems with oddball browsers, and [CodersRank](https://codersrank.io/) to find candidates for our team.
|
329
330
|
|
330
331
|
[![Scout](https://user-images.githubusercontent.com/1118459/41828269-106b40f8-77d0-11e8-8d19-9c4b167ef9d8.png)](https://scoutapp.com/)
|
331
332
|
[![BrowserStack](https://cloud.githubusercontent.com/assets/1118459/23203304/1261e468-f886-11e6-819e-93b1a3f17da4.png)](https://www.browserstack.com)
|
333
|
+
[![CodersRank](https://user-images.githubusercontent.com/1118459/55040254-ad8a7b00-4fcb-11e9-8936-c6765eb30698.png)](https://codersrank.io/?utm_source=github&utm_medium=banner&utm_campaign=shakacode)
|
334
|
+
|
335
|
+
## Clubhouse
|
336
|
+
I've just moved ShakaCode's development to [ClubHouse](https://clubhouse.io/) from Trello. We're going to be doing this with all our projects. If you want to **try ClubHouse and get 2 months free beyond the 14-day trial period**, click [here to use ShakaCode's referral code](http://r.clbh.se/mvfd30S). We're participating in their awesome triple-sided referral program, which you can read about [here](https://clubhouse.io/blog/clubhouse-referral-program-5f614bb437c3). By using our [referral code](http://r.clbh.se/mvfd30S) you'll be supporting ShakaCode and, thus, React on Rails!
|
332
337
|
|
333
338
|
*If you'd like to support React on Rails and have your company listed here, [get in touch](mailto:justin@shakacode.com).*
|
334
339
|
|
data/SUMMARY.md
CHANGED
@@ -14,6 +14,7 @@
|
|
14
14
|
+ [Deployment](docs/basics/deployment.md).
|
15
15
|
+ [React on Rails Internationalization (I18n, localization)](docs/basics/i18n.md)
|
16
16
|
+ [RSpec Test Helpers Configuration](docs/basics/rspec-configuration.md)
|
17
|
+
+ [Minitest Configuration](docs/basics/minitest-configuration.md)
|
17
18
|
+ [Upgrading React on Rails](docs/basics/upgrading-react-on-rails.md)
|
18
19
|
|
19
20
|
## **API**
|
@@ -40,7 +41,7 @@
|
|
40
41
|
+ [Babel](./docs/additional-reading/babel.md)
|
41
42
|
+ [React Router](./docs/additional-reading/react-router.md)
|
42
43
|
+ [React & Redux](./docs/additional-reading/react-and-redux.md)
|
43
|
-
+ [Webpack Tips](./docs/additional-reading/webpack
|
44
|
+
+ [Webpack Tips](./docs/additional-reading/webpack.md)
|
44
45
|
+ [Server Rendering Tips](./docs/additional-reading/server-rendering-tips.md)
|
45
46
|
+ [Code Splitting](docs/misc-pending/code-splitting.md)
|
46
47
|
+ [AngularJS Integration and Migration to React on Rails](./docs/additional-reading/angular-js-integration-migration.md)
|
@@ -28,7 +28,7 @@ Uncommonly used options:
|
|
28
28
|
- **props:** Ruby Hash which contains the properties to pass to the react object, or a JSON string. If you pass a string, we'll escape it for you.
|
29
29
|
- **prerender:** enable server-side rendering of a component. Set to false when debugging!
|
30
30
|
- **id:** Id for the div, will be used to attach the React component. This will get assigned automatically if you do not provide an id. Must be unique.
|
31
|
-
- **html_options:** Any other HTML options get placed on the added div for the component. For example, you can set a class (or inline style) on the outer div so that it behaves like a span, with the styling of `display:inline-block`.
|
31
|
+
- **html_options:** Any other HTML options get placed on the added div for the component. For example, you can set a class (or inline style) on the outer div so that it behaves like a span, with the styling of `display:inline-block`. You may also use an option of `tag: "span"` to replace the use of the default DIV tag to be a SPAN tag.
|
32
32
|
- **trace:** set to true to print additional debugging information in the browser. Defaults to true for development, off otherwise. Only on the **client side** will you will see the `railsContext` and your props.
|
33
33
|
- **random_dom_id:** True to automatically generate random dom ids when using multiple instances of the same React component on one Rails view.
|
34
34
|
- **options if prerender (server rendering) is true:**
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# Minitest Configuration
|
2
|
+
|
3
|
+
The setup for minitest is the same as for rspec with the following difference.
|
4
|
+
|
5
|
+
Rather than calling `ReactOnRails::TestHelper.configure_rspec_to_compile_assets(config)`, instead you will do something like this:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
class ActiveSupport::TestCase
|
9
|
+
setup do
|
10
|
+
ReactOnRails::TestHelper.ensure_assets_compiled
|
11
|
+
end
|
12
|
+
end
|
13
|
+
```
|
14
|
+
|
15
|
+
|
16
|
+
Or maybe something like this, from the [minitest docs](https://github.com/seattlerb/minitest/blob/master/lib/minitest/test.rb#L119):
|
17
|
+
|
18
|
+
```ruby
|
19
|
+
module MyMinitestPlugin
|
20
|
+
def before_setup
|
21
|
+
super
|
22
|
+
ReactOnRails::TestHelper.ensure_assets_compiled
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
class MiniTest::Test
|
27
|
+
include MyMinitestPlugin
|
28
|
+
end
|
29
|
+
```
|
30
|
+
|
31
|
+
|
@@ -1,4 +1,6 @@
|
|
1
1
|
# RSpec Configuration
|
2
|
+
_Click [here for minitest](./minitest-configuration.md)_
|
3
|
+
|
2
4
|
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.
|
3
5
|
|
4
6
|
ReactOnRails provides a helper method called `ReactOnRails::TestHelper.configure_rspec_to_compile_assets`. Call this method from inside of the `RSpec.configure` block in your `spec/rails_helper.rb` file, passing the config as an argument. See file [lib/react_on_rails/test_helper.rb](../../lib/react_on_rails/test_helper.rb) for more details. You can customize this to your particular needs by replacing any of the default components used by `ReactOnRails::TestHelper.configure_rspec_to_compile_assets`.
|
@@ -55,8 +57,6 @@ If you want to speed up the re-compiling process so you don't wait to run your t
|
|
55
57
|
|
56
58
|
[spec/dummy](https://github.com/shakacode/react_on_rails/tree/master/spec/dummy) contains examples of how to set the proc files for this purpose.
|
57
59
|
|
58
|
-
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.
|
59
|
-
|
60
60
|
![2016-01-27_02-36-43](https://cloud.githubusercontent.com/assets/1118459/12611951/7c56d070-c4a4-11e5-8a80-9615f99960d9.png)
|
61
61
|
|
62
62
|
![2016-01-27_03-18-05](https://cloud.githubusercontent.com/assets/1118459/12611975/a8011654-c4a4-11e5-84f9-1baca4835b4b.png)
|
@@ -5,12 +5,22 @@ If you would like help in migrating between React on Rails versions or help with
|
|
5
5
|
|
6
6
|
We specialize in helping companies to quickly and efficiently move from versions before 9 to current. 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.
|
7
7
|
|
8
|
+
## Upgrading rails/webpacker from v3 to v4
|
9
|
+
### Custom Webpack build file
|
10
|
+
The default value for `extract_css` is **false** in `config/webpack.yml`. Custom webpack builds should set this value to true or else no CSS link tags are generated. You have a custom webpack build if you are not using [rails/webpacker](https://github.com/rails/webpacker to setup your Webpack configuration.
|
11
|
+
|
12
|
+
```yml
|
13
|
+
default: &default
|
14
|
+
# other stuff
|
15
|
+
extract_css: true
|
16
|
+
# by default, extract and emit a css file. The default is false
|
17
|
+
```
|
18
|
+
|
8
19
|
## Upgrading to version 11
|
9
20
|
* Remove `server_render_method` from config/initializers/react_on_rails.rb. Alternate server rendering methods are part of React on Rails Pro. If you want to use a custom renderer, contact justin@shakacode.com. We have a custom node rendering solution in production for egghead.io.
|
10
21
|
* Remove your usage of ENV["TRACE_REACT_ON_RAILS"] usage. You can get all tracing with either specifying **`trace`** at your component or in your config/initializers/react_on_rails.rb file.
|
11
22
|
* ReactOnRails::Utils.server_bundle_file_name and ReactOnRails::Utils.bundle_file_name were removed. React on Rails Pro contains upgrades to enable component and other types caching with React on Rails.
|
12
23
|
|
13
|
-
|
14
24
|
## Upgrading to version 10
|
15
25
|
|
16
26
|
Pretty simple:
|
@@ -1,13 +1,13 @@
|
|
1
1
|
# Testimonials
|
2
|
-
# [HVMN Testimonial, Written by Paul Benigeri, October 12, 2018](./
|
2
|
+
# [HVMN Testimonial, Written by Paul Benigeri, October 12, 2018](./hvmn.md)
|
3
3
|
|
4
4
|
> The price we paid for the consultation + the React on Rails pro license has already been made back a couple of times from hosting fees alone. The entire process was super hands off, and our core team was able to focus on shipping new feature during that sprint.
|
5
5
|
|
6
|
-
Full writeup [here](./
|
6
|
+
Full writeup [here](./hvmn.md).
|
7
7
|
|
8
8
|
---
|
9
9
|
|
10
|
-
# [Leora from ResortPass](./
|
10
|
+
# [Leora from ResortPass](./resortpass.md), December 10, 2018
|
11
11
|
|
12
12
|
Justin and his team were instrumental in assisting us in setting design foundations and standards for our transition to a react on rails application. Just three months of work with the team at Shaka code and we have a main page of our application server-side rendering at exponentially improved speeds.
|
13
13
|
|
data/docs/tutorial.md
CHANGED
@@ -57,7 +57,7 @@ bundle exec rails webpacker:install
|
|
57
57
|
bundle exec rails webpacker:install:react
|
58
58
|
```
|
59
59
|
|
60
|
-
Add the **React On Rails** gem to your Gemfile
|
60
|
+
Add the **React On Rails** gem to your `Gemfile`:
|
61
61
|
|
62
62
|
```
|
63
63
|
gem 'react_on_rails', '11.2.1' # prefer exact gem version to match npm version
|
@@ -101,7 +101,7 @@ Note, foreman defaults to PORT 5000 unless you set the value of PORT in your env
|
|
101
101
|
## Using a pre-release of rails/webpacker
|
102
102
|
Until `rails/webpacker` v4 ships, or if you ever want to try out the master branch, you can modify the React on Rails tutorial instructions slightly. You can see the sequence of commits here. To summarize:
|
103
103
|
|
104
|
-
Don't
|
104
|
+
**Don't run `rails new` with the `--webpack=react` option**. Instead, add the webpacker gem to the Gemfile such that it points to master, like this if `11.2.1` is the version you want.
|
105
105
|
|
106
106
|
```ruby
|
107
107
|
gem 'webpacker', github: "rails/webpacker"
|
@@ -243,7 +243,7 @@ end
|
|
243
243
|
Then after all changes are done don't forget to commit them with git and finally you can push your app to Heroku!
|
244
244
|
|
245
245
|
```
|
246
|
-
git add -
|
246
|
+
git add -A
|
247
247
|
git commit -m "Changes for Heroku"
|
248
248
|
git push heroku master
|
249
249
|
```
|
@@ -268,7 +268,7 @@ You can turn on server rendering by simply changing the `prerender` option to `t
|
|
268
268
|
Then push to Heroku:
|
269
269
|
|
270
270
|
```
|
271
|
-
git add -
|
271
|
+
git add -A
|
272
272
|
git commit -m "Enable server rendering"
|
273
273
|
git push heroku master
|
274
274
|
```
|
@@ -339,9 +339,15 @@ module ReactOnRails
|
|
339
339
|
render_options: required("render_options")
|
340
340
|
)
|
341
341
|
content_tag_options = render_options.html_options
|
342
|
+
if content_tag_options.key?(:tag)
|
343
|
+
content_tag_options_html_tag = content_tag_options[:tag]
|
344
|
+
content_tag_options.delete(:tag)
|
345
|
+
else
|
346
|
+
content_tag_options_html_tag = "div"
|
347
|
+
end
|
342
348
|
content_tag_options[:id] = render_options.dom_id
|
343
349
|
|
344
|
-
rendered_output = content_tag(
|
350
|
+
rendered_output = content_tag(content_tag_options_html_tag.to_sym,
|
345
351
|
server_rendered_html.html_safe,
|
346
352
|
content_tag_options)
|
347
353
|
|
data/package.json
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: react_on_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 11.
|
4
|
+
version: 11.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Gordon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -396,6 +396,7 @@ files:
|
|
396
396
|
- docs/basics/i18n.md
|
397
397
|
- docs/basics/installation-into-an-existing-rails-app.md
|
398
398
|
- docs/basics/migrating-from-react-rails.md
|
399
|
+
- docs/basics/minitest-configuration.md
|
399
400
|
- docs/basics/react-server-rendering.md
|
400
401
|
- docs/basics/recommended-project-structure.md
|
401
402
|
- docs/basics/rspec-configuration.md
|
@@ -517,7 +518,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
517
518
|
version: '0'
|
518
519
|
requirements: []
|
519
520
|
rubyforge_project:
|
520
|
-
rubygems_version: 2.7.
|
521
|
+
rubygems_version: 2.7.9
|
521
522
|
signing_key:
|
522
523
|
specification_version: 4
|
523
524
|
summary: Rails with react server rendering with webpack.
|