Skip to content

Fix ReactDomClient bug #1278

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,34 @@
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Ruby
on: [push, pull_request]

on: [push]
jobs:
check_react_and_ujs:
strategy:
fail-fast: true
matrix:
ruby: [2.7]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
bundler: 2.4.9
ruby-version: ${{ matrix.ruby }}
- uses: actions/setup-node@v3
- run: bundle install
- run: yarn
- run: bundle exec rake react:update
- run: bundle exec rake ujs:update
- run: ./check_for_uncommitted_files.sh
Comment on lines +27 to +29
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is better to extract this logic into another rake task and use it in both:

  • Release script
  • CI

Is will be DRY and also prevents adding bash script in the root of the project.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced.


test:
needs: check_react_and_ujs
strategy:
fail-fast: false
matrix:
ruby:
- 2.7.0
- 2.6.5
# TODO restore testing against JRuby w/ therubyrhino
# - jruby-9.3.7.0
ruby: [2.7]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR, but I think we should add ruby 3 to the matrix for our tests.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

followup PR

gemfile:
# These have webpacker:
- rails_5.2_no_sprockets
Expand All @@ -37,6 +54,7 @@ jobs:
- uses: actions/setup-node@v3
- uses: ruby/setup-ruby@v1
with:
bundler: 2.4.9
ruby-version: ${{ matrix.ruby }}
# TODO: Impalement caching
# bundler-cache: true
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ Changes since last non-beta release.

_Please add entries here for your pull requests that are not yet released._

## [2.7.1] - 2023-05-19

#### Bug Fixes
- Fix ReactDomClient initialization error during SSR. #1278

## [2.7.0] - 2023-05-06

#### New Features
Expand Down Expand Up @@ -541,5 +546,6 @@ _Please add entries here for your pull requests that are not yet released._
- Server rendering with `prerender: true`
- Transform `.jsx` in the asset pipeline

[Unreleased]: https://github.com/reactjs/react-rails/compare/v2.7.0...master
[Unreleased]: https://github.com/reactjs/react-rails/compare/v2.7.1...master
[2.7.1]: https://github.com/shakacode/shakapacker/compare/v2.7.0...v2.7.1
[2.7.0]: https://github.com/shakacode/shakapacker/compare/v2.6.2...v2.7.0
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ PLATFORMS

DEPENDENCIES
appraisal
bundler (~> 2.0)
bundler (= 2.4.9)
capybara
codeclimate-test-reporter
coffee-rails
Expand All @@ -263,4 +263,4 @@ DEPENDENCIES
webdrivers

BUNDLED WITH
2.4.10
2.4.9
10 changes: 5 additions & 5 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace :react do

desc 'Install the JavaScript dependencies'
task :install do
yarn_run_in('react-builds', 'upgrade')
yarn_run_in('react-builds', 'install')
end

desc 'Build the JS bundles with Webpack'
Expand All @@ -49,7 +49,7 @@ namespace :ujs do

desc 'Install the JavaScript dependencies'
task :install do
`yarn upgrade`
`yarn install`
end

desc 'Build the JS bundles with Webpack'
Expand All @@ -71,12 +71,12 @@ namespace :ujs do
end

require 'appraisal'
require 'rake/testtask'
require 'minitest/test_task'

Rake::TestTask.new(:test) do |t|
Minitest::TestTask.create(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = ENV['TEST_PATTERN'] || 'test/**/*_test.rb'
t.test_globs = ENV['TEST_PATTERN'] || 'test/**/*_test.rb'
t.verbose = ENV['TEST_VERBOSE'] == '1'
t.warning = false
end
Expand Down
14 changes: 14 additions & 0 deletions check_for_uncommitted_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash
set -e

status=$(git status --porcelain)
if [ -n "$status" ]; then
status="${status//'%'/'%25'}"
status="${status//$'\n'/'%0A'}"
status="${status//$'\r'/'%0D'}"
echo "$status"
exit 1
else
echo "The repository is clean"
exit 0
fi
14 changes: 7 additions & 7 deletions gemfiles/rails_5.2_no_sprockets.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
react-rails (2.6.2)
react-rails (2.7.0)
babel-transpiler (>= 0.7.0)
connection_pool
execjs
Expand Down Expand Up @@ -95,6 +95,7 @@ GEM
execjs (2.7.0)
ffi (1.11.3)
formatador (0.2.5)
gem-release (2.2.2)
globalid (0.6.0)
activesupport (>= 5.0)
guard (2.16.1)
Expand Down Expand Up @@ -127,12 +128,10 @@ GEM
marcel (1.0.2)
method_source (0.9.2)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
minitest (5.16.3)
nenv (0.3.0)
nio4r (2.5.8)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
nokogiri (1.13.8-x86_64-darwin)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand Down Expand Up @@ -214,15 +213,16 @@ GEM
nokogiri (~> 1.8)

PLATFORMS
ruby
x86_64-darwin-20

DEPENDENCIES
appraisal
bundler (~> 2.0)
bundler (= 2.4.9)
capybara
codeclimate-test-reporter
coffee-rails
es5-shim-rails (>= 2.0.5)
gem-release
guard
guard-minitest
jbuilder
Expand All @@ -236,4 +236,4 @@ DEPENDENCIES
webdrivers

BUNDLED WITH
2.1.4
2.4.9
16 changes: 8 additions & 8 deletions gemfiles/rails_5.2_no_sprockets_webpacker_3.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
react-rails (2.6.2)
react-rails (2.7.0)
babel-transpiler (>= 0.7.0)
connection_pool
execjs
Expand Down Expand Up @@ -95,6 +95,7 @@ GEM
execjs (2.7.0)
ffi (1.11.3)
formatador (0.2.5)
gem-release (2.2.2)
globalid (0.6.0)
activesupport (>= 5.0)
guard (2.16.1)
Expand All @@ -115,7 +116,7 @@ GEM
jbuilder (2.9.1)
activesupport (>= 4.2.0)
json (2.3.0)
libv8 (7.3.492.27.1)
libv8 (7.3.492.27.1-x86_64-darwin-20)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand All @@ -128,14 +129,12 @@ GEM
marcel (1.0.2)
method_source (0.9.2)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
mini_racer (0.2.8)
libv8 (>= 6.9.411)
minitest (5.16.3)
nenv (0.3.0)
nio4r (2.5.8)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
nokogiri (1.13.8-x86_64-darwin)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand Down Expand Up @@ -223,15 +222,16 @@ GEM
nokogiri (~> 1.8)

PLATFORMS
ruby
x86_64-darwin-20

DEPENDENCIES
appraisal
bundler (~> 2.0)
bundler (= 2.4.9)
capybara
codeclimate-test-reporter
coffee-rails
es5-shim-rails (>= 2.0.5)
gem-release
guard
guard-minitest
jbuilder
Expand All @@ -248,4 +248,4 @@ DEPENDENCIES
webpacker (~> 3.0)

BUNDLED WITH
2.1.4
2.4.9
16 changes: 8 additions & 8 deletions gemfiles/rails_5.2_no_sprockets_webpacker_4.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
react-rails (2.6.2)
react-rails (2.7.0)
babel-transpiler (>= 0.7.0)
connection_pool
execjs
Expand Down Expand Up @@ -95,6 +95,7 @@ GEM
execjs (2.7.0)
ffi (1.11.3)
formatador (0.2.5)
gem-release (2.2.2)
globalid (0.6.0)
activesupport (>= 5.0)
guard (2.16.1)
Expand All @@ -115,7 +116,7 @@ GEM
jbuilder (2.9.1)
activesupport (>= 4.2.0)
json (2.3.0)
libv8 (7.3.492.27.1)
libv8 (7.3.492.27.1-x86_64-darwin-20)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand All @@ -128,14 +129,12 @@ GEM
marcel (1.0.2)
method_source (0.9.2)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
mini_racer (0.2.8)
libv8 (>= 6.9.411)
minitest (5.16.3)
nenv (0.3.0)
nio4r (2.5.8)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
nokogiri (1.13.8-x86_64-darwin)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand Down Expand Up @@ -223,15 +222,16 @@ GEM
nokogiri (~> 1.8)

PLATFORMS
ruby
x86_64-darwin-20

DEPENDENCIES
appraisal
bundler (~> 2.0)
bundler (= 2.4.9)
capybara
codeclimate-test-reporter
coffee-rails
es5-shim-rails (>= 2.0.5)
gem-release
guard
guard-minitest
jbuilder
Expand All @@ -248,4 +248,4 @@ DEPENDENCIES
webpacker (~> 4.0)

BUNDLED WITH
2.1.4
2.4.9
16 changes: 8 additions & 8 deletions gemfiles/rails_5.2_sprockets_3.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
react-rails (2.6.2)
react-rails (2.7.0)
babel-transpiler (>= 0.7.0)
connection_pool
execjs
Expand Down Expand Up @@ -95,6 +95,7 @@ GEM
execjs (2.7.0)
ffi (1.11.3)
formatador (0.2.5)
gem-release (2.2.2)
globalid (0.6.0)
activesupport (>= 5.0)
guard (2.16.1)
Expand All @@ -115,7 +116,7 @@ GEM
jbuilder (2.9.1)
activesupport (>= 4.2.0)
json (2.3.0)
libv8 (7.3.492.27.1)
libv8 (7.3.492.27.1-x86_64-darwin-20)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand All @@ -128,14 +129,12 @@ GEM
marcel (1.0.2)
method_source (0.9.2)
mini_mime (1.1.2)
mini_portile2 (2.8.0)
mini_racer (0.2.8)
libv8 (>= 6.9.411)
minitest (5.16.3)
nenv (0.3.0)
nio4r (2.5.8)
nokogiri (1.13.8)
mini_portile2 (~> 2.8.0)
nokogiri (1.13.8-x86_64-darwin)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand Down Expand Up @@ -217,15 +216,16 @@ GEM
nokogiri (~> 1.8)

PLATFORMS
ruby
x86_64-darwin-20

DEPENDENCIES
appraisal
bundler (~> 2.0)
bundler (= 2.4.9)
capybara
codeclimate-test-reporter
coffee-rails
es5-shim-rails (>= 2.0.5)
gem-release
guard
guard-minitest
jbuilder
Expand All @@ -242,4 +242,4 @@ DEPENDENCIES
webdrivers

BUNDLED WITH
2.1.4
2.4.9
Loading