react_on_rails 9.0.0.beta.5 → 9.0.0.beta.6
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 +4 -4
- data/CHANGELOG.md +5 -2
- data/README.md +6 -1
- data/lib/generators/react_on_rails/templates/base/base/config/webpacker.yml +1 -1
- data/lib/react_on_rails/utils.rb +4 -4
- data/lib/react_on_rails/version.rb +1 -1
- data/package.json +1 -1
- data/webpackConfigLoader.js +6 -6
- 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: 87401aa3f78e7c02c43df0ba13f2befc6c0d6f7a
|
4
|
+
data.tar.gz: 6fee72ba5bdab701ae4c270ebd2622b2c20005e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43b5ea95a1424cac2a0537bd727158e7903a59174438335bcdfe29a0d744f9f9e1faab21397bb0787b6da6a978d061f81fd98d1718447824b12324262d0d9bdd
|
7
|
+
data.tar.gz: 6429193a7bd2741c5d0a7ea26d00e3dd6dad7a4c64d84e497a0e5f89fda1f5af301b7d576b308b3b1f2b9174c4c298639c251d216ad66bc9d8a1ea2d1f77f234
|
data/CHANGELOG.md
CHANGED
@@ -8,6 +8,9 @@ Changes since last non-beta release.
|
|
8
8
|
|
9
9
|
*Please add entries here for your pull requests.*
|
10
10
|
|
11
|
+
- Fix regression where `react_component(... prerender: true)` wouldn't find the generated asset bundle, because it wasn't looking for the hashed path.
|
12
|
+
|
13
|
+
|
11
14
|
## 9.0 from 8.x. Upgrade Instructions
|
12
15
|
All 9.0.0 beta versions can be viewed in [PR 908](https://github.com/shakacode/react_on_rails/pull/908)
|
13
16
|
|
@@ -32,7 +35,7 @@ gem "webpacker", git: "https://github.com/shakacode/webpacker.git",
|
|
32
35
|
port: 8080
|
33
36
|
https: false
|
34
37
|
# Can be enabled by export WEBPACKER_HMR=TRUE in env
|
35
|
-
|
38
|
+
hmr: false
|
36
39
|
```
|
37
40
|
- See the example `spec/dummy/config/webpacker.yml`.
|
38
41
|
- Remove keys `hot_reloading_host` and `hot_reloading_enabled_by_default`. These are replaced by the `dev_server` key.
|
@@ -43,7 +46,7 @@ gem "webpacker", git: "https://github.com/shakacode/webpacker.git",
|
|
43
46
|
- Comment out or remove the dev_server area of your config.
|
44
47
|
- Edit your static procfile to set env value WEBPACKER_DEV_SERVER=FALSE
|
45
48
|
- For hot loading, either:
|
46
|
-
- Set the
|
49
|
+
- Set the `hmr` key in your `webpacker.yml` to `true`.
|
47
50
|
- Edit your hot procfile to set env value WEBPACKER_HMR=TRUE
|
48
51
|
|
49
52
|
|
data/README.md
CHANGED
@@ -143,7 +143,7 @@ To upgrade existing apps to React on Rails 8 see the [Installation Overview](doc
|
|
143
143
|
1. Add the following to your Gemfile and `bundle install`. We recommend fixing the version of React on Rails, as you will need to keep the exact version in sync with the version in your `client/package.json` file.
|
144
144
|
|
145
145
|
```ruby
|
146
|
-
gem "react_on_rails", "
|
146
|
+
gem "react_on_rails", "9.0.0"
|
147
147
|
```
|
148
148
|
|
149
149
|
2. Commit this to git (you cannot run the generator unless you do this or pass the option `--ignore-warnings`).
|
@@ -236,6 +236,11 @@ cd client && yarn add react-on-rails
|
|
236
236
|
|
237
237
|
That will install the latest version and update your package.json.
|
238
238
|
|
239
|
+
## Webpacker Configuration
|
240
|
+
|
241
|
+
React on Rails users should set configuration value `compile` to false, as React on Railsh andles compilation for test and production environments.
|
242
|
+
|
243
|
+
|
239
244
|
## How it Works
|
240
245
|
The generator installs your webpack files in the `client` folder. Foreman uses webpack to compile your code and output the bundled results to `app/assets/webpack`, which are then loaded by sprockets. These generated bundle files have been added to your `.gitignore` for your convenience.
|
241
246
|
|
data/lib/react_on_rails/utils.rb
CHANGED
@@ -75,11 +75,11 @@ exitstatus: #{status.exitstatus}#{stdout_msg}#{stderr_msg}
|
|
75
75
|
# If using webpacker gem per https://github.com/rails/webpacker/issues/571
|
76
76
|
hashed_name = Webpacker::Manifest.lookup(bundle_name, throw_if_missing: false)
|
77
77
|
hashed_name = bundle_name if hashed_name.blank?
|
78
|
-
Rails.root.join(File.join(Webpacker::Configuration.output_path, hashed_name))
|
78
|
+
Rails.root.join(File.join(Webpacker::Configuration.output_path, hashed_name)).to_s
|
79
|
+
else
|
79
80
|
# Else either the file is not in the manifest, so we'll default to the non-hashed name.
|
81
|
+
File.join(ReactOnRails.configuration.generated_assets_dir, bundle_name)
|
80
82
|
end
|
81
|
-
|
82
|
-
File.join(ReactOnRails.configuration.generated_assets_dir, bundle_name)
|
83
83
|
end
|
84
84
|
|
85
85
|
def self.using_webpacker?
|
@@ -106,7 +106,7 @@ exitstatus: #{status.exitstatus}#{stdout_msg}#{stderr_msg}
|
|
106
106
|
rails_version_less_than("4.1.1")
|
107
107
|
end
|
108
108
|
|
109
|
-
def manifest_exists?
|
109
|
+
def self.manifest_exists?
|
110
110
|
Webpacker::Configuration.manifest_path.exist?
|
111
111
|
end
|
112
112
|
|
data/package.json
CHANGED
data/webpackConfigLoader.js
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
* Allow defaults for the config/webpacker.yml. Thee values in this file MUST match values
|
3
3
|
* in https://github.com/rails/webpacker/blob/master/lib/install/config/webpacker.yml
|
4
4
|
*
|
5
|
-
* NOTE: for
|
5
|
+
* NOTE: for HMR reloading, env.WEBPACKER_HMR value will override any config value. This env value
|
6
6
|
* should be set to TRUE to turn this on.
|
7
7
|
*/
|
8
8
|
const { join, resolve } = require('path');
|
@@ -14,13 +14,13 @@ const DEFAULT_PUBLIC_OUTPUT_PATH = 'packs';
|
|
14
14
|
const DEFAULT_DEV_SERVER_HOST = 'localhost';
|
15
15
|
const DEFAULT_DEV_SERVER_PORT = '8080';
|
16
16
|
const DEFAULT_DEV_SERVER_HTTPS = false;
|
17
|
-
const
|
17
|
+
const DEFAULT_DEV_SERVER_HMR = false;
|
18
18
|
|
19
19
|
/**
|
20
20
|
* @param configPath, location where webpacker.yml will be found
|
21
21
|
* @returns {{
|
22
22
|
* devBuild,
|
23
|
-
*
|
23
|
+
* hmrReloadingEnabled,
|
24
24
|
* devServerEnabled,
|
25
25
|
* devServerHost,
|
26
26
|
* devServerPort,
|
@@ -42,7 +42,7 @@ const configLoader = (configPath) => {
|
|
42
42
|
const devServerHost = devServerValues && (devServerValues.host || DEFAULT_DEV_SERVER_HOST);
|
43
43
|
const devServerPort = devServerValues && (devServerValues.port || DEFAULT_DEV_SERVER_PORT);
|
44
44
|
const devServerHttps = devServerValues && (devServerValues.https || DEFAULT_DEV_SERVER_HTTPS);
|
45
|
-
const
|
45
|
+
const devServerHmr = devServerValues && (devServerValues.hmr || DEFAULT_DEV_SERVER_HMR);
|
46
46
|
|
47
47
|
// NOTE: Rails path is hard coded to `/public`
|
48
48
|
const webpackPublicOutputDir = configuration.public_output_path ||
|
@@ -52,7 +52,7 @@ const configLoader = (configPath) => {
|
|
52
52
|
const manifest = MANIFEST;
|
53
53
|
|
54
54
|
const devServerEnabled = !!devServerValues;
|
55
|
-
const
|
55
|
+
const hmrReloadingEnabled = !!devServerHmr || env.WEBPACKER_HMR === 'TRUE';
|
56
56
|
|
57
57
|
let devServerUrl = null;
|
58
58
|
if (devServerValues) {
|
@@ -61,7 +61,7 @@ const configLoader = (configPath) => {
|
|
61
61
|
|
62
62
|
return {
|
63
63
|
devBuild,
|
64
|
-
|
64
|
+
hmrReloadingEnabled,
|
65
65
|
devServerEnabled,
|
66
66
|
devServerHost,
|
67
67
|
devServerPort,
|
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.
|
4
|
+
version: 9.0.0.beta.6
|
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-
|
11
|
+
date: 2017-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|