react_on_rails 12.0.2 → 12.0.3.beta.0

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
  SHA256:
3
- metadata.gz: 2dacb7734da108abf8cf2a71bef68ba0b3049c2ef9d97aa46afc2ff9d53d4931
4
- data.tar.gz: 66074b4e21e05482d185560c5dda2541b6fe48c65888d7ac20706b4fb1fdc97a
3
+ metadata.gz: 5f71a30ded8cae1a38bfc7f419bbd39eed35d83e365eab74c148102f23e6d083
4
+ data.tar.gz: 70f4b3c869c3810804c7d01996699a1c7a6c145fca3cc35b7add4e0984c5bbce
5
5
  SHA512:
6
- metadata.gz: b8a29d39338fe7d8c79ec80c4b2cb95ddc3ecd280f2d2d70de9aa9fca92c01a1e5986c4c916580fd329ebcbce00ba25c3a9493d3e95d97167d3b49f66476b5da
7
- data.tar.gz: 684c86dc869ee2c7453ed6f9c551c976efbbe817159cc1ef2ea0ec75369018a814e478eca896c9e8d4a23f44e4ba5a8875868fcddab3db31428457226423cdc0
6
+ metadata.gz: 3849a1ebf62f6d81625c3c23e48dc1928990eecd4acc3d44c005e2d09859d39e86dd4c9a3c35b3db4da70ee8588e406c98d6396f8157a3874c0a83d6629ae901
7
+ data.tar.gz: 707c8b7a6fe991315b6d433324d4c4fef5a170f1b0b09241d9faee034bd8d82cb2551634a6a157d35af89640017030fccf4a283175118ec1e06f1b4299877389
@@ -0,0 +1,53 @@
1
+ name: Lint JS and Ruby
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ strategy:
8
+ matrix:
9
+ ruby: [2.6]
10
+ node: [12]
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Setup Ruby
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: ${{ matrix.ruby }}
18
+ - name: Setup Node
19
+ uses: actions/setup-node@v1.4.3
20
+ with:
21
+ node-version: ${{ matrix.node }}
22
+ - name: Print system information
23
+ run: |
24
+ echo "Linux release: "; cat /etc/issue
25
+ echo "Current user: "; whoami
26
+ echo "Current directory: "; pwd
27
+ echo "Ruby version: "; ruby -v
28
+ echo "Node version: "; node -v
29
+ echo "Yarn version: "; yarn --version
30
+ echo "Bundler version: "; bundle --version
31
+ - name: Save root node_modules to cache
32
+ uses: actions/cache@v2
33
+ with:
34
+ path: node_modules
35
+ key: v4-package-node-modules-cache-${{ hashFiles('yarn.lock') }}
36
+ - name: Save root ruby gems to cache
37
+ uses: actions/cache@v2
38
+ with:
39
+ path: vendor/bundle
40
+ key: v4-package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}
41
+ - name: Install Node modules with Yarn for renderer package
42
+ run: |
43
+ yarn install --no-progress --no-emoji
44
+ yarn run eslint -v
45
+ sudo yarn global add yalc
46
+ - name: Install Ruby Gems for package
47
+ run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
48
+ - name: Linting of Ruby
49
+ run: bundle exec rubocop
50
+ - name: Linting of JS
51
+ run: yarn start lint
52
+ - name: Check formatting
53
+ run: yarn start format.listDifferent
@@ -0,0 +1,178 @@
1
+ name: Main test
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build-dummy-app-webpack-test-bundles:
7
+ strategy:
8
+ matrix:
9
+ ruby: [2.6]
10
+ node: [12]
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Setup Ruby
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: ${{ matrix.ruby }}
18
+ - name: Setup Node
19
+ uses: actions/setup-node@v1.4.3
20
+ with:
21
+ node-version: ${{ matrix.node }}
22
+ - name: Print system information
23
+ run: |
24
+ echo "Linux release: "; cat /etc/issue
25
+ echo "Current user: "; whoami
26
+ echo "Current directory: "; pwd
27
+ echo "Ruby version: "; ruby -v
28
+ echo "Node version: "; node -v
29
+ echo "Yarn version: "; yarn --version
30
+ echo "Bundler version: "; bundle --version
31
+ - name: Save root node_modules to cache
32
+ uses: actions/cache@v2
33
+ with:
34
+ path: node_modules
35
+ key: v4-package-node-modules-cache-${{ hashFiles('yarn.lock') }}
36
+ - name: Install Node modules with Yarn for renderer package
37
+ run: |
38
+ yarn install --no-progress --no-emoji
39
+ yarn run eslint -v
40
+ sudo yarn global add yalc
41
+ - name: yalc publish for react-on-rails
42
+ run: yalc publish
43
+ - name: Save spec/dummy/node_modules to cache
44
+ uses: actions/cache@v2
45
+ with:
46
+ path: spec/dummy/node_modules
47
+ key: v4-dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/yarn.lock') }}
48
+ - name: yalc add react-on-rails
49
+ run: cd spec/dummy && yalc add react-on-rails
50
+ - name: Install Node modules with Yarn for dummy app
51
+ run: cd spec/dummy && yarn install --no-progress --no-emoji
52
+ - name: Save dummy app ruby gems to cache
53
+ uses: actions/cache@v2
54
+ with:
55
+ path: spec/dummy/vendor/bundle
56
+ key: v4-dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}
57
+ - name: Install Ruby Gems for dummy app
58
+ run: cd spec/dummy && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
59
+ - name: Build test bundles for dummy app
60
+ run: cd spec/dummy && yarn run build:test
61
+ - id: get-sha
62
+ run: echo "::set-output name=sha::$(git rev-parse HEAD)"
63
+ - name: Save test webpack bundles to cache (for build number checksum used by rspec job)
64
+ uses: actions/cache@v2
65
+ with:
66
+ path: spec/dummy/public/webpack
67
+ key: v4-dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}
68
+
69
+ main:
70
+ needs: build-dummy-app-webpack-test-bundles
71
+ strategy:
72
+ matrix:
73
+ ruby: [2.6]
74
+ node: [12]
75
+ rake_task: ['run_rspec:all_dummy', 'run_rspec:all_but_examples', 'run_rspec:examples']
76
+ runs-on: ubuntu-latest
77
+ steps:
78
+ - uses: actions/checkout@v2
79
+ - name: Setup Ruby
80
+ uses: ruby/setup-ruby@v1
81
+ with:
82
+ ruby-version: ${{ matrix.ruby }}
83
+ - name: Setup Node
84
+ uses: actions/setup-node@v1.4.3
85
+ with:
86
+ node-version: ${{ matrix.node }}
87
+ - name: Print system information
88
+ run: |
89
+ echo "Linux release: "; cat /etc/issue
90
+ echo "Current user: "; whoami
91
+ echo "Current directory: "; pwd
92
+ echo "Ruby version: "; ruby -v
93
+ echo "Node version: "; node -v
94
+ echo "Yarn version: "; yarn --version
95
+ echo "Bundler version: "; bundle --version
96
+ - name: Save root node_modules to cache
97
+ uses: actions/cache@v2
98
+ with:
99
+ path: node_modules
100
+ key: v4-package-node-modules-cache-${{ hashFiles('yarn.lock') }}
101
+ - name: Save root ruby gems to cache
102
+ uses: actions/cache@v2
103
+ with:
104
+ path: vendor/bundle
105
+ key: v4-package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}
106
+ - name: Save dummy app ruby gems to cache
107
+ uses: actions/cache@v2
108
+ with:
109
+ path: spec/dummy/vendor/bundle
110
+ key: v4-dummy-app-gem-cache-${{ hashFiles('spec/dummy/Gemfile.lock') }}
111
+ - name: Save spec/dummy/node_modules to cache
112
+ uses: actions/cache@v2
113
+ with:
114
+ path: spec/dummy/node_modules
115
+ key: v4-dummy-app-node-modules-cache-${{ hashFiles('spec/dummy/yarn.lock') }}
116
+ - id: get-sha
117
+ run: echo "::set-output name=sha::$(git rev-parse HEAD)"
118
+ - name: Save test webpack bundles to cache (for build number checksum used by rspec job)
119
+ uses: actions/cache@v2
120
+ with:
121
+ path: spec/dummy/public/webpack
122
+ key: v4-dummy-app-webpack-bundle-${{ steps.get-sha.outputs.sha }}
123
+
124
+ - name: Install Node modules with Yarn for renderer package
125
+ run: |
126
+ yarn install --no-progress --no-emoji
127
+ yarn run eslint -v
128
+ sudo yarn global add yalc
129
+ - name: yalc publish for react-on-rails
130
+ run: yalc publish
131
+ - name: yalc add react-on-rails
132
+ run: cd spec/dummy && yalc add react-on-rails
133
+ - name: Install Ruby Gems for package
134
+ run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
135
+ - name: Install Ruby Gems for dummy app
136
+ run: cd spec/dummy && bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
137
+ - name: Ensure minimum required Chrome version
138
+ run: |
139
+ echo -e "Already installed $(google-chrome --version)\n"
140
+ MINIMUM_REQUIRED_CHROME_VERSION=75
141
+ INSTALLED_CHROME_MAJOR_VERSION="$(google-chrome --version | tr ' .' '\t' | cut -f3)"
142
+ if [[ $INSTALLED_CHROME_MAJOR_VERSION < $MINIMUM_REQUIRED_CHROME_VERSION ]]; then
143
+ wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
144
+ sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
145
+ sudo apt-get update
146
+ sudo apt-get install google-chrome-stable
147
+ echo -e "\nInstalled $(google-chrome --version)"
148
+ fi
149
+ - name: Touch webpack bundles
150
+ run: touch spec/dummy/public/webpack/test/*
151
+ - name: Install yalc globally
152
+ run: sudo yarn global add yalc
153
+ - name: Increase the amount of inotify watchers
154
+ run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
155
+ - name: Prep for CI
156
+ run: bundle exec rake prepare_for_ci
157
+ - name: Main CI
158
+ run: bundle exec rake ${{ matrix.rake_task }}
159
+ - name: Store test results
160
+ uses: actions/upload-artifact@v2
161
+ with:
162
+ name: main-rspec
163
+ path: ~/rspec
164
+ - name: Store artifacts
165
+ uses: actions/upload-artifact@v2
166
+ with:
167
+ name: dummy-app-capybara
168
+ path: spec/dummy/tmp/capybara
169
+ - name: Store artifacts
170
+ uses: actions/upload-artifact@v2
171
+ with:
172
+ name: dummy-app-test-log
173
+ path: spec/dummy/log/test.log
174
+ - name: Store artifacts
175
+ uses: actions/upload-artifact@v2
176
+ with:
177
+ name: dummy-app-yarn-log
178
+ path: spec/dummy/yarn-error.log
@@ -0,0 +1,35 @@
1
+ name: JS unit tests for Renderer package
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ strategy:
8
+ matrix:
9
+ node: [12]
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v2
13
+ - name: Setup Node
14
+ uses: actions/setup-node@v1.4.3
15
+ with:
16
+ node-version: ${{ matrix.node }}
17
+ - name: Print system information
18
+ run: |
19
+ echo "Linux release: "; cat /etc/issue
20
+ echo "Current user: "; whoami
21
+ echo "Current directory: "; pwd
22
+ echo "Node version: "; node -v
23
+ echo "Yarn version: "; yarn --version
24
+ - name: Save root node_modules to cache
25
+ uses: actions/cache@v2
26
+ with:
27
+ path: node_modules
28
+ key: v4-package-node-modules-cache-${{ hashFiles('yarn.lock') }}
29
+ - name: Install Node modules with Yarn for renderer package
30
+ run: |
31
+ yarn install --no-progress --no-emoji
32
+ yarn run eslint -v
33
+ sudo yarn global add yalc
34
+ - name: Run JS unit tests for Renderer package
35
+ run: yarn test
@@ -0,0 +1,45 @@
1
+ name: Rspec test for gem
2
+
3
+ on: [push, pull_request]
4
+
5
+ jobs:
6
+ build:
7
+ strategy:
8
+ matrix:
9
+ ruby: [2.6]
10
+ node: [12]
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+ - name: Setup Ruby
15
+ uses: ruby/setup-ruby@v1
16
+ with:
17
+ ruby-version: ${{ matrix.ruby }}
18
+ - name: Print system information
19
+ run: |
20
+ echo "Linux release: "; cat /etc/issue
21
+ echo "Current user: "; whoami
22
+ echo "Current directory: "; pwd
23
+ echo "Ruby version: "; ruby -v
24
+ echo "Node version: "; node -v
25
+ echo "Yarn version: "; yarn --version
26
+ echo "Bundler version: "; bundle --version
27
+ - name: Save root ruby gems to cache
28
+ uses: actions/cache@v2
29
+ with:
30
+ path: vendor/bundle
31
+ key: v4-package-app-gem-cache-${{ hashFiles('react_on_rails.gemspec') }}
32
+ - name: Install Ruby Gems for package
33
+ run: bundle check --path=vendor/bundle || bundle install --path=vendor/bundle --jobs=4 --retry=3
34
+ - name: Run rspec tests
35
+ run: bundle exec rspec spec/react_on_rails
36
+ - name: Store test results
37
+ uses: actions/upload-artifact@v2
38
+ with:
39
+ name: main-rspec
40
+ path: ~/rspec
41
+ - name: Store artifacts
42
+ uses: actions/upload-artifact@v2
43
+ with:
44
+ name: main-test-log
45
+ path: log/test.log
@@ -16,9 +16,18 @@ Please follow the recommendations outlined at [keepachangelog.com](http://keepac
16
16
  Changes since last non-beta release.
17
17
 
18
18
  *Please add entries here for your pull requests that are not yet released.*
19
+
20
+ ### [12.0.3] - 2020-09-02
21
+ #### Fixed
22
+ - Async script loading optimizes page load speed. With this fix, a bundle
23
+ can be loaded "async" and a handler function can determine when to hydrate.
24
+ For an example of this, see the [docs for loadable-components SSR](https://loadable-components.com/docs/server-side-rendering/#4-add-loadableready-client-side).
25
+ [PR 1327](https://github.com/shakacode/react_on_rails/pull/1327) by [justin808](https://github.com/justin808).
26
+ Loadable-Components is supported by [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro).
27
+
19
28
  ### [12.0.2] - 2020-07-09
20
29
  #### Fixed
21
- - Remove dependency upon Redux for Typescript types [PR 1323](https://github.com/shakacode/react_on_rails/pull/1306) by [justin808](https://github.com/justin808).
30
+ - Remove dependency upon Redux for Typescript types. [PR 1323](https://github.com/shakacode/react_on_rails/pull/1306) by [justin808](https://github.com/justin808).
22
31
 
23
32
  ### [12.0.1] - 2020-07-09
24
33
  #### Fixed
@@ -934,7 +943,8 @@ Best done with Object destructing:
934
943
  ##### Fixed
935
944
  - Fix several generator related issues.
936
945
 
937
- [Unreleased]: https://github.com/shakacode/react_on_rails/compare/12.0.2...master
946
+ [Unreleased]: https://github.com/shakacode/react_on_rails/compare/12.0.3...master
947
+ [12.0.3]: https://github.com/shakacode/react_on_rails/compare/12.0.2...12.0.3
938
948
  [12.0.2]: https://github.com/shakacode/react_on_rails/compare/12.0.1...12.0.2
939
949
  [12.0.1]: https://github.com/shakacode/react_on_rails/compare/12.0.0...12.0.1
940
950
  [12.0.0]: https://github.com/shakacode/react_on_rails/compare/11.3.0...12.0.0
@@ -62,7 +62,7 @@ cd react_on_rails/
62
62
  yarn
63
63
 
64
64
  # Update the lib directory with babel compiled files
65
- yarn run build:watch
65
+ yarn run build-watch
66
66
  ```
67
67
 
68
68
  You need to do this once:
@@ -58,20 +58,22 @@ To enable HMR functionality you have to use `./bin/webpack-dev-server`
58
58
  ` yarn add @pmmmwh/react-refresh-webpack-plugin react-refresh -D`
59
59
 
60
60
  3. HMR is for use with the webpack-dev-server, so we only add this for the webpack-dev-server.
61
- ```
62
- const isWebpackDevServer = process.env.WEBPACK_DEV_SERVER;
63
-
64
- //plugins
65
- if(isWebpackDevServer) {
66
- environment.plugins.append(
67
- 'ReactRefreshWebpackPlugin',
68
- new ReactRefreshWebpackPlugin({
69
- overlay: {
70
- sockPort: 3035
71
- }
72
- })
73
- );
74
- }
61
+ ```
62
+ const { devServer } = require('@rails/webpacker')
63
+
64
+ const isWebpackDevServer = process.env.WEBPACK_DEV_SERVER
65
+
66
+ //plugins
67
+ if (isWebpackDevServer) {
68
+ environment.plugins.append(
69
+ 'ReactRefreshWebpackPlugin',
70
+ new ReactRefreshWebpackPlugin({
71
+ overlay: {
72
+ sockPort: devServer.port
73
+ }
74
+ })
75
+ )
76
+ }
75
77
  ```
76
78
  We added overlay.sockedPort option in `ReactRefreshWebpackPlugin` to match the webpack dev-server port specified in config/webpacker.yml. Thats way we make sockjs works properly and suppress error in browser console `GET http://localhost:[port]/sockjs-node/info?t=[xxxxxxxxxx] 404 (Not Found)`.
77
79
 
@@ -15,7 +15,10 @@ require "capybara/rspec"
15
15
  require "capybara/rails"
16
16
  Capybara.javascript_driver = :selenium_chrome
17
17
  Capybara.register_driver :selenium_chrome do |app|
18
- Capybara::Selenium::Driver.new(app, browser: :chrome)
18
+ options = Selenium::WebDriver::Chrome::Options.new
19
+ options.add_argument("--headless")
20
+ options.add_argument("--disable-gpu")
21
+ Capybara::Selenium::Driver.new(app, browser: :chrome, options: options)
19
22
  end
20
23
 
21
24
  # Requires supporting ruby files with custom matchers and macros, etc, in
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ReactOnRails
4
- VERSION = "12.0.2"
4
+ VERSION = "12.0.3.beta.0"
5
5
  end
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-on-rails",
3
- "version": "12.0.2",
3
+ "version": "12.0.3-beta.0",
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: 12.0.2
4
+ version: 12.0.3.beta.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Gordon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-26 00:00:00.000000000 Z
11
+ date: 2020-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -318,6 +318,10 @@ files:
318
318
  - ".eslintignore"
319
319
  - ".eslintrc"
320
320
  - ".github/FUNDING.yml"
321
+ - ".github/workflows/lint-js-and-ruby.yml"
322
+ - ".github/workflows/main.yml"
323
+ - ".github/workflows/package-js-tests.yml"
324
+ - ".github/workflows/rspec-package-specs.yml"
321
325
  - ".gitignore"
322
326
  - ".npmignore"
323
327
  - ".prettierignore"
@@ -504,9 +508,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
504
508
  version: 2.5.0
505
509
  required_rubygems_version: !ruby/object:Gem::Requirement
506
510
  requirements:
507
- - - ">="
511
+ - - ">"
508
512
  - !ruby/object:Gem::Version
509
- version: '0'
513
+ version: 1.3.1
510
514
  requirements: []
511
515
  rubygems_version: 3.0.8
512
516
  signing_key: