react_on_rails 6.9.1 → 6.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -1
- data/CONTRIBUTING.md +3 -3
- data/README.md +2 -1
- data/app/helpers/react_on_rails_helper.rb +18 -11
- data/docs/misc/rails3.md +3 -1
- data/lib/react_on_rails/version.rb +1 -1
- data/lib/react_on_rails/version_checker.rb +1 -1
- data/package.json +1 -1
- data/rakelib/dummy_apps.rake +7 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1feb7e92a122d45ea39663ad12ce271559f06d3f
|
4
|
+
data.tar.gz: 5b2beacba9cbce3fb9aeb01cc98e2797c1b35fa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c64f6d6237d5480f684d92031b9deb3ec66fdb053801b999cae543155b13f867d72d4bd186382933295cc6f0b1f4d331287ef359cd58c7b040b46c8cef5e8368
|
7
|
+
data.tar.gz: b24a8ebdadc44cc8859fa9e9d30496e39544bdda792e33c806f00a85ed112ca91732e9c21caab518c5906c4cf2b6110f99a96afa5a4cfe89a2fa4f4cf423a34a
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,15 @@ Contributors: please follow the recommendations outlined at [keepachangelog.com]
|
|
5
5
|
|
6
6
|
## [Unreleased]
|
7
7
|
|
8
|
+
## [6.9.2] - 2017-04-02
|
9
|
+
|
10
|
+
### Changed
|
11
|
+
- Update version_checker.rb to `logger.error` rather than `logger.warn` for gem/npm version mismatch. [#788](https://github.com/shakacode/react_on_rails/issues/788) by [justin808](https://github.com/justin808).
|
12
|
+
|
13
|
+
### Fixed
|
14
|
+
- Remove pretty formatting of JSON in development. [#789](https://github.com/shakacode/react_on_rails/pull/789) by [justin808](https://github.com/justin808)
|
15
|
+
- Clear hydrated stores with each server rendered block. [#785](https://github.com/shakacode/react_on_rails/pull/785) by [udovenko](https://github.com/udovenko)
|
16
|
+
|
8
17
|
## [6.9.1] - 2017-03-30
|
9
18
|
|
10
19
|
### Fixed
|
@@ -509,7 +518,8 @@ Best done with Object destructing:
|
|
509
518
|
##### Fixed
|
510
519
|
- Fix several generator related issues.
|
511
520
|
|
512
|
-
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/6.9.
|
521
|
+
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/6.9.2...master
|
522
|
+
[6.9.2]: https://github.com/shakacode/react_on_rails/compare/6.9.1...6.9.2
|
513
523
|
[6.9.1]: https://github.com/shakacode/react_on_rails/compare/6.8.2...6.9.1
|
514
524
|
[6.9.0]: https://github.com/shakacode/react_on_rails/compare/6.8.2...6.9.0
|
515
525
|
[6.8.2]: https://github.com/shakacode/react_on_rails/compare/6.8.1...6.8.2
|
data/CONTRIBUTING.md
CHANGED
@@ -103,7 +103,7 @@ yarn run build
|
|
103
103
|
Install the local package by using a relative path in your test/client app's `package.json`, like this:
|
104
104
|
```sh
|
105
105
|
cd test/client
|
106
|
-
|
106
|
+
rm -rf node_modules/react-on-rails && npm i 'file:../path-to-react-on-rails-top-package.json'
|
107
107
|
```
|
108
108
|
_Note: You must use npm here till yarn stops preferring cached packages over local. see [issue #2649](https://github.com/yarnpkg/yarn/issues/2649)_
|
109
109
|
|
@@ -111,10 +111,10 @@ When you use a relative path, be sure to run the above `yarn` command whenever y
|
|
111
111
|
|
112
112
|
#### Example: Testing NPM changes with the dummy app
|
113
113
|
1. Add `console.log('Hello!')` [here](https://github.com/shakacode/react_on_rails/blob/master/node_package/src/clientStartup.js#L181) in `react_on_rails/node_package/src/clientStartup.js` to confirm we're getting an update to the node package.
|
114
|
-
2. Run the install script `npm run install-react-on-rails` in `react_on_rails/spec/dummy` to copy over our changes to the dummy app. Alternatively, you can run `npm i
|
114
|
+
2. Run the install script `npm run install-react-on-rails` in `react_on_rails/spec/dummy` to copy over our changes to the dummy app. Alternatively, you can run `rm -rf node_modules/react-on-rails && npm i 'file:../../../'` in `react_on_rails/spec/dummy/client`. Our NPM changes are now available in the dummy app.
|
115
115
|
3. 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.
|
116
116
|
|
117
|
-
_Note: running `npm i` automatically builds the npm package before installing. However, when using yarn you will need to run `yarn run build` in the root directory before the install script. This will be updated when yarn issue #2649 (above) is resolved._
|
117
|
+
_Note: running `npm i` automatically builds the npm package before installing. However, when using yarn you will need to run `yarn run build` in the root directory before the install script. This will be updated when [yarn issue #2649](https://github.com/yarnpkg/yarn/issues/2649) (above) is resolved._
|
118
118
|
|
119
119
|
# Development Setup for Gem and Node Package Contributors
|
120
120
|
|
data/README.md
CHANGED
@@ -563,7 +563,8 @@ Node.js can be used as the backend for server-side rendering instead of [execJS]
|
|
563
563
|
|
564
564
|
## Dependencies
|
565
565
|
+ Ruby 2.1 or greater
|
566
|
-
+ Rails
|
566
|
+
+ Rails 4.2 or greater
|
567
|
+
+ Rails 3.2 will work and is tested up to 6.8.x. We are not testing it for new releases. If you find an issue, you will have to submit a PR to get it fixed.
|
567
568
|
+ Node 5.5 or greater
|
568
569
|
|
569
570
|
## Contributing
|
@@ -223,16 +223,19 @@ module ReactOnRailsHelper
|
|
223
223
|
private
|
224
224
|
|
225
225
|
def json_safe_and_pretty(hash_or_string)
|
226
|
-
if Rails.env.development?
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
else
|
234
|
-
|
235
|
-
|
226
|
+
# if Rails.env.development?
|
227
|
+
# # TODO: for json_safe_and_pretty
|
228
|
+
# # 1. Add test
|
229
|
+
# # 2. Add error handler if cannot parse the string with nice message
|
230
|
+
# # 3. Consider checking that if not a string then a Hash
|
231
|
+
# hash_value = hash_or_string.is_a?(String) ? JSON.parse(hash_or_string) : hash_or_string
|
232
|
+
# ERB::Util.json_escape(JSON.pretty_generate(hash_value))
|
233
|
+
# else
|
234
|
+
#
|
235
|
+
# Temp fix given that a hash may contain active record objects and that crashed with the new
|
236
|
+
# code to JSON.pretty_generate
|
237
|
+
ERB::Util.json_escape(hash_or_string.to_json)
|
238
|
+
# end
|
236
239
|
end
|
237
240
|
|
238
241
|
# prepend the rails_context if not yet applied
|
@@ -341,7 +344,11 @@ module ReactOnRailsHelper
|
|
341
344
|
|
342
345
|
all_stores = (@registered_stores || []) + (@registered_stores_defer_render || [])
|
343
346
|
|
344
|
-
result =
|
347
|
+
result = <<-JS
|
348
|
+
ReactOnRails.clearHydratedStores();
|
349
|
+
JS
|
350
|
+
|
351
|
+
result << all_stores.each_with_object(declarations) do |redux_store_data, memo|
|
345
352
|
store_name = redux_store_data[:store_name]
|
346
353
|
props = props_string(redux_store_data[:props])
|
347
354
|
memo << <<-JS
|
data/docs/misc/rails3.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# Rails 3
|
2
2
|
|
3
|
-
Please let us know if you find any issues with Rails 3.
|
3
|
+
* Please let us know if you find any issues with Rails 3.
|
4
|
+
* Rails 3 is confirmed to work up with versions up to 6.8.x.
|
5
|
+
* We are not testing it for new releases. If you find an issue, you will have to submit a PR to get it fixed.
|
4
6
|
|
5
7
|
## Known Issues
|
6
8
|
|
@@ -31,7 +31,7 @@ module ReactOnRails
|
|
31
31
|
" node package: #{node_package_version.raw}\n" \
|
32
32
|
"Ensure the installed MAJOR version of the gem is the same as the MAJOR version of \n"\
|
33
33
|
"your installed node package."
|
34
|
-
logger.
|
34
|
+
logger.error(msg)
|
35
35
|
end
|
36
36
|
|
37
37
|
def gem_version
|
data/package.json
CHANGED
data/rakelib/dummy_apps.rake
CHANGED
@@ -2,16 +2,19 @@ require_relative "task_helpers"
|
|
2
2
|
include ReactOnRails::TaskHelpers
|
3
3
|
|
4
4
|
namespace :dummy_apps do
|
5
|
-
task :
|
5
|
+
task :yarn_install do
|
6
|
+
yarn_install_cmd = "yarn install --mutex network && yarn run install-react-on-rails"
|
7
|
+
sh_in_dir(dummy_app_dir, yarn_install_cmd)
|
8
|
+
end
|
9
|
+
|
10
|
+
task dummy_app: [:yarn_install] do
|
6
11
|
dummy_app_dir = File.join(gem_root, "spec/dummy")
|
7
12
|
bundle_install_in(dummy_app_dir)
|
8
|
-
sh_in_dir(dummy_app_dir, "yarn install --mutex network")
|
9
13
|
end
|
10
14
|
|
11
|
-
task :
|
15
|
+
task dummy_app_with_turbolinks_2: [:yarn_install] do
|
12
16
|
dummy_app_dir = File.join(gem_root, "spec/dummy")
|
13
17
|
bundle_install_with_turbolinks_2_in(dummy_app_dir)
|
14
|
-
sh_in_dir(dummy_app_dir, "yarn install --mutex network")
|
15
18
|
end
|
16
19
|
|
17
20
|
task dummy_apps: [:dummy_app, :node_package] do
|
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: 6.9.
|
4
|
+
version: 6.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Gordon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-04-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|