Skip to content

SSR fixes #1252

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

Closed
wants to merge 30 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
50debc6
WIP
Judahmeek Feb 13, 2023
f984e13
CI fix
Judahmeek Feb 13, 2023
47443ca
comment out debug logs
Judahmeek Feb 13, 2023
adade56
disable filename hashing
Judahmeek Feb 13, 2023
faa3ee9
clear up unnecessary code
Judahmeek Feb 13, 2023
8e2df22
user editable variable
Judahmeek Feb 14, 2023
f0ee42f
proper priority
Judahmeek Feb 14, 2023
dc72c2e
drop support for webpacker 3
Judahmeek Mar 27, 2023
9f210b5
create shakapacker test
Judahmeek Mar 28, 2023
6ea7a48
update Rakefile for last two changes
Judahmeek Mar 28, 2023
8acd981
drop support for webpacker4
Judahmeek Mar 29, 2023
487fd17
edit to dummy_shakapacker
Judahmeek Mar 29, 2023
7e7d676
remove reference to webpacker_manifest_container
Judahmeek Mar 29, 2023
7518ea5
drop webpacker4 from matrix
Judahmeek Mar 29, 2023
00687d9
only support shakapacker on 2.7.7
Judahmeek Mar 30, 2023
0332dc6
simplify dummy location
Judahmeek Mar 31, 2023
429373c
sprockets is no longer available
Judahmeek Mar 31, 2023
f0c2327
remove redundant workflow
Judahmeek Mar 31, 2023
fb6817c
remove appraisal & add shakapacker
Judahmeek Mar 31, 2023
6ce5492
remove more appraisal references
Judahmeek Mar 31, 2023
fae9ba7
change environment
Judahmeek Mar 31, 2023
9906259
update test suite
Judahmeek Apr 24, 2023
ced2f90
update ubuntu for Github Actions
Judahmeek Apr 25, 2023
23c4617
CI fixes
Judahmeek Apr 26, 2023
ce01772
add sprocket v4 to gemspec dev dependencies
Judahmeek Apr 26, 2023
5bfb21b
CI fixes
Judahmeek May 3, 2023
f23e0ce
per self review
Judahmeek May 3, 2023
082636c
CI fix
Judahmeek May 3, 2023
1b52719
add sprockets logic
Judahmeek May 4, 2023
cc51f40
fix sentinel values
Judahmeek May 4, 2023
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
Binary file added .DS_Store
Binary file not shown.
27 changes: 8 additions & 19 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,28 @@
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Ruby
on: [push, pull_request]
on: [push]
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

running on push & pull_request was redundant

jobs:
test:
strategy:
fail-fast: false
matrix:
ruby:
- 2.7.0
- 2.6.5
# TODO restore testing against JRuby w/ therubyrhino
# - jruby-9.3.7.0
gemfile:
# These have webpacker:
- rails_5.2_no_sprockets
- rails_5.2_no_sprockets_webpacker_3
- rails_5.2_no_sprockets_webpacker_4
# These don't have webpacker:
- rails_5.2_sprockets_3
- rails_5.2_sprockets_4
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
# $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
# Workaround b/c upgrading Minitest broke some mocking expectations
# having to do with automatic kwarg splatting
MT_KWARGS_HACK: 1
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- run: npm -g install yalc
- run: yalc publish
- run: cd test/dummy && yalc add react_ujs
- run: cd test/dummy && yarn
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
ruby-version: 2.7.3
# TODO: Impalement caching
# bundler-cache: true
- run: bundle install
- run: bundle exec rake test

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@ test/*/public/packs
**/node_modules
react-builds/build
coverage/
**/.yalc
**/yalc.*
37 changes: 0 additions & 37 deletions Appraisals

This file was deleted.

18 changes: 12 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,20 @@ gem 'react-rails', path: '../react-rails'

To develop the React_UJS NPM Package, make your changes and run `npm pack` to make a `.tgz` bundle, then in react-rails-example-app `yarn add ../react_ujs-<version>.tgz`

You're also going to need a global version of [yalc](https://github.com/wclr/yalc)
##### Running tests

`bundle exec appraisal install` to install gems on every gemfile Appraisal contains.
`rake test` or `bundle exec appraisal rake test` runs everything.
or run a specific suite using `bundle exec appraisal <appraisal name> rake test`
- Find appraisal names in [Appraisals](Appraisals)
- Integration tests run in Headless Chrome which is included in Chrome (59+ linux,OSX | 60+ Windows)
- ChromeDriver is included with `chromedriver-helper` gem so no need to manually install that 👍
- `bundle`
- `yalc publish`
- `cd test/dummy && yalc add react_ujs`
- `yarn`
- `bundle exec rake test`

If you update react-rails code, then to test the new code:

- `yalc publish` in the root directory
- `cd test/dummy && yalc update react_ujs`
- `bundle exec rake test`

##### Updating the pre-bundled react
- Update React with `rake react:update`
Expand Down
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
source 'http://rubygems.org'

gemspec
# This is an optional dev-dependency, required whenever sprockets is required
28 changes: 17 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ GEM
zeitwerk (~> 2.2)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
appraisal (2.4.1)
bundler
rake
thor (>= 0.14.0)
babel-source (5.8.35)
babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6)
Expand Down Expand Up @@ -147,12 +143,12 @@ GEM
nokogiri (~> 1)
rake
mini_mime (1.0.2)
mini_portile2 (2.8.0)
minitest (5.17.0)
nenv (0.3.0)
nio4r (2.5.2)
nokogiri (1.13.10)
mini_portile2 (~> 2.8.0)
nokogiri (1.13.10-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.13.10-x86_64-linux)
racc (~> 1.4)
notiffany (0.1.3)
nenv (~> 0.1)
Expand All @@ -166,6 +162,8 @@ GEM
public_suffix (4.0.6)
racc (1.6.1)
rack (2.2.6.2)
rack-proxy (0.7.6)
rack
rack-test (2.0.2)
rack (>= 1.3)
rails (6.0.2.1)
Expand Down Expand Up @@ -205,6 +203,12 @@ GEM
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
semantic_range (3.0.0)
shakapacker (6.6.0)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
shellany (0.0.1)
simplecov (0.13.0)
docile (~> 1.1.0)
Expand Down Expand Up @@ -239,11 +243,11 @@ GEM
zeitwerk (2.6.6)

PLATFORMS
ruby
x86_64-darwin-20
x86_64-linux

DEPENDENCIES
appraisal
bundler (~> 2.0)
bundler (= 2.4.9)
capybara
codeclimate-test-reporter
coffee-rails
Expand All @@ -256,9 +260,11 @@ DEPENDENCIES
rails (>= 3.2)
react-rails!
selenium-webdriver
shakapacker
sprockets (~> 4.0.x)
test-unit (~> 2.5)
turbolinks
webdrivers

BUNDLED WITH
2.1.4
2.4.9
18 changes: 7 additions & 11 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,21 @@ namespace :ujs do
end
end

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

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
t.libs << 'test'
t.pattern = ENV['TEST_PATTERN'] || 'test/**/*_test.rb'
t.verbose = ENV['TEST_VERBOSE'] == '1'
Minitest::TestTask.create(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.warning = false
t.test_globs = ENV['TEST_PATTERN'] || 'test/**/*_test.rb'
t.verbose = ENV['TEST_VERBOSE'] == '1'
end

task default: :test

task :test_setup do
load 'webdrivers/Rakefile'
Dir.chdir('./test/dummy_sprockets') do
`yarn install`
end
Dir.chdir('./test/dummy_webpacker3') do
Dir.chdir('./test/dummy') do
`yarn install`
end
end
Expand Down
2 changes: 0 additions & 2 deletions gemfiles/.bundle/config

This file was deleted.

7 changes: 0 additions & 7 deletions gemfiles/rails_5.2_no_sprockets.gemfile

This file was deleted.

Loading