react_on_rails 9.0.0.beta.9 → 9.0.0.beta.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2ba6646e46775e165a0d0f7c8e43de2dad2eb1fc
4
- data.tar.gz: c422212818cb28ef17dffd3a7da41410099dce0c
3
+ metadata.gz: 1b78d18af7d1cec47bbcbd58c3656487cbb800c0
4
+ data.tar.gz: d93af368b0c21769e0040f0665b09b6fbdc05eb6
5
5
  SHA512:
6
- metadata.gz: bc8d53a1b6b89290382b2b12736116f33cf54d1bb7c8efb6f5b6ad45886bb534d4192709fb39fb7af11c2ae3ef0670477f36f8da7c9561ee835bc7efeb6e2b5d
7
- data.tar.gz: 16e42224c49bbda250b2ecf3e23bb3eafb0d9f199d7991c0402433eafc48f38d8b4bb1175a35696493a54f244841f8c43e641e08e8107514943a8e05ade82656
6
+ metadata.gz: 262fb81eea87383f5bc2acd2a756eb5f73b1ac4835fd33b512bc3c202f1bffc1543ce7b11c9d4838fb1595dca6d8c8dafdbd5884f024001fa6e83db97752d65b
7
+ data.tar.gz: 3d630cbc5e0bdf911b79a1ee48f225357b64ec80b2f1017da76d18a9c4d30af9fc987daa518dc25db2d927036195a2be743a8a45fbe6591f914cc8712760b01f
@@ -57,6 +57,11 @@ gem "webpacker", git: "https://github.com/shakacode/webpacker.git",
57
57
  - Add a default setting
58
58
  ```
59
59
  custom_compile: true
60
+ cache_manifest: false
61
+ ```
62
+ - For production, set:
63
+ ```
64
+ cache_manifest: true
60
65
  ```
61
66
  - Add a section like this under your development env:
62
67
  ```
@@ -86,6 +91,9 @@ gem "webpacker", git: "https://github.com/shakacode/webpacker.git",
86
91
  ### [9.0.0]
87
92
  *Diffs for the beta to master*
88
93
 
94
+ ### [9.0.0-beta.10]
95
+ - Updated for the latest rails/webpacker. Added the cache_manifest setting.
96
+
89
97
  ### [9.0.0-beta.9]
90
98
  - Fixes precompile task going to Webpacker's. You need to set `custom_compile: true` in your `webpacker.yml`.
91
99
  - Changed webpack-bundle.js name to hello-world-bundle.js
@@ -3,6 +3,8 @@ default: &default
3
3
  # Critical to set compile as false for React on Rails projects
4
4
  compile: false
5
5
  custom_compile: true
6
+ # Cache manifest.json for performance
7
+ cache_manifest: false
6
8
 
7
9
  development:
8
10
  <<: *default
@@ -24,3 +26,4 @@ production:
24
26
  <<: *default
25
27
  # generated files for production, in /public/webpack/production
26
28
  public_output_path: webpack/production
29
+ cache_manifest: true
@@ -57,6 +57,7 @@ module ReactOnRails
57
57
  client_dir: nil,
58
58
  generated_assets_dir: nil,
59
59
  webpack_generated_files: nil)
60
+ ReactOnRails::Utils.check_manifest_not_cached
60
61
  if webpack_assets_status_checker.nil?
61
62
  client_dir ||= Rails.root.join("client")
62
63
  generated_assets_dir ||= ReactOnRails.configuration.generated_assets_dir
@@ -21,7 +21,6 @@ module ReactOnRails
21
21
  # Wraps message and makes it colored.
22
22
  # Pass in the msg and color as a symbol.
23
23
  def self.wrap_message(msg, color = :red)
24
- # binding.pry
25
24
  wrapper_line = ("=" * 80).to_s
26
25
  # rubocop:disable Layout/IndentHeredoc
27
26
  fenced_msg = <<-MSG
@@ -91,10 +90,6 @@ exitstatus: #{status.exitstatus}#{stdout_msg}#{stderr_msg}
91
90
  end
92
91
  end
93
92
 
94
- def self.using_webpacker?
95
- ActionController::Base.helpers.respond_to?(:asset_pack_path)
96
- end
97
-
98
93
  def self.running_on_windows?
99
94
  (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
100
95
  end
@@ -115,14 +110,33 @@ exitstatus: #{status.exitstatus}#{stdout_msg}#{stderr_msg}
115
110
  rails_version_less_than("4.1.1")
116
111
  end
117
112
 
118
- def self.manifest_exists?
119
- Webpacker.config.public_manifest_path.exist?
120
- end
121
-
122
113
  module Required
123
114
  def required(arg_name)
124
115
  raise ArgumentError, "#{arg_name} is required"
125
116
  end
126
117
  end
118
+
119
+ ###########################################################################
120
+ # WEBPACKER WRAPPERS
121
+ ###########################################################################
122
+
123
+ def self.using_webpacker?
124
+ ActionController::Base.helpers.respond_to?(:asset_pack_path)
125
+ end
126
+
127
+ def self.manifest_exists?
128
+ Webpacker.config.public_manifest_path.exist?
129
+ end
130
+
131
+ def self.check_manifest_not_cached
132
+ return unless using_webpacker? && Webpacker.config.cache_manifest?
133
+ msg = <<-MSG.strip_heredoc
134
+ ERROR: you have enabled cache_manifest in the #{Rails.env} env when using the
135
+ ReactOnRails::TestHelper.configure_rspec_to_compile_assets helper
136
+ To fix this: edit your config/webpacker.yml file and set cache_manifest to false for test.
137
+ MSG
138
+ puts wrap_message(msg)
139
+ exit!
140
+ end
127
141
  end
128
142
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReactOnRails
4
- VERSION = "9.0.0.beta.9"
4
+ VERSION = "9.0.0.beta.10"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "9.0.0-beta.9",
3
+ "version": "9.0.0-beta.10",
4
4
  "description": "react-on-rails JavaScript for react_on_rails Ruby gem",
5
5
  "main": "node_package/lib/ReactOnRails.js",
6
6
  "directories": {
@@ -28,6 +28,8 @@ function formatPublicPath(host = '', path = '') {
28
28
  /**
29
29
  * @param configPath, location where webpacker.yml will be found
30
30
  * Return values are consistent with Webpacker's js helpers
31
+ * For example, you might define:
32
+ * const isHMR = settings.dev_server && settings.dev_server.hmr
31
33
  * @returns {{
32
34
  settings,
33
35
  resolvedModules,
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: 9.0.0.beta.9
4
+ version: 9.0.0.beta.10
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-08-17 00:00:00.000000000 Z
11
+ date: 2017-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow