react_on_rails 12.0.0 → 12.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.eslintrc +0 -1
- data/.github/workflows/lint-js-and-ruby.yml +53 -0
- data/.github/workflows/main.yml +178 -0
- data/.github/workflows/package-js-tests.yml +35 -0
- data/.github/workflows/rspec-package-specs.yml +45 -0
- data/.rubocop.yml +18 -40
- data/.travis.yml +8 -4
- data/CHANGELOG.md +41 -20
- data/CONTRIBUTING.md +1 -1
- data/Gemfile +1 -33
- data/Gemfile.development_dependencies +54 -0
- data/NEWS.md +5 -0
- data/README.md +73 -65
- data/SUMMARY.md +1 -1
- data/docs/additional-reading/converting-from-custom-webpack-config-to-rails-webpacker-config.md +10 -0
- data/docs/additional-reading/react-router.md +1 -1
- data/docs/additional-reading/recommended-project-structure.md +69 -0
- data/docs/additional-reading/server-rendering-tips.md +4 -1
- data/docs/api/javascript-api.md +3 -3
- data/docs/api/redux-store-api.md +2 -2
- data/docs/api/view-helpers-api.md +4 -4
- data/docs/basics/client-vs-server-rendering.md +2 -0
- data/docs/basics/configuration.md +1 -1
- data/docs/basics/hmr-and-hot-reloading-with-the-webpack-dev-server.md +64 -9
- data/docs/basics/react-server-rendering.md +8 -5
- data/docs/basics/render-functions-and-railscontext.md +1 -1
- data/docs/basics/upgrading-react-on-rails.md +51 -14
- data/docs/basics/webpack-configuration.md +12 -18
- data/docs/misc/doctrine.md +0 -1
- data/docs/outdated/code-splitting.md +5 -5
- data/docs/tutorial.md +6 -0
- data/lib/generators/react_on_rails/base_generator.rb +8 -1
- data/lib/generators/react_on_rails/templates/dev_tests/spec/rails_helper.rb +4 -1
- data/lib/generators/react_on_rails/templates/dev_tests/spec/simplecov_helper.rb +1 -1
- data/lib/react_on_rails/configuration.rb +2 -0
- data/lib/react_on_rails/git_utils.rb +3 -3
- data/lib/react_on_rails/helper.rb +15 -14
- data/lib/react_on_rails/locales/to_js.rb +0 -4
- data/lib/react_on_rails/locales/to_json.rb +0 -4
- data/lib/react_on_rails/server_rendering_pool/ruby_embedded_java_script.rb +6 -6
- data/lib/react_on_rails/test_helper.rb +2 -0
- data/lib/react_on_rails/test_helper/webpack_assets_compiler.rb +1 -1
- data/lib/react_on_rails/utils.rb +8 -2
- data/lib/react_on_rails/version.rb +1 -1
- data/lib/react_on_rails/webpacker_utils.rb +4 -4
- data/lib/tasks/assets.rake +21 -9
- data/package.json +1 -1
- data/rakelib/docker.rake +0 -5
- data/rakelib/examples.rake +1 -1
- data/rakelib/lint.rake +4 -10
- data/rakelib/release.rake +9 -13
- data/rakelib/run_rspec.rake +9 -10
- data/rakelib/task_helpers.rb +2 -3
- data/react_on_rails.gemspec +3 -17
- metadata +15 -192
- data/docs/additional-reading/webpack-dev-server.md +0 -15
- data/docs/basics/recommended-project-structure.md +0 -77
- data/ruby-lint.yml +0 -25
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cbc3d5e5e388d5f126ac4629c9716ab1e0bbad148617aae2aa0b29a1b8728bf8
|
4
|
+
data.tar.gz: e7890cf4cd11ddc3c1301d4ec3d7b085335e73964498d554c9a6bd67a6155e9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 012bd1f23efd28c306541db16d630ff8732aaeb50828f2c2d595d18d3600c359778a7177943d1331b9a7c24b3c03fc79542098cb166a721d54816f680410db1d
|
7
|
+
data.tar.gz: 1b35e5642aaa762ac451d3098e6250b7b42a2ef100680b235500212269d8d2459d23360b82ee60fa881e8e7ff4d44a3150d435eb015904b00df6ab09b2aa07a5
|
data/.eslintrc
CHANGED
@@ -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
|
data/.rubocop.yml
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# Check out: https://github.com/bbatsov/rubocop
|
3
3
|
|
4
4
|
AllCops:
|
5
|
+
NewCops: enable
|
5
6
|
DisplayCopNames: true
|
6
7
|
TargetRubyVersion: 2.5
|
7
8
|
|
@@ -10,37 +11,36 @@ AllCops:
|
|
10
11
|
- '**/config.ru'
|
11
12
|
- 'Gemfile'
|
12
13
|
- '**/*.rb'
|
14
|
+
- '**/*.rake'
|
13
15
|
|
14
16
|
Exclude:
|
15
|
-
|
16
|
-
- '
|
17
|
-
|
18
|
-
- '
|
17
|
+
<% `git status --ignored --porcelain`.lines.grep(/^!! /).each do |path| %>
|
18
|
+
- <%= path.sub(/^!! /, '') %>
|
19
|
+
<% end %>
|
20
|
+
- '**/*.js'
|
21
|
+
- '**/log/**/*'
|
22
|
+
- '**/node_modules/**/*'
|
23
|
+
- '**/public/**/*'
|
24
|
+
- '**/tmp/**/*'
|
25
|
+
- '.git/**/*'
|
26
|
+
- 'bin/**/*'
|
19
27
|
- 'coverage/**/*'
|
20
28
|
- 'db/**/*'
|
21
29
|
- 'db/schema.rb'
|
22
30
|
- 'db/seeds.rb'
|
23
|
-
- 'client/node_modules/**/*.*'
|
24
|
-
- 'client/node_modules/**/.*'
|
25
|
-
- 'bin/**/*'
|
26
|
-
- !ruby/regexp /old_and_unused\.rb$/
|
27
|
-
- 'spec/react_on_rails/dummy-for-generators/**/*'
|
28
|
-
- 'spec/dummy/Procfile.*'
|
29
|
-
- 'spec/dummy/bin/**/*'
|
30
|
-
- 'spec/dummy/node_modules/**/*'
|
31
|
-
- 'spec/dummy/node_modules/**/.*'
|
32
|
-
- 'gen-examples/examples/**/.*'
|
33
31
|
- 'gen-examples/examples/**/*'
|
32
|
+
- 'node_modules/**/*'
|
33
|
+
- 'spec/dummy/bin/*'
|
34
|
+
- 'spec/fixtures/**/*'
|
35
|
+
- 'spec/react_on_rails/dummy-for-generators/**/*'
|
36
|
+
- 'tmp/**/*'
|
37
|
+
- 'vendor/**/*'
|
34
38
|
|
35
39
|
Naming/FileName:
|
36
40
|
Exclude:
|
37
41
|
- 'Gemfile'
|
38
42
|
- 'spec/dummy/Gemfile'
|
39
43
|
|
40
|
-
# Turn off until we require 2.3 ruby
|
41
|
-
Style/SafeNavigation:
|
42
|
-
Enabled: false
|
43
|
-
|
44
44
|
Layout/LineLength:
|
45
45
|
Max: 120
|
46
46
|
|
@@ -96,25 +96,3 @@ Naming/RescuedExceptionsVariableName:
|
|
96
96
|
Style/GlobalVars:
|
97
97
|
Exclude:
|
98
98
|
- 'spec/dummy/config/environments/development.rb'
|
99
|
-
|
100
|
-
Style/FrozenStringLiteralComment:
|
101
|
-
EnforcedStyle: always
|
102
|
-
|
103
|
-
Layout/EmptyLinesAroundAttributeAccessor:
|
104
|
-
Enabled: true
|
105
|
-
|
106
|
-
Layout/SpaceAroundMethodCallOperator:
|
107
|
-
Enabled: true
|
108
|
-
|
109
|
-
Lint/RaiseException:
|
110
|
-
Enabled: true
|
111
|
-
|
112
|
-
Lint/StructNewOverride:
|
113
|
-
Enabled: true
|
114
|
-
|
115
|
-
Style/ExponentialNotation:
|
116
|
-
Enabled: true
|
117
|
-
|
118
|
-
Style/SlicingWithRange:
|
119
|
-
Enabled: true
|
120
|
-
|
data/.travis.yml
CHANGED
@@ -35,15 +35,19 @@ before_install:
|
|
35
35
|
|
36
36
|
install:
|
37
37
|
- travis_retry gem install bundler -v '>2'
|
38
|
-
- travis_retry nvm install
|
38
|
+
- travis_retry nvm install 14
|
39
39
|
- node -v
|
40
40
|
- travis_retry npm i -g yarn
|
41
|
-
- travis_retry bundle install
|
42
41
|
- travis_retry yarn global add yalc
|
42
|
+
- travis_retry yalc add react-on-rails
|
43
|
+
- travis_retry yarn
|
44
|
+
- travis_retry bundle install
|
45
|
+
- travis_retry yarn run build
|
43
46
|
- travis_retry yalc publish
|
44
|
-
-
|
47
|
+
- cd spec/dummy
|
48
|
+
- travis_retry yalc add react-on-rails
|
45
49
|
- travis_retry yarn
|
46
|
-
-
|
50
|
+
- cd ../..
|
47
51
|
- bundle exec rake prepare_for_ci
|
48
52
|
|
49
53
|
before_script:
|
data/CHANGELOG.md
CHANGED
@@ -11,22 +11,39 @@ We specialize in helping companies to quickly and efficiently move from versions
|
|
11
11
|
## Contributors
|
12
12
|
Please follow the recommendations outlined at [keepachangelog.com](http://keepachangelog.com/). Please use the existing headings and styling as a guide, and add a link for the version diff at the bottom of the file. Also, please update the `Unreleased` link to compare to the latest release version.
|
13
13
|
|
14
|
-
##
|
14
|
+
## Versions
|
15
|
+
### [Unreleased]
|
15
16
|
Changes since last non-beta release.
|
16
17
|
|
17
18
|
*Please add entries here for your pull requests that are not yet released.*
|
19
|
+
### [12.0.4] - 2020-11-14
|
20
|
+
#### Fixed
|
21
|
+
- Install generator now specifies the version. Fixes [React on Rails Generator installs the older npm package #1336](https://github.com/shakacode/react_on_rails/issues/1336). [PR 1338Fix Generator to use Exact NPM Version](https://github.com/shakacode/react_on_rails/pull/1338) by by [justin808](https://github.com/justin808).
|
18
22
|
|
19
|
-
|
20
|
-
|
23
|
+
### [12.0.3] - 2020-09-20
|
24
|
+
#### Fixed
|
25
|
+
- Async script loading optimizes page load speed. With this fix, a bundle
|
26
|
+
can be loaded "async" and a handler function can determine when to hydrate.
|
27
|
+
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).
|
28
|
+
[PR 1327](https://github.com/shakacode/react_on_rails/pull/1327) by [justin808](https://github.com/justin808).
|
29
|
+
Loadable-Components is supported by [React on Rails Pro](https://www.shakacode.com/react-on-rails-pro).
|
21
30
|
|
22
|
-
### [12.0.
|
23
|
-
|
31
|
+
### [12.0.2] - 2020-07-09
|
32
|
+
#### Fixed
|
33
|
+
- Remove dependency upon Redux for Typescript types. [PR 1323](https://github.com/shakacode/react_on_rails/pull/1306) by [justin808](https://github.com/justin808).
|
24
34
|
|
25
|
-
### [12.0.
|
26
|
-
|
35
|
+
### [12.0.1] - 2020-07-09
|
36
|
+
#### Fixed
|
37
|
+
- Changed invocation of webpacker:clean to use a very large number of versions so it does not acidentally delete the server-bundle.js. [PR 1306](https://github.com/shakacode/react_on_rails/pull/1306) by By [justin808](https://github.com/justin808).
|
38
|
+
|
39
|
+
### [12.0.0] - 2020-07-08
|
40
|
+
For upgrade instructions, see [docs/basics/upgrading-react-on-rails.md](./docs/basics/upgrading-react-on-rails.md).
|
27
41
|
|
28
|
-
|
29
|
-
|
42
|
+
#### Major Improvements
|
43
|
+
1. **React Hooks Support** for top level components
|
44
|
+
2. **Typescript bindings**
|
45
|
+
3. **rails/webpacker** "just works" with React on Rails by default.
|
46
|
+
4. i18n support for generating a JSON file rather than a JS file.
|
30
47
|
|
31
48
|
#### BREAKING CHANGE
|
32
49
|
In order to solve the issues regarding React Hooks compatibility, the number of parameters
|
@@ -39,10 +56,14 @@ invoked to return the React component. In that case, you won't need to pass any
|
|
39
56
|
See [docs/basics/upgrading-react-on-rails](./docs/basics/upgrading-react-on-rails.md#upgrading-to-v12)
|
40
57
|
for details.
|
41
58
|
|
42
|
-
|
59
|
+
#### Other Updates
|
60
|
+
* `react_on_rails` fully supports `rails/webpacker`. The example test app in `spec/dummy` was recently converted over to use rails/webpacker v4+. It's a good example of how to leverage rails/webpacker's webpack configuration for server-side rendering.
|
61
|
+
* Changed the precompile task to use the rails/webpacker one by default
|
62
|
+
* Updated generators to use React hooks
|
63
|
+
* Requires the use of rails/webpacker view helpers
|
43
64
|
* If the webpacker webpack config files exist, then React on Rails will not override the default
|
44
|
-
assets:precompile setup by rails/webpacker.
|
45
|
-
like config/webpack/production.js
|
65
|
+
assets:precompile setup by rails/webpacker. If you are not using the rails/webpacker setup for webpack,
|
66
|
+
then be sure to remove the JS files inside of config/webpack, like `config/webpack/production.js.`
|
46
67
|
* Removed **env_javascript_include_tag** and **env_stylesheet_link_tag** as these are replaced by view helpers
|
47
68
|
from rails/webpacker
|
48
69
|
* Removal of support for old Rubies and Rails.
|
@@ -62,13 +83,12 @@ for details.
|
|
62
83
|
* Added support to export locales in JSON format. New option added `i18n_output_format` which allows to
|
63
84
|
specify locales format either `JSON` or `JS`. **`JSON` format is now the default.**
|
64
85
|
|
65
|
-
Use this config setting to get the old behavior: config.i18n_output_format = 'js'
|
86
|
+
**Use this config setting to get the old behavior: config.i18n_output_format = 'js'**
|
66
87
|
|
67
88
|
[PR 1271](https://github.com/shakacode/react_on_rails/pull/1271) by [ashgaliyev](https://github.com/ashgaliyev).
|
68
89
|
|
69
|
-
#### Improved
|
70
90
|
- Added Typescript definitions to the Node package. By [justin808](https://github.com/justin808) and [judahmeek](https://github.com/judahmeek) in [PR 1287](https://github.com/shakacode/react_on_rails/pull/1287).
|
71
|
-
- Removed
|
91
|
+
- Removed restriction to keep the server bundle in the same directory with the client bundles. Rails/webpacker 4 has an advanced cleanup that will remove any files in the directory of other webpack files. Removing this restriction allows the server bundle to be created in a sibling directory. By [justin808](https://github.com/shakacode/react_on_rails/pull/1240).
|
72
92
|
|
73
93
|
### [11.3.0] - 2019-05-24
|
74
94
|
#### Added
|
@@ -926,11 +946,12 @@ Best done with Object destructing:
|
|
926
946
|
##### Fixed
|
927
947
|
- Fix several generator related issues.
|
928
948
|
|
929
|
-
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/12.0.
|
930
|
-
[12.0.
|
931
|
-
[12.0.
|
932
|
-
[12.0.
|
933
|
-
[12.0.
|
949
|
+
[Unreleased]: https://github.com/shakacode/react_on_rails/compare/12.0.4...master
|
950
|
+
[12.0.4]: https://github.com/shakacode/react_on_rails/compare/12.0.3...12.0.4
|
951
|
+
[12.0.3]: https://github.com/shakacode/react_on_rails/compare/12.0.2...12.0.3
|
952
|
+
[12.0.2]: https://github.com/shakacode/react_on_rails/compare/12.0.1...12.0.2
|
953
|
+
[12.0.1]: https://github.com/shakacode/react_on_rails/compare/12.0.0...12.0.1
|
954
|
+
[12.0.0]: https://github.com/shakacode/react_on_rails/compare/11.3.0...12.0.0
|
934
955
|
[11.3.0]: https://github.com/shakacode/react_on_rails/compare/11.2.2...11.3.0
|
935
956
|
[11.2.2]: https://github.com/shakacode/react_on_rails/compare/11.2.1...11.2.2
|
936
957
|
[11.2.1]: https://github.com/shakacode/react_on_rails/compare/11.1.8...11.2.1
|