Skip to content

Commit

Permalink
ditch webpacker in favor of jsbundling/esbundling (#2594)
Browse files Browse the repository at this point in the history
* gem install jsbundling-rails && rails javascript:install:esbuild

* add build cmd

* get build working - sprockets called out as such. doesn't load jquery in esbuild yet though

* set up jquery, at least in theory

* put popover in its own esbuild chunk

* stash work for now - next steps get jquery-ui/fa-icons to load, then render_async

* remove full jquery-ui - doesn't import right. see gorails video

* port tooltips js to es6

* port over multistep modal and part of autosave part one

* stash some autosave work

* port over the non-autosave js. looks like it works right

* tidying, fix a break cmd

* turn off tablesort for now

* let cssbundling begin

* rails css:install:bootstrap

* load of cssbuild configurationand setup. next step: get things to show up right again, then completely nuke webpacker

* remove old css, hooray. comment out popover thing

* checks out

* tidy things up. next up: removing dupes

* nuke a bunch of duplicative gems now covered by css/esbuild, let's see what happens

* vendor jquery-bootstrap-modal-steps

* re-add sprockets for right now

* get render_async / budget bar operational again

* remove all this webpack garbage

* get popovers on the budget bar working again

* remove more webpack gabrbage

* remove even MORE webpack garbage

* re-add jqueyr-ujs; bump i18n-tasks config

* idk man

* whatever I did fixed stupidtable

* smell ya later original application.js. let's see what happens

* test failure season. start with bringing favicon back and fixing a tooltipsjs bug

* oh THAT'S how you load fonts

* hacking my way around this problem - js partial not rendering on error code, so simply cheat and always return 200. I know this sucks and I have decided I'm okay with it

* fix events test. for some reason fa-icons were eating the whole p content

* fix an autosave bug and make psup also not short circuit the js on failure

* use separate containers in docker

* no ports

* we go again

* shut off dockercheck for now

* restore csp

* with a great deal of dread, temporarily set CSP as report actions

* revert all the weird csp diffs
  • Loading branch information
colinxfleming authored Jun 6, 2022
1 parent 53b844f commit 37e0d3d
Show file tree
Hide file tree
Showing 67 changed files with 8,454 additions and 7,495 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/test_dev_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ on:
- main

jobs:
dockercheck:
name: Verify docker build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Bring up containers
run: |
docker-compose build
docker-compose run --rm web rails db:create db:migrate db:seed
docker-compose up -d
sleep 30
docker ps -a | (! grep Exited ) # Return a non-zero exit code if any of the containers are stopped
# temporarily shutting off
# dockercheck:
# name: Verify docker build
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Bring up containers
# run: |
# docker-compose build
# docker-compose run --rm web rails db:create db:migrate db:seed
# docker-compose up -d
# sleep 30
# docker ps -a | (! grep Exited ) # Return a non-zero exit code if any of the containers are stopped

build:
name: Run tests
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,6 @@ config/initializers/secret_token.rb
yarn-debug.log*
.yarn-integrity
yarn-error.log

/app/assets/builds/*
!/app/assets/builds/.keep
9 changes: 3 additions & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,10 @@ gem 'net-imap', require: false # for compat reasons, required in builds
gem 'net-smtp', require: false # for compat reasons, required in builds

# Asset pipeline
gem 'webpacker', '~> 5.4'
gem 'sass-rails', '>= 6'
gem 'bootstrap', '~> 4.5', '< 5' # we're on bs4 for now
gem 'sprockets-rails'
gem 'jsbundling-rails'
gem 'cssbundling-rails'
gem 'bootstrap_form', '~> 4.5.0'
gem 'coffee-rails', '~> 5.0.0'
gem 'jquery-rails', '~> 4.5.0'
gem 'jquery-ui-rails'

# Our database is postgres
gem 'pg', '~> 1.2'
Expand Down
53 changes: 7 additions & 46 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ GEM
public_suffix (>= 2.0.2, < 5.0)
afm (0.2.2)
ast (2.4.2)
autoprefixer-rails (10.4.2.0)
execjs (~> 2)
bcrypt (3.1.17)
better_html (1.0.16)
actionview (>= 4.0)
Expand All @@ -93,10 +91,6 @@ GEM
smart_properties
bootsnap (1.11.1)
msgpack (~> 1.2)
bootstrap (4.6.1)
autoprefixer-rails (>= 9.1.0)
popper_js (>= 1.14.3, < 2)
sassc-rails (>= 2.0.0)
bootstrap_form (4.5.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
Expand All @@ -122,16 +116,11 @@ GEM
launchy
childprocess (4.1.0)
coderay (1.1.3)
coffee-rails (5.0.0)
coffee-script (>= 2.2.0)
railties (>= 5.2.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
colorize (0.8.1)
concurrent-ruby (1.1.10)
crass (1.0.6)
cssbundling-rails (1.1.0)
railties (>= 6.0.0)
devise (4.8.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
Expand All @@ -145,7 +134,6 @@ GEM
dotenv (= 2.7.6)
railties (>= 3.2)
erubi (1.10.0)
execjs (2.8.1)
factory_bot (6.2.1)
activesupport (>= 5.0.0)
factory_bot_rails (6.2.0)
Expand Down Expand Up @@ -180,12 +168,8 @@ GEM
rails-i18n
rainbow (>= 2.2.2, < 4.0)
terminal-table (>= 1.5.1)
jquery-rails (4.5.0)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
jsbundling-rails (1.0.2)
railties (>= 6.0.0)
jwt (2.3.0)
kaminari (1.2.2)
activesupport (>= 4.1.0)
Expand Down Expand Up @@ -290,7 +274,6 @@ GEM
ruby-rc4
ttfunk
pg (1.3.5)
popper_js (1.16.0)
prawn (2.4.0)
pdf-core (~> 0.9.0)
ttfunk (~> 1.7)
Expand All @@ -308,8 +291,6 @@ GEM
rack (>= 1.0, < 3)
rack-protection (2.2.0)
rack
rack-proxy (0.7.2)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (7.0.2.4)
Expand Down Expand Up @@ -377,23 +358,12 @@ GEM
ruby_audit (2.1.0)
bundler-audit (~> 0.9.0)
rubyzip (2.3.2)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
sdoc (2.4.0)
rdoc (>= 5.0)
selenium-webdriver (4.1.0)
childprocess (>= 0.5, < 5.0)
rexml (~> 3.2, >= 3.2.5)
rubyzip (>= 1.2.2)
semantic_range (3.0.0)
sentry-rails (5.3.0)
railties (>= 5.0)
sentry-ruby-core (~> 5.3.0)
Expand Down Expand Up @@ -435,7 +405,6 @@ GEM
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
thor (1.2.1)
tilt (2.0.10)
timecop (0.9.5)
timeout (0.2.0)
ttfunk (1.7.0)
Expand All @@ -451,11 +420,6 @@ GEM
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (~> 4.0)
webpacker (5.4.3)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.5)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
Expand All @@ -471,23 +435,21 @@ DEPENDENCIES
activerecord-session_store
acts_as_tenant (~> 0.5.0)
bootsnap (>= 1.4.2)
bootstrap (~> 4.5, < 5)
bootstrap_form (~> 4.5.0)
bullet
bundler-audit
byebug
capybara
capybara-screenshot
coffee-rails (~> 5.0.0)
cssbundling-rails
devise (~> 4.8)
dotenv-rails
factory_bot_rails
faker
figaro
geokit
i18n-tasks (~> 1.0.0)
jquery-rails (~> 4.5.0)
jquery-ui-rails
jsbundling-rails
kaminari (~> 1.2)
launchy
listen (>= 3.0.5)
Expand Down Expand Up @@ -519,21 +481,20 @@ DEPENDENCIES
rubocop
rubocop-rails
ruby_audit
sass-rails (>= 6)
sdoc (~> 2.4.0)
selenium-webdriver
sentry-rails
sentry-ruby
shog
shoulda-context
simplecov
sprockets-rails
sqreen
state_geo_tools
strong_password (~> 0.0.10)
timecop
tzinfo-data
webdrivers
webpacker (~> 5.4)

RUBY VERSION
ruby 3.1.2p20
Expand Down
3 changes: 3 additions & 0 deletions Procfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
web: bin/rails server -p 3000
js: yarn build --watch
css: yarn build:css --watch
Empty file added app/assets/builds/.keep
Empty file.
3 changes: 1 addition & 2 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//= link_tree ../images
//= link_directory ../javascripts .js
//= link_directory ../stylesheets .css

//= link_tree ../builds
20 changes: 0 additions & 20 deletions app/assets/javascripts/application.js

This file was deleted.

9 changes: 0 additions & 9 deletions app/assets/javascripts/external_pledges.coffee

This file was deleted.

55 changes: 0 additions & 55 deletions app/assets/javascripts/patients.coffee

This file was deleted.

23 changes: 0 additions & 23 deletions app/assets/javascripts/tooltips.coffee

This file was deleted.

25 changes: 25 additions & 0 deletions app/assets/stylesheets/application.bootstrap.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Major library config
@import '../../javascript/styles/bootstrap';
@import '../../javascript/styles/vendor/jquery-ui';

// Custom styling
@import '../../javascript/styles/globals';
@import '../../javascript/styles/call_list';
@import '../../javascript/styles/devise';
@import '../../javascript/styles/users';
@import '../../javascript/styles/budget_bar';
@import '../../javascript/styles/clinic_finder';
@import '../../javascript/styles/calls';
@import '../../javascript/styles/pagination';
@import '../../javascript/styles/events';
@import '../../javascript/styles/patient_menu';
@import '../../javascript/styles/patient_edit';
@import '../../javascript/styles/tables';
@import '../../javascript/styles/footer';
@import '../../javascript/styles/modals';
@import '../../javascript/styles/navbar';
@import '../../javascript/styles/tooltips';
@import '../../javascript/styles/lines';
@import '../../javascript/styles/flash';
@import '../../javascript/styles/forms';
@import '../../javascript/styles/buttons';
Loading

0 comments on commit 37e0d3d

Please sign in to comment.