Skip to content

Commit

Permalink
Replace Webpacker with esbuild / jsbundling-rails
Browse files Browse the repository at this point in the history
  • Loading branch information
bensheldon committed Apr 23, 2023
1 parent c5bde23 commit 0d3edb5
Show file tree
Hide file tree
Showing 32 changed files with 176 additions and 9,124 deletions.
1 change: 0 additions & 1 deletion .browserslistrc

This file was deleted.

2 changes: 0 additions & 2 deletions .eslintrc.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ npm-debug.log
/yarn-error.log
yarn-debug.log*
.yarn-integrity

/app/assets/builds/*
!/app/assets/builds/.keep
3 changes: 0 additions & 3 deletions .postcssrc.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .stylelintrc

This file was deleted.

1 change: 1 addition & 0 deletions Brewfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# frozen_string_literal: true

brew "chromedriver"
brew "esbuild"
3 changes: 2 additions & 1 deletion Dockerfile.fly
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ruby:3.2.1-bullseye
FROM ruby:3.2.2-bullseye

ENV BUNDLE_JOBS=4
ENV BUNDLE_RETRY=3
Expand All @@ -14,6 +14,7 @@ RUN apt-get update -qq \
nodejs \
npm \
postgresql-client \
esbuild \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /project
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ gem 'groupdate'
gem 'jbuilder', '~> 2.5'
gem 'jquery-rails'
gem 'jquery-tablesorter'
gem 'jsbundling-rails'
gem 'kramdown'
gem 'lograge'
gem 'momentjs-rails'
Expand All @@ -42,7 +43,6 @@ gem 'slim'
gem 'slim-rails'
gem 'textacular'
gem 'uglifier', '>= 1.3.0'
gem 'webpacker'

group :production, :staging do
gem 'rack-timeout'
Expand Down
12 changes: 3 additions & 9 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ GEM
thor (>= 0.14, < 2.0)
jquery-tablesorter (1.27.2)
railties (>= 3.2)
jsbundling-rails (1.1.1)
railties (>= 6.0.0)
json (2.6.3)
kramdown (2.4.0)
rexml
Expand Down Expand Up @@ -274,8 +276,6 @@ GEM
rack (2.2.6.4)
rack-host-redirect (1.3.0)
rack
rack-proxy (0.7.6)
rack
rack-test (2.1.0)
rack (>= 1.3)
rack-timeout (0.6.3)
Expand Down Expand Up @@ -385,7 +385,6 @@ GEM
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2, < 3.0)
websocket (~> 1.0)
semantic_range (3.0.0)
sentry-raven (2.13.0)
faraday (>= 0.7.6, < 1.0)
sitemap_generator (6.3.0)
Expand Down Expand Up @@ -428,11 +427,6 @@ GEM
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webpacker (5.4.4)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
webrick (1.8.1)
websocket (1.2.9)
websocket-driver (0.7.5)
Expand Down Expand Up @@ -472,6 +466,7 @@ DEPENDENCIES
jbuilder (~> 2.5)
jquery-rails
jquery-tablesorter
jsbundling-rails
kramdown
launchy
listen
Expand Down Expand Up @@ -505,7 +500,6 @@ DEPENDENCIES
uglifier (>= 1.3.0)
web-console (>= 3.3.0)
webmock
webpacker

RUBY VERSION
ruby 3.2.2p53
Expand Down
2 changes: 0 additions & 2 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
release: POSTGRES_STATEMENT_TIMEOUT=90s bin/rails heroku:release
web: bin/rails server
webpack: bin/webpack-dev-server
worker: bin/que
2 changes: 2 additions & 0 deletions Procfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
web: unset PORT && bin/rails server
js: yarn build --watch
Empty file added app/assets/builds/.keep
Empty file.
1 change: 1 addition & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css
//= link_tree ../builds
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ $ ->
$('[data-toggle="tooltip"]').tooltip()

$('.tablesorter').tablesorter
textAttribute: 'data-sort-value'
textAttribute: 'data-sort-value'
6 changes: 6 additions & 0 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Application } from 'stimulus';

import CitiesController from './controllers/cities_controller';

window.Stimulus = Application.start();
Stimulus.register('cities', CitiesController);
6 changes: 0 additions & 6 deletions app/javascript/packs/application.js

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/layouts/application.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ html lang='en'
title= content_for?(:meta_title) ? yield(:meta_title) : 'Open311 Status'
meta name="description" content=(content_for?(:meta_description) ? yield(:meta_description) : "Open311 Status monitors and aggregates the status of dozens of Open311 API endpoints, providing benchmarks and comparative insights.")
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag 'sprockets', 'data-turbolinks-track' => true
= javascript_include_tag 'application', 'data-turbolinks-track' => true
= javascript_pack_tag 'application'
= csrf_meta_tags
- if content_for? :canonical_url
link ref="canonical" href=yield(:canonical_url)
Expand Down
82 changes: 0 additions & 82 deletions babel.config.js

This file was deleted.

8 changes: 8 additions & 0 deletions bin/dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env sh

if ! gem list foreman -i --silent; then
echo "Installing foreman..."
gem install foreman
fi

exec foreman start -f Procfile.dev "$@"
6 changes: 0 additions & 6 deletions bin/lint
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,6 @@ FileUtils.chdir APP_ROOT do
puts "\n== Running Rubocop =="
system! "bundle exec rubocop #{options[:nofix] ? '--parallel' : '--autocorrect'}"

puts "\n== Running ES Lint =="
system! "yarn run eslint #{options[:nofix] ? '' : '--fix'} app/javascript"

puts "\n== Slim Lint =="
system! 'bundle exec slim-lint app/views/'

puts "\n== Stylelint =="
system! "yarn run stylelint --ignore-pattern=\"app/assets/stylesheets/vendor/*\" #{options[:nofix] ? '' : '--fix'} app/assets/stylesheets"
end
18 changes: 0 additions & 18 deletions bin/webpack

This file was deleted.

18 changes: 0 additions & 18 deletions bin/webpack-dev-server

This file was deleted.

5 changes: 0 additions & 5 deletions config/webpack/development.js

This file was deleted.

3 changes: 0 additions & 3 deletions config/webpack/environment.js

This file was deleted.

5 changes: 0 additions & 5 deletions config/webpack/production.js

This file was deleted.

5 changes: 0 additions & 5 deletions config/webpack/test.js

This file was deleted.

Loading

0 comments on commit 0d3edb5

Please sign in to comment.