react_on_rails 6.5.0 → 6.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e72d8d450abc3b2aa072d0dd347910a0b44f6b77
4
- data.tar.gz: 1cde3eeb6aef6b151a1b3cfdc1a42c1361bf4575
3
+ metadata.gz: a37b2fda991f6134211a91c1aca89ce539a9dddd
4
+ data.tar.gz: f0927633df2726414e86ba931c323d6fd25038d6
5
5
  SHA512:
6
- metadata.gz: 6107837818ab9652f7f7ec15b4ca8a4d7ccb5f3361b00d9b706e168122db2410c6a252f43298ec0aed7d21981983f33365df0153800257e1aa3314aa541a7ed1
7
- data.tar.gz: a261cd0ed7f4c5898270dd7d79605991ab198a85133d18e317a6ab35cdb95e195d5acf85bdb6f37deb1fa3d4ef329c918ced27cc53e0cdcf25dd35b701979bce
6
+ metadata.gz: 84ff0c3e94a1fff7b5893d0c03fdc8cba3efd40cbbbe09ea288b825534d52020fd65ff80be2e040d9eead3d0f5d2eab48847b61d2a99ce73b98d38587ba3c715
7
+ data.tar.gz: dbe4bd42c1109d45fbde205e20fa11d2e173d6ef23c95506b080a8ba028eb6e5389e80cb61d39f05f7ac76a00873907174f3dd7805871f46c2f86800d2dfca66
data/CHANGELOG.md CHANGED
@@ -6,6 +6,12 @@ Contributors: please follow the recommendations outlined at [keepachangelog.com]
6
6
  ## [Unreleased]
7
7
  *Please add entries here for your pull requests.*
8
8
 
9
+ ## [6.5.1] - 2017-02-11
10
+ ### Fixed
11
+ - Allow using gem without sprockets. [#671](https://github.com/shakacode/react_on_rails/pull/671) by [fc-arny](https://github.com/fc-arny).
12
+ - Fixed issue [#706](https://github.com/shakacode/react_on_rails/issues/706) with "flickering" components when they are unmounted too early [#709](https://github.com/shakacode/react_on_rails/pull/709) by [szyablitsky](https://github.com/szyablitsky).
13
+ - Small formatting fix for errors [#703](https://github.com/shakacode/react_on_rails/pull/703) by [justin808](https://github.com/justin808).
14
+
9
15
  ## [6.5.0] - 2017-01-31
10
16
  ### Added
11
17
  - Allow generator function to return Object with property `renderedHtml` (already could return Object with props `redirectLocation, error`) rather than a React component or a function that returns a React component. One reason to use a generator function is that sometimes in server rendering, specifically with React Router v4, you need to return the result of calling ReactDOMServer.renderToString(element). [#689](https://github.com/shakacode/react_on_rails/issues/689) by [justin808](https://github.com/justin808).
@@ -442,7 +448,8 @@ Best done with Object destructing:
442
448
  ##### Fixed
443
449
  - Fix several generator related issues.
444
450
 
445
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/6.5.0...master
451
+ [Unreleased]: https://github.com/shakacode/react_on_rails/compare/6.5.1...master
452
+ [6.5.1]: https://github.com/shakacode/react_on_rails/compare/6.5.0...6.5.1
446
453
  [6.5.0]: https://github.com/shakacode/react_on_rails/compare/6.4.2...6.5.0
447
454
  [6.4.2]: https://github.com/shakacode/react_on_rails/compare/6.4.1...6.4.2
448
455
  [6.4.1]: https://github.com/shakacode/react_on_rails/compare/6.4.0...6.4.1
data/README.md CHANGED
@@ -113,7 +113,7 @@ We're definitely not doing that. With react_on_rails, webpack is mainly generati
113
113
  gem "react_on_rails", "~> 6"
114
114
  ```
115
115
 
116
- 2. Commit this to git (you cannot run the generator unless you do this).
116
+ 2. Commit this to git (you cannot run the generator unless you do this or pass the option `--ignore-warnings`).
117
117
 
118
118
  3. See help for the generator:
119
119
 
@@ -94,7 +94,7 @@ TURBO: reactOnRailsPageLoaded
94
94
 
95
95
  Turbolinks 5:
96
96
  ```
97
- TURBO: WITH TURBOLINKS 5: document turbolinks:before-cache and turbolinks:load handlers installed. (program)
97
+ TURBO: WITH TURBOLINKS 5: document turbolinks:before-render and turbolinks:load handlers installed. (program)
98
98
  TURBO: reactOnRailsPageLoaded
99
99
  ```
100
100
 
@@ -6,7 +6,7 @@ The best source of docs is the main [ReactOnRails.js](../../node_package/src/Rea
6
6
  * Main entry point to using the react-on-rails npm package. This is how Rails will be able to
7
7
  * find you components for rendering. Components get called with props, or you may use a
8
8
  * "generator function" to return a React component or an object with the following shape:
9
- * { renderedHtml, redirectLocation, error }.
9
+ * { renderedHtml, redirectLocation, error }.
10
10
  * @param components (key is component name, value is component)
11
11
  */
12
12
  register(components)
@@ -1,7 +1,6 @@
1
1
  - [Generator](#generator)
2
2
  - [Understanding the Organization of the Generated Client Code](#understanding-the-organization-of-the-generated-client-code)
3
3
  - [Redux](#redux)
4
- - [Multiple React Components on a Page with One Store](#multiple-react-components-on-a-page-with-one-store)
5
4
  - [Using Images and Fonts](#using-images-and-fonts)
6
5
 
7
6
  The `react_on_rails:install` generator combined with the example pull requests of generator runs will get you up and running efficiently. There's a fair bit of setup with integrating Webpack with Rails. Defaults for options are such that the default is for the flag to be off. For example, the default for `-R` is that `redux` is off, and the default of `-b` is that `skip-bootstrap` is off.
@@ -13,7 +12,9 @@ Usage:
13
12
  rails generate react_on_rails:install [options]
14
13
 
15
14
  Options:
16
- -R, [--redux], [--no-redux] # Install Redux gems and Redux version of Hello World Example
15
+ -R, [--redux], [--no-redux] # Install Redux gems and Redux version of Hello World Example. Default: false
16
+ -N, [--node], [--no-node] # Sets up node as a server rendering option. Default: false
17
+ [--ignore-warnings], [--no-ignore-warnings] # Skip warnings. Default: false
17
18
 
18
19
  Runtime options:
19
20
  -f, [--force] # Overwrite files that already exist
@@ -22,10 +23,36 @@ Runtime options:
22
23
  -s, [--skip], [--no-skip] # Skip files that already exist
23
24
 
24
25
  Description:
25
- Create react on rails files for install generator.
26
+
27
+ The react_on_rails:install generator integrates webpack with rails with ease. You
28
+ can pass the redux option if you'd like to have redux setup for you automatically.
29
+
30
+ * Redux
31
+
32
+ Passing the --redux generator option causes the generated Hello World example
33
+ to integrate the Redux state container framework. The necessary node modules
34
+ will be automatically included for you.
35
+
36
+ * Node
37
+
38
+ Passing the --node generator option sets up the necessary files for node to render the react_components.
39
+
40
+ *******************************************************************************
41
+
42
+ After running the generator, you will want to:
43
+
44
+ bundle && npm i
45
+
46
+ Then you may run
47
+
48
+ foreman start -f Procfile.dev
49
+
50
+ More Details:
51
+
52
+ `https://github.com/shakacode/react_on_rails/blob/master/docs/basics/generator.md`
26
53
  ```
27
54
 
28
- For a clear example of what each generator option will do, see our generator results repo: [Generator Results](https://github.com/shakacode/react_on_rails-generator-results/blob/master/README.md). Each pull request shows a git "diff" that highlights the changes that the generator has made. Another good option is to create a simple test app per the [Tutorial](docs/tutorial.md).
55
+ Another good option is to create a simple test app per the [Tutorial](docs/tutorial.md).
29
56
 
30
57
  ### Understanding the Organization of the Generated Client Code
31
58
  The generated client code follows our organization scheme. Each unique set of functionality, is given its own folder inside of `client/app/bundles`. This encourages for modularity of *domains*.
data/docs/basics/i18n.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Here's a summary of adding the I18n functionality.
4
4
 
5
- You can refer to [react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial) for a complete example.
5
+ You can refer to [react-webpack-rails-tutorial](https://github.com/shakacode/react-webpack-rails-tutorial) and [PR #340](https://github.com/shakacode/react-webpack-rails-tutorial/pull/340) for a complete example.
6
6
 
7
7
  1. Add `react-intl` & `intl` to `client/package.json`, and remember to `bundle && npm install`.
8
8
 
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ReactOnRails
3
- VERSION = "6.5.0".freeze
3
+ VERSION = "6.5.1".freeze
4
4
  end
@@ -1,28 +1,50 @@
1
1
  require "react_on_rails/assets_precompile"
2
2
 
3
- namespace :react_on_rails do
4
- namespace :assets do
5
- desc "Creates non-digested symlinks for the assets in the public asset dir"
6
- task symlink_non_digested_assets: :"assets:environment" do
7
- ReactOnRails::AssetsPrecompile.new.symlink_non_digested_assets
8
- end
3
+ if defined?(Sprockets)
4
+ namespace :react_on_rails do
5
+ namespace :assets do
6
+ desc "Creates non-digested symlinks for the assets in the public asset dir"
7
+ task symlink_non_digested_assets: :"assets:environment" do
8
+ ReactOnRails::AssetsPrecompile.new.symlink_non_digested_assets
9
+ end
9
10
 
10
- desc "Cleans all broken symlinks for the assets in the public asset dir"
11
- task delete_broken_symlinks: :"assets:environment" do
12
- ReactOnRails::AssetsPrecompile.new.delete_broken_symlinks
13
- end
11
+ desc "Cleans all broken symlinks for the assets in the public asset dir"
12
+ task delete_broken_symlinks: :"assets:environment" do
13
+ ReactOnRails::AssetsPrecompile.new.delete_broken_symlinks
14
+ end
14
15
 
15
- # In this task, set prerequisites for the assets:precompile task
16
- desc <<-DESC
16
+ # In this task, set prerequisites for the assets:precompile task
17
+ desc <<-DESC
17
18
  Create webpack assets before calling assets:environment
18
19
  The webpack task must run before assets:environment task.
19
20
  Otherwise Sprockets cannot find the files that webpack produces.
20
21
  This is the secret sauce for how a Heroku deployment knows to create the webpack generated JavaScript files.
21
- DESC
22
- task compile_environment: :webpack do
23
- Rake::Task["assets:environment"].invoke
22
+ DESC
23
+ task compile_environment: :webpack do
24
+ Rake::Task["assets:environment"].invoke
25
+ end
26
+
27
+ desc "Delete assets created with webpack, in the generated assetst directory (/app/assets/webpack)"
28
+ task clobber: :environment do
29
+ ReactOnRails::AssetsPrecompile.new.clobber
30
+ end
24
31
  end
32
+ end
33
+
34
+ # These tasks run as pre-requisites of assets:precompile.
35
+ # Note, it's not possible to refer to ReactOnRails configuration values at this point.
36
+ Rake::Task["assets:precompile"]
37
+ .clear_prerequisites
38
+ .enhance([:environment, "react_on_rails:assets:compile_environment"])
39
+ .enhance do
40
+ Rake::Task["react_on_rails:assets:symlink_non_digested_assets"].invoke
41
+ Rake::Task["react_on_rails:assets:delete_broken_symlinks"].invoke
42
+ end
43
+ end
25
44
 
45
+ # Sprockets independent tasks
46
+ namespace :react_on_rails do
47
+ namespace :assets do
26
48
  desc <<-DESC
27
49
  Compile assets with webpack
28
50
  Uses command defined with ReactOnRails.configuration.npm_build_production_command
@@ -33,21 +55,5 @@ sh "cd client && `ReactOnRails.configuration.npm_build_production_command`"
33
55
  sh "cd client && #{ReactOnRails.configuration.npm_build_production_command}"
34
56
  end
35
57
  end
36
-
37
- desc "Delete assets created with webpack, in the generated assetst directory (/app/assets/webpack)"
38
- task clobber: :environment do
39
- ReactOnRails::AssetsPrecompile.new.clobber
40
- end
41
58
  end
42
59
  end
43
-
44
- # These tasks run as pre-requisites of assets:precompile.
45
- # Note, it's not possible to refer to ReactOnRails configuration values at this point.
46
- Rake::Task["assets:precompile"]
47
- .clear_prerequisites
48
- .enhance([:environment, "react_on_rails:assets:compile_environment"])
49
- .enhance do
50
- Rake::Task["react_on_rails:assets:symlink_non_digested_assets"].invoke
51
- Rake::Task["react_on_rails:assets:delete_broken_symlinks"].invoke
52
- end
53
-
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "6.5.0",
3
+ "version": "6.5.1",
4
4
  "description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5
5
  "main": "node_package/lib/ReactOnRails.js",
6
6
  "directories": {
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.5.0
4
+ version: 6.5.1
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-02-01 00:00:00.000000000 Z
11
+ date: 2017-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool