Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest]
ruby: ['2.7', '3.0']
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
env:
# $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/LintingGemfile
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
fail-fast: true
matrix:
ruby: [2.7]
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
runs-on: ubuntu-latest
env:
PACKAGE_JSON_FALLBACK_MANAGER: yarn_classic
Expand All @@ -41,13 +41,23 @@ jobs:
with:
bundler: 2.4.9
ruby-version: ${{ matrix.ruby }}
- name: Save dummy app ruby gems to cache
- name: Set Gemfile for Ruby 2.7
if: matrix.ruby == '2.7'
run: echo "BUNDLE_GEMFILE=${{ github.workspace }}/gemfiles/ruby27.gemfile" >> $GITHUB_ENV
- name: Save dummy app ruby gems to cache (Ruby 2.7)
if: matrix.ruby == '2.7'
uses: actions/cache@v3
with:
path: vendor/bundle
key: root-gem-cache-${{ hashFiles('Gemfile.lock') }}
key: root-gem-cache-${{ matrix.ruby }}-${{ hashFiles('gemfiles/ruby27.gemfile.lock') }}
- name: Save dummy app ruby gems to cache (Ruby 3.0+)
if: matrix.ruby != '2.7'
uses: actions/cache@v3
with:
path: vendor/bundle
key: root-gem-cache-${{ matrix.ruby }}-${{ hashFiles('Gemfile.lock') }}
- name: Install Ruby Gems
run: bundle lock --add-platform 'x86_64-linux' && bundle check --path=vendor/bundle || bundle _2.4.9_ install --path=vendor/bundle --jobs=4 --retry=3
run: bundle check --path=${{ github.workspace }}/vendor/bundle || bundle _2.4.9_ install --path=${{ github.workspace }}/vendor/bundle --jobs=4 --retry=3
- run: yarn
- run: bundle exec rake react:update
- run: bundle exec rake ujs:update
Expand All @@ -67,7 +77,7 @@ jobs:
installer: pnpm
- name: bun
installer: bun
ruby: [2.7]
ruby: ['2.7', '3.0', '3.1', '3.2', '3.3']
gemfile:
# These have shakapacker:
- base
Expand Down Expand Up @@ -108,13 +118,16 @@ jobs:
ruby-version: ${{ matrix.ruby }}
- run: bundle config set --local path 'test/dummy/vendor/bundle'
- run: ./test/bin/create-fake-js-package-managers ${{ matrix.js_package_manager.installer }}
- name: Use Ruby 2.7 specific lockfile
if: matrix.ruby == '2.7'
run: cp gemfiles/${{ matrix.gemfile }}.gemfile.ruby27.lock gemfiles/${{ matrix.gemfile }}.gemfile.lock
- name: Save dummy app ruby gems to cache
uses: actions/cache@v3
with:
path: test/dummy/vendor/bundle
key: dummy-app-gem-cache-${{ hashFiles(format('{0}/gemfiles/{1}.gemfile.lock', github.workspace, matrix.gemfile)) }}
key: dummy-app-gem-cache-${{ matrix.ruby }}-${{ hashFiles(format('{0}/gemfiles/{1}.gemfile.lock', github.workspace, matrix.gemfile)) }}
- name: Install Ruby Gems for dummy app
run: bundle lock --add-platform 'x86_64-linux' && bundle check --path=test/dummy/vendor/bundle || bundle _2.4.9_ install --frozen --path=test/dummy/vendor/bundle --jobs=4 --retry=3
run: bundle check --path=test/dummy/vendor/bundle || bundle _2.4.9_ install --frozen --path=test/dummy/vendor/bundle --jobs=4 --retry=3
- run: cd test/dummy && yalc add react_ujs && ${{ matrix.js_package_manager.installer }} install
- run: bundle exec rake test
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ coverage/
yalc.lock
/vendor/bundle
.bundle/config
gemfiles/.bundle/
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ Changes since the last non-beta release.

_Please add entries here for your pull requests that have not yet been released. Include LINKS for PRs and committers._

## [3.3.0] - 2024-11-22

#### Added
- Support for Propshaft server rendering. [PR 1345](https://github.com/reactjs/react-rails/pull/1345) by [elektronaut](https://github.com/elektronaut)

## [3.2.1] - 2024-05-16
Expand Down Expand Up @@ -590,8 +593,9 @@ _Please add entries here for your pull requests that have not yet been released.
- Server rendering with `prerender: true`
- Transform `.jsx` in the asset pipeline

[Unreleased]: https://github.com/reactjs/react-rails/compare/v3.2.1...main
[3.2.1]: https://github.com/reactjs/react-rails/compare/v3.2.1...v3.2.1
[Unreleased]: https://github.com/reactjs/react-rails/compare/v3.3.0...main
[3.3.0]: https://github.com/reactjs/react-rails/compare/v3.2.1...v3.3.0
[3.2.1]: https://github.com/reactjs/react-rails/compare/v3.2.0...v3.2.1
[3.2.0]: https://github.com/reactjs/react-rails/compare/v3.1.1...v3.2.0
[3.1.1]: https://github.com/reactjs/react-rails/compare/v3.1.0...v3.1.1
[3.1.0]: https://github.com/reactjs/react-rails/compare/v3.0.0...v3.1.0
Expand Down
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@

source "http://rubygems.org"

# Nokogiri version constraints for different Ruby versions
# Ruby 3.0+ can use nokogiri 1.17.x which provides better compatibility
# Ruby 2.7 uses gemfiles/ruby27.gemfile with nokogiri 1.15.x
gem "nokogiri", "~> 1.17.0" if RUBY_VERSION >= "3.0"

gemspec
22 changes: 9 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ GEM
babel-source (>= 4.0, < 6)
execjs (~> 2.0)
builder (3.2.4)
byebug (11.0.1)
capybara (3.37.1)
byebug (11.1.3)
capybara (3.39.2)
addressable
matrix
mini_mime (>= 0.1.3)
Expand Down Expand Up @@ -155,9 +155,8 @@ GEM
net-smtp
marcel (1.0.4)
matrix (0.4.2)
method_source (1.0.0)
method_source (1.1.0)
mini_mime (1.1.2)
mini_portile2 (2.8.6)
minitest (5.17.0)
minitest-retry (0.2.2)
minitest (>= 5.0)
Expand All @@ -172,25 +171,22 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
nokogiri (1.17.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.14.3-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.14.3-x86_64-linux)
nokogiri (1.17.2-x86_64-linux)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
package_json (0.1.0)
pry (0.14.2)
pry (0.15.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.8.0)
byebug (~> 11.0)
pry (~> 0.10)
public_suffix (4.0.6)
racc (1.6.2)
racc (1.8.1)
rack (2.2.6.4)
rack-test (2.0.2)
rack (>= 1.3)
Expand Down Expand Up @@ -256,7 +252,6 @@ GEM
zeitwerk (2.6.6)

PLATFORMS
ruby
x86_64-darwin-20
x86_64-linux

Expand All @@ -273,8 +268,9 @@ DEPENDENCIES
jbuilder
listen (~> 3.0.0)
minitest-retry
nokogiri (~> 1.17.0)
package_json
pry-byebug
pry-byebug (~> 3.8.0)
rails (~> 7.0.7, >= 7.0.7.2)
react-rails!
selenium-webdriver
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ React-Rails is a flexible tool to use [React](http://facebook.github.io/react/)

While ShakaCode will continue to support this gem, you might consider migrating to [React on Rails](https://github.com/shakacode/react_on_rails) or [React on Rails Pro with proper Node rendering](https://www.shakacode.com/react-on-rails-pro/).

Why? React on Rails code receives much more active development and testing. For example, consider the [ReactRailsUJS](https://github.com/reactjs/react-rails/blob/master/react_ujs/index.js) implementation compared to the [ReactOnRails Node package](https://github.com/shakacode/react_on_rails/tree/master/node_package) which is written in TypeScript. For another example, React on Rails has work underway to support the latest React features, such as [React Server Components](https://react.dev/reference/rsc/server-components).
Why? React on Rails code receives much more active development and testing. For example, consider the [ReactRailsUJS](https://github.com/reactjs/react-rails/blob/main/react_ujs/index.js) implementation compared to the [ReactOnRails Node package](https://github.com/shakacode/react_on_rails/tree/master/node_package) which is written in TypeScript. For another example, React on Rails has work underway to support the latest React features, such as [React Server Components](https://react.dev/reference/rsc/server-components).

You can find [migration to React on Rails steps here](https://github.com/reactjs/react-rails/blob/master/docs/migrating-from-react-rails-to-react_on_rails.md).
You can find [migration to React on Rails steps here](https://github.com/reactjs/react-rails/blob/main/docs/migrating-from-react-rails-to-react_on_rails.md).

---
## ShakaCode Support
Expand Down
2 changes: 1 addition & 1 deletion VERSIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ You can control what version of React.js (and JSXTransformer) is used by `react-

| Gem | React.js | |
| -------- | -------- | -------------- |
| master | 16.14.0 |
| main | 16.14.0 |
| 2.6.2 | 16.14.0 |
| 2.6.1 | 16.9.0 |
| 2.6.0 | 16.8.6 |
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,4 @@ MyApp::Application.configure do
end
```

Be sure to restart your Rails server after changing these files. See [VERSIONS.md](https://github.com/reactjs/react-rails/blob/master/VERSIONS.md) to learn which version of React.js is included with your `react-rails` version. In some edge cases you may need to bust the sprockets cache with `rake tmp:clear`
Be sure to restart your Rails server after changing these files. See [VERSIONS.md](https://github.com/reactjs/react-rails/blob/main/VERSIONS.md) to learn which version of React.js is included with your `react-rails` version. In some edge cases you may need to bust the sprockets cache with `rake tmp:clear`
4 changes: 4 additions & 0 deletions gemfiles/base.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@ source "http://rubygems.org"

gem "rails", "~> 7.0.x"

# Nokogiri version constraints for different Ruby versions
gem "nokogiri", "~> 1.15.0" if RUBY_VERSION < "3.0"
gem "nokogiri", "~> 1.17.0" if RUBY_VERSION >= "3.0"

gemspec path: "../"
25 changes: 17 additions & 8 deletions gemfiles/base.gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ..
specs:
react-rails (3.2.0)
react-rails (3.2.1)
babel-transpiler (>= 0.7.0)
connection_pool
execjs
Expand Down Expand Up @@ -88,11 +88,11 @@ GEM
execjs (~> 2.0)
builder (3.2.4)
byebug (11.1.3)
capybara (3.38.0)
capybara (3.40.0)
addressable
matrix
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
nokogiri (~> 1.11)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (>= 1.5, < 3.0)
Expand Down Expand Up @@ -171,9 +171,12 @@ GEM
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.13.8-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.8-x86_64-linux)
nokogiri (1.17.2-arm64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.17.2-x86_64-linux)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand All @@ -182,9 +185,9 @@ GEM
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
pry-byebug (3.10.1)
pry-byebug (3.8.0)
byebug (~> 11.0)
pry (>= 0.13, < 0.15)
pry (~> 0.10)
public_suffix (5.0.1)
racc (1.6.2)
rack (2.2.7)
Expand Down Expand Up @@ -237,6 +240,9 @@ GEM
thor (1.2.2)
tilt (2.2.0)
timeout (0.4.1)
turbo-rails (2.0.12)
actionpack (>= 6.0.0)
railties (>= 6.0.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
websocket (1.2.10)
Expand All @@ -248,6 +254,7 @@ GEM
zeitwerk (2.6.7)

PLATFORMS
arm64-darwin-24
x86_64-darwin-20
x86_64-linux

Expand All @@ -264,12 +271,14 @@ DEPENDENCIES
jbuilder
listen (~> 3.0.0)
minitest-retry
nokogiri (~> 1.17.0)
package_json
pry-byebug
pry-byebug (~> 3.8.0)
rails (~> 7.0.x)
react-rails!
selenium-webdriver
test-unit (~> 2.5)
turbo-rails

BUNDLED WITH
2.4.9
Loading