Skip to content

Commit

Permalink
Remove rollup and test machinery for rails-ujs (#50535)
Browse files Browse the repository at this point in the history
This leaves only the final compiled targets in place.
  • Loading branch information
dhh committed Jan 2, 2024
1 parent 66c1745 commit 8397eb2
Show file tree
Hide file tree
Showing 52 changed files with 14 additions and 4,356 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Expand Up @@ -9,7 +9,7 @@ jobs:
lint:
runs-on: ubuntu-latest
env:
BUNDLE_WITHOUT: db:job:cable:storage:ujs
BUNDLE_WITHOUT: db:job:cable:storage

steps:
- uses: actions/checkout@v4
Expand All @@ -33,7 +33,7 @@ jobs:
python -m pip install --upgrade pip
pip install codespell==2.1.0
- name: Check spelling with codespell
run: codespell --ignore-words=codespell.txt --skip="./vendor/bundle,./actionview/test/ujs/public/vendor/qunit.js,./actiontext/app/assets/javascripts/trix.js,./yarn.lock" || exit 1
run: codespell --ignore-words=codespell.txt --skip="./vendor/bundle,./actiontext/app/assets/javascripts/trix.js,./yarn.lock" || exit 1

- run: tools/railspect changelogs .
- run: tools/railspect configuration .
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rails-new-docker.yml
Expand Up @@ -8,7 +8,7 @@ permissions:
env:
APP_NAME: devrails
APP_PATH: dev/devrails
BUNDLE_WITHOUT: db:job:cable:storage:ujs
BUNDLE_WITHOUT: db:job:cable:storage

jobs:
rails-new-docker:
Expand Down
4 changes: 2 additions & 2 deletions RELEASING_RAILS.md
Expand Up @@ -82,8 +82,8 @@ for setup instructions.

IMPORTANT: Several gems have JavaScript components that are released as npm
packages, so you must have Node.js installed, have an npm account (npmjs.com),
and be a package owner for `@rails/actioncable`, `@rails/actiontext`,
`@rails/activestorage`, and `@rails/ujs`. You can check this by making sure your
and be a package owner for `@rails/actioncable`, `@rails/actiontext`, and
`@rails/activestorage`. You can check this by making sure your
npm user (`npm whoami`) is listed as an owner (`npm owner ls <pkg>`) of each
package. Do not release until you're set up with npm!

Expand Down
23 changes: 0 additions & 23 deletions actionview/.eslintrc

This file was deleted.

2 changes: 0 additions & 2 deletions actionview/.gitignore
@@ -1,6 +1,4 @@
/lib/assets/compiled/
/test/ujs/compiled/
/log/
/test/fixtures/public/absolute/
/test/ujs/log/
/tmp/
9 changes: 0 additions & 9 deletions actionview/RUNNING_UJS_TESTS.rdoc

This file was deleted.

48 changes: 0 additions & 48 deletions actionview/Rakefile
Expand Up @@ -30,46 +30,6 @@ namespace :test do
t.ruby_opts = ["--dev"] if defined?(JRUBY_VERSION)
end

desc "Run tests for rails-ujs"
task :ujs do
system("npm run lint")
exit $?.exitstatus unless $?.success?

begin
listen_host = "localhost"
listen_port = "4567"

FileUtils.mkdir_p("log")
pid = File.open("log/test.log", "w") do |f|
spawn(*%W(rackup test/ujs/config.ru -o #{listen_host} -p #{listen_port} -s puma), out: f, err: f, pgroup: true)
end

start_time = Time.now

loop do
break if system("lsof -i :4567", 1 => File::NULL)

if Time.now - start_time > 5
puts "Failed to start puma after 5 seconds"
puts
puts File.read("log/test.log")
exit 1
end

sleep 0.2
end
# Decode the obfuscate environment variables
decoded_environment_variables = Hash[*Base64.decode64(ENV.fetch("ENCODED", "")).split(/[ =]/)]
system(decoded_environment_variables, "npm", "test")
status = $?.exitstatus
ensure
Process.kill("KILL", -pid) if pid
FileUtils.rm_rf("log")
end

exit status
end

namespace :integration do
# Active Record Integration Tests
Rake::TestTask.new(:active_record) do |t|
Expand All @@ -91,14 +51,6 @@ namespace :test do
end
end

namespace :ujs do
desc "Starts the test server"
task :server do
spawn("bundle", "exec", "rackup", "test/ujs/config.ru", "-p", "4567", "-s", "puma")
system("npm", "test", "--", "--no-single-run", "--browsers", "Chrome")
end
end

task :lines do
load File.expand_path("../tools/line_statistics", __dir__)
files = FileList["lib/**/*.rb"]
Expand Down
20 changes: 0 additions & 20 deletions actionview/app/javascript/MIT-LICENSE

This file was deleted.

61 changes: 0 additions & 61 deletions actionview/app/javascript/README.md

This file was deleted.

33 changes: 0 additions & 33 deletions actionview/app/javascript/rails-ujs/features/confirm.js

This file was deleted.

128 changes: 0 additions & 128 deletions actionview/app/javascript/rails-ujs/features/disable.js

This file was deleted.

0 comments on commit 8397eb2

Please sign in to comment.