Skip to content

Commit

Permalink
Update Ruby gems and Yarn packages.
Browse files Browse the repository at this point in the history
  • Loading branch information
evazion committed Feb 19, 2021
1 parent 981d56c commit bcca0ca
Show file tree
Hide file tree
Showing 2 changed files with 191 additions and 196 deletions.
110 changes: 55 additions & 55 deletions Gemfile.lock
Expand Up @@ -33,64 +33,64 @@ GIT
GEM
remote: https://rubygems.org/
specs:
actioncable (6.1.2.1)
actionpack (= 6.1.2.1)
activesupport (= 6.1.2.1)
actioncable (6.1.3)
actionpack (= 6.1.3)
activesupport (= 6.1.3)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.1.2.1)
actionpack (= 6.1.2.1)
activejob (= 6.1.2.1)
activerecord (= 6.1.2.1)
activestorage (= 6.1.2.1)
activesupport (= 6.1.2.1)
actionmailbox (6.1.3)
actionpack (= 6.1.3)
activejob (= 6.1.3)
activerecord (= 6.1.3)
activestorage (= 6.1.3)
activesupport (= 6.1.3)
mail (>= 2.7.1)
actionmailer (6.1.2.1)
actionpack (= 6.1.2.1)
actionview (= 6.1.2.1)
activejob (= 6.1.2.1)
activesupport (= 6.1.2.1)
actionmailer (6.1.3)
actionpack (= 6.1.3)
actionview (= 6.1.3)
activejob (= 6.1.3)
activesupport (= 6.1.3)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.1.2.1)
actionview (= 6.1.2.1)
activesupport (= 6.1.2.1)
actionpack (6.1.3)
actionview (= 6.1.3)
activesupport (= 6.1.3)
rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.1.2.1)
actionpack (= 6.1.2.1)
activerecord (= 6.1.2.1)
activestorage (= 6.1.2.1)
activesupport (= 6.1.2.1)
actiontext (6.1.3)
actionpack (= 6.1.3)
activerecord (= 6.1.3)
activestorage (= 6.1.3)
activesupport (= 6.1.3)
nokogiri (>= 1.8.5)
actionview (6.1.2.1)
activesupport (= 6.1.2.1)
actionview (6.1.3)
activesupport (= 6.1.3)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.1.2.1)
activesupport (= 6.1.2.1)
activejob (6.1.3)
activesupport (= 6.1.3)
globalid (>= 0.3.6)
activemodel (6.1.2.1)
activesupport (= 6.1.2.1)
activemodel (6.1.3)
activesupport (= 6.1.3)
activemodel-serializers-xml (1.0.2)
activemodel (> 5.x)
activesupport (> 5.x)
builder (~> 3.1)
activerecord (6.1.2.1)
activemodel (= 6.1.2.1)
activesupport (= 6.1.2.1)
activestorage (6.1.2.1)
actionpack (= 6.1.2.1)
activejob (= 6.1.2.1)
activerecord (= 6.1.2.1)
activesupport (= 6.1.2.1)
activerecord (6.1.3)
activemodel (= 6.1.3)
activesupport (= 6.1.3)
activestorage (6.1.3)
actionpack (= 6.1.3)
activejob (= 6.1.3)
activerecord (= 6.1.3)
activesupport (= 6.1.3)
marcel (~> 0.3.1)
mimemagic (~> 0.3.2)
activesupport (6.1.2.1)
activesupport (6.1.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
Expand All @@ -103,7 +103,7 @@ GEM
ansi (1.5.0)
ast (2.4.2)
aws-eventstream (1.1.0)
aws-partitions (1.424.0)
aws-partitions (1.427.0)
aws-sdk-core (3.112.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.239.0)
Expand Down Expand Up @@ -282,29 +282,29 @@ GEM
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.1.2.1)
actioncable (= 6.1.2.1)
actionmailbox (= 6.1.2.1)
actionmailer (= 6.1.2.1)
actionpack (= 6.1.2.1)
actiontext (= 6.1.2.1)
actionview (= 6.1.2.1)
activejob (= 6.1.2.1)
activemodel (= 6.1.2.1)
activerecord (= 6.1.2.1)
activestorage (= 6.1.2.1)
activesupport (= 6.1.2.1)
rails (6.1.3)
actioncable (= 6.1.3)
actionmailbox (= 6.1.3)
actionmailer (= 6.1.3)
actionpack (= 6.1.3)
actiontext (= 6.1.3)
actionview (= 6.1.3)
activejob (= 6.1.3)
activemodel (= 6.1.3)
activerecord (= 6.1.3)
activestorage (= 6.1.3)
activesupport (= 6.1.3)
bundler (>= 1.15.0)
railties (= 6.1.2.1)
railties (= 6.1.3)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.1.2.1)
actionpack (= 6.1.2.1)
activesupport (= 6.1.2.1)
railties (6.1.3)
actionpack (= 6.1.3)
activesupport (= 6.1.3)
method_source
rake (>= 0.8.7)
thor (~> 1.0)
Expand All @@ -323,7 +323,7 @@ GEM
actionpack (>= 5.0)
railties (>= 5.0)
rexml (3.2.4)
rubocop (1.9.1)
rubocop (1.10.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
Expand Down

3 comments on commit bcca0ca

@lllusion3469
Copy link
Collaborator

@lllusion3469 lllusion3469 commented on bcca0ca Feb 20, 2021

Choose a reason for hiding this comment

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

I'm not asking for help, just sharing my experience in case someone has the same problem (I would be interested to know, though, whether I'm the only one with this problem)


Today I tried the latest master branch and got this js error (just by going to /static/site_map from this, but some js functionality like deleting a post doesn't work either):
Screenshot_20210220_005554
I.e. for some reason Danbooru is the empty object...

Using git bisect I got this as the first bad commit [disclaimer: I had to add gem 'irb' (not bundled anymore as of ruby 2.6 rubygems/bundler#6929) and comment out gem 'binding_of_caller', gem 'better_errors', as well as its usage in config/environments/development.rb to get it to run in the first place (otherwise I'd get a uninitialized constant RubyVM::DebugInspector (NameError)), maybe because I'm using my distro's ruby; in my "production" env where I don't do that, the same happens, though].

Going one commit back (to 981d56c) fixed it (as it should) and then going back to this commit broke it again (as it also should).
Then out of desparation (i had tried a lot more before this, one time I got the problem to disappear on the latest master somehow just by running random commands, but after cloning the repository anew, it broke again) I edited yarn.lock to revert the last change relating to webpack to

[...]
webpack@^5.11.0:
  version "5.21.2"
  resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.21.2.tgz#647507e50d3637695be28af58a6a8246050394e7"
  integrity sha512-xHflCenx+AM4uWKX71SWHhxml5aMXdy2tu/vdi4lClm7PADKxlyDAFFN1rEFzNV0MAoPpHtBeJnl/+K6F4QBPg==
[...]

then I ran rm -rf public/packs (to be safe), yarn install --frozen-lockfile and then it worked again after restarting rails server, so I'm guessing it's a problem with some version of webpack > 5.21.2.


By cloning https://github.com/webpack/webpack (to the parent directory of the danbooru repo) and adding the following to package.json:

{
  [...]
  "resolutions": {
    "webpack": "file:../webpack"
  },
  [...]
}

Then doing a git bisect in the webpack directory and running rails server like the following for every step and reloading /static/site_map in the browser

rm -rf public/packs
git checkout -- yarn.lock # get yarn to recognize that ../webpack changed
yarn install
bundle exec rails server

I get webpack/webpack@9f3950e as the first bad commit, seems a bit too complex for my taste, though...

@evazion
Copy link
Member Author

@evazion evazion commented on bcca0ca Feb 24, 2021

Choose a reason for hiding this comment

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

It's some issue with the Webpack output.library option not correctly outputting the Danbooru object. Various Javascript responses (app/views/**/*.js.erb) use the global Danbooru object to call Javascript functions inside the Webpack bundle.

output: {
library: "Danbooru",
},

https://webpack.js.org/configuration/output/

@evazion
Copy link
Member Author

Choose a reason for hiding this comment

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

a6435f6 is a workaround. I think webpack/webpack#12742 is the bug we're hitting here.

Please sign in to comment.