Skip to content
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

ditch webpacker in favor of jsbundling/esbuild #2594

Merged
merged 44 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
759f48f
gem install jsbundling-rails && rails javascript:install:esbuild
colinxfleming May 28, 2022
65e0239
add build cmd
colinxfleming May 28, 2022
087c106
get build working - sprockets called out as such. doesn't load jquery…
colinxfleming May 28, 2022
54f1a3d
set up jquery, at least in theory
colinxfleming May 28, 2022
6c37421
put popover in its own esbuild chunk
colinxfleming May 28, 2022
ada0b40
stash work for now - next steps get jquery-ui/fa-icons to load, then …
colinxfleming May 28, 2022
7ba088f
remove full jquery-ui - doesn't import right. see gorails video
colinxfleming May 28, 2022
4584c3e
port tooltips js to es6
colinxfleming May 28, 2022
5d5ac13
port over multistep modal and part of autosave part one
colinxfleming May 28, 2022
1d1ff19
stash some autosave work
colinxfleming May 28, 2022
3a153fe
port over the non-autosave js. looks like it works right
colinxfleming May 29, 2022
d1bd2ba
tidying, fix a break cmd
colinxfleming May 29, 2022
5b1aeb3
turn off tablesort for now
colinxfleming May 29, 2022
5367896
let cssbundling begin
colinxfleming May 29, 2022
b8a5168
rails css:install:bootstrap
colinxfleming May 29, 2022
abf5937
load of cssbuild configurationand setup. next step: get things to sho…
colinxfleming May 29, 2022
5a8e160
remove old css, hooray. comment out popover thing
colinxfleming May 29, 2022
a10ebc7
checks out
colinxfleming May 29, 2022
1463164
tidy things up. next up: removing dupes
colinxfleming May 29, 2022
7ba9934
nuke a bunch of duplicative gems now covered by css/esbuild, let's se…
colinxfleming May 29, 2022
fb1354d
vendor jquery-bootstrap-modal-steps
colinxfleming May 29, 2022
5b3a8ab
re-add sprockets for right now
colinxfleming May 30, 2022
1bf9318
get render_async / budget bar operational again
colinxfleming Jun 2, 2022
b250ca3
remove all this webpack garbage
colinxfleming Jun 2, 2022
af629eb
Merge branch 'main' of github.com:DARIAEngineering/dcaf_case_manageme…
colinxfleming Jun 2, 2022
4000efd
get popovers on the budget bar working again
colinxfleming Jun 2, 2022
8ff1498
remove more webpack gabrbage
colinxfleming Jun 2, 2022
1be44cf
remove even MORE webpack garbage
colinxfleming Jun 2, 2022
4bbe1b2
re-add jqueyr-ujs; bump i18n-tasks config
colinxfleming Jun 4, 2022
df5f41e
idk man
colinxfleming Jun 4, 2022
99fdcc3
whatever I did fixed stupidtable
colinxfleming Jun 4, 2022
f558b81
smell ya later original application.js. let's see what happens
colinxfleming Jun 4, 2022
d1296ba
test failure season. start with bringing favicon back and fixing a to…
colinxfleming Jun 4, 2022
09dfa5b
oh THAT'S how you load fonts
colinxfleming Jun 4, 2022
5f69a48
hacking my way around this problem - js partial not rendering on erro…
colinxfleming Jun 4, 2022
7b3a563
fix events test. for some reason fa-icons were eating the whole p con…
colinxfleming Jun 4, 2022
59c9b0b
fix an autosave bug and make psup also not short circuit the js on fa…
colinxfleming Jun 4, 2022
8e6af2e
use separate containers in docker
colinxfleming Jun 4, 2022
a21435e
no ports
colinxfleming Jun 4, 2022
e24f629
we go again
colinxfleming Jun 4, 2022
f3cdd6e
shut off dockercheck for now
colinxfleming Jun 4, 2022
fbcf3a8
restore csp
colinxfleming Jun 5, 2022
1c6150c
with a great deal of dread, temporarily set CSP as report actions
colinxfleming Jun 5, 2022
405e1b5
revert all the weird csp diffs
colinxfleming Jun 5, 2022
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
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/*
Copy link
Member Author

Choose a reason for hiding this comment

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

result of rails:javascript:install

!/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
Copy link
Member Author

@colinxfleming colinxfleming Jun 2, 2022

Choose a reason for hiding this comment

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

Generated by rails:javascript:install; this is what bin/dev executes in three different processes

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
Copy link
Member Author

Choose a reason for hiding this comment

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

Since these are now handled by cssbuild/jsbuild, they're packed up by those process and we don't need to include them in the manifest any longer. Sprockets still packs them up and delivers them though.

//= link_directory ../stylesheets .css

//= link_tree ../builds
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.

26 changes: 26 additions & 0 deletions app/assets/stylesheets/application.bootstrap.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Major library config
Copy link
Member Author

Choose a reason for hiding this comment

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

This is basically a recreation of application.scss in webpacker, but also resolves the awful split we had between sprockets and npm.

@import '../../javascript/styles/vendor/googleapis_source_sans_pro';
@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';
56 changes: 0 additions & 56 deletions app/assets/stylesheets/application.css.scss

This file was deleted.

Loading