react-rails 2.2.0 → 2.2.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: 37de0baf50c91ac20c61f03afd79b0538dce4588
4
- data.tar.gz: c04e9318f7675006a78be2339cc1a38de92f3b2c
3
+ metadata.gz: d3778de93a6ea615712b737738fce82e2aa6aa70
4
+ data.tar.gz: a6276450147f672528b42b34c53fc998d871982f
5
5
  SHA512:
6
- metadata.gz: 7f328fdff77009184e2b682ddab263faf7714e17fcac5b7dff9d56fa79ada9f1b8e7fb160b4fe5e8b279277962dad469257097948cdb0300c4eee147857c0428
7
- data.tar.gz: 06ec30fbde19289622ecc7aa76ce7254e10f18e6c038746beb2efb7b50ad11d07fb9ea87ecca4ec9443f772a49404a891f44fe84f2b7cbb18f6a3301649ce7f8
6
+ metadata.gz: 4f0c8fc937767ed500b5e5bab8b9d1a979800f54532725beff8e941347a4dbadb19f25604aae39d2d47724f3ccce747066f4dd82b8190ecd804bfc4a9c4298bb
7
+ data.tar.gz: 1aa70eb42f95f6a3dc17a2258bed4193edfe9f67ac8f10b492b23030e08c79539e02d153ff36ac11293fee9b9f8055c0ee8663593f6f467f69caa735125fb638
@@ -8,6 +8,17 @@
8
8
 
9
9
  #### Bug Fixes
10
10
 
11
+ ## 2.2.1
12
+
13
+ #### New Features
14
+
15
+ - Support `config.react.server_renderer_directories` in initializers #729
16
+
17
+ #### Bug Fixes
18
+
19
+ - Fix Railtie watcher to update its timestamp when files change #722
20
+ - Don't use `yarn` binstub because webpacker doesn't provide it anymore #717
21
+
11
22
  ## 2.2.0
12
23
 
13
24
  #### New Features
@@ -103,8 +103,7 @@ ReactRailsUJS.useContext(componentRequireContext)
103
103
  JS
104
104
 
105
105
  def setup_react_webpacker
106
- yarn_binstub = File.expand_path("./bin/yarn", ::Rails.root)
107
- `#{yarn_binstub} add react_ujs`
106
+ `yarn add react_ujs`
108
107
  if manifest.exist?
109
108
  append_file(manifest, WEBPACKER_SETUP_UJS)
110
109
  else
@@ -24,7 +24,7 @@ module React
24
24
  config.react.view_helper_implementation = nil # Defaults to ComponentMount
25
25
 
26
26
  # Watch .jsx files for changes in dev, so we can reload the JS VMs with the new JS code.
27
- initializer "react_rails.add_watchable_files", group: :all do |app|
27
+ initializer "react_rails.add_watchable_files", after: :load_config_initializers, group: :all do |app|
28
28
  # Watch files ending in `server_renderer_extensions` in each of `server_renderer_directories`
29
29
  reload_paths = config.react.server_renderer_directories.reduce({}) do |memo, dir|
30
30
  app_dir = File.join(app.root, dir)
@@ -33,9 +33,13 @@ module React
33
33
  end
34
34
 
35
35
  # Rails checks these objects for changes:
36
- app.reloaders << app.config.file_watcher.new([], reload_paths) {}
36
+ react_reloader = app.config.file_watcher.new([], reload_paths) do
37
+ React::ServerRendering.reset_pool
38
+ end
39
+ app.reloaders << react_reloader
40
+
37
41
  # Reload renderers in dev when files change
38
- config.to_prepare { React::ServerRendering.reset_pool }
42
+ config.to_prepare { react_reloader.execute_if_updated }
39
43
  end
40
44
 
41
45
  # Include the react-rails view helper lazily
@@ -2,6 +2,6 @@ module React
2
2
  module Rails
3
3
  # If you change this, make sure to update VERSIONS.md
4
4
  # and republish the UJS by updating package.json and `bundle exec rake ujs:publish`
5
- VERSION = "2.2.0"
5
+ VERSION = "2.2.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: react-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul O’Shannessy
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-05-11 00:00:00.000000000 Z
12
+ date: 2017-06-30 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: appraisal
@@ -326,7 +326,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
326
326
  version: '0'
327
327
  requirements: []
328
328
  rubyforge_project:
329
- rubygems_version: 2.6.11
329
+ rubygems_version: 2.5.2
330
330
  signing_key:
331
331
  specification_version: 4
332
332
  summary: React integration for Ruby on Rails