Skip to content

Commit

Permalink
Bump webpacker from 3.5.5 to 4.0.2 (mastodon#10277)
Browse files Browse the repository at this point in the history
Bumps [webpacker](https://github.com/rails/webpacker) from 3.5.5 to 4.0.2.
- [Release notes](https://github.com/rails/webpacker/releases)
- [Changelog](https://github.com/rails/webpacker/blob/master/CHANGELOG.md)
- [Commits](rails/webpacker@v3.5.5...v4.0.2)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Yamagishi Kazutoshi <[email protected]>
  • Loading branch information
ykzts authored and Gargron committed Mar 15, 2019
1 parent 5a9978f commit 8347479
Show file tree
Hide file tree
Showing 46 changed files with 1,694 additions and 1,690 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ gem 'tty-command', '~> 0.8', require: false
gem 'tty-prompt', '~> 0.18', require: false
gem 'twitter-text', '~> 1.14'
gem 'tzinfo-data', '~> 1.2018'
gem 'webpacker', '~> 3.5'
gem 'webpacker', '~> 4.0'
gem 'webpush'

gem 'json-ld', '~> 3.0'
Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ GEM
rack-cors (1.0.2)
rack-protection (2.0.5)
rack
rack-proxy (0.6.4)
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
Expand Down Expand Up @@ -640,7 +640,7 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
webpacker (3.5.5)
webpacker (4.0.2)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
Expand Down Expand Up @@ -772,7 +772,7 @@ DEPENDENCIES
twitter-text (~> 1.14)
tzinfo-data (~> 1.2018)
webmock (~> 3.5)
webpacker (~> 3.5)
webpacker (~> 4.0)
webpush

RUBY VERSION
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/rest/instance_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def version
end

def thumbnail
instance_presenter.thumbnail ? full_asset_url(instance_presenter.thumbnail.file.url) : full_pack_url('preview.jpg')
instance_presenter.thumbnail ? full_asset_url(instance_presenter.thumbnail.file.url) : full_pack_url('media/images/preview.jpg')
end

def stats
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/rss/account_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def render(account, statuses)
builder.title("#{display_name(account)} (@#{account.local_username_and_domain})")
.description(account_description(account))
.link(TagManager.instance.url_for(account))
.logo(full_asset_url(asset_pack_path('logo.svg')))
.logo(full_pack_url('media/images/logo.svg'))
.accent_color('2b90d9')

builder.image(full_asset_url(account.avatar.url(:original))) if account.avatar?
Expand Down
2 changes: 1 addition & 1 deletion app/serializers/rss/tag_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def render(tag, statuses)
builder.title("##{tag.name}")
.description(strip_tags(I18n.t('about.about_hashtag_html', hashtag: tag.name)))
.link(tag_url(tag))
.logo(full_asset_url(asset_pack_path('logo.svg')))
.logo(full_pack_url('media/images/logo.svg'))
.accent_color('2b90d9')

statuses.each do |status|
Expand Down
4 changes: 2 additions & 2 deletions app/views/about/more.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
.column-0
.public-account-header.public-account-header--no-bar
.public-account-header__image
= image_tag @instance_presenter.hero&.file&.url || @instance_presenter.thumbnail&.file&.url || asset_pack_path('preview.jpg'), alt: @instance_presenter.site_title, class: 'parallax'
= image_tag @instance_presenter.hero&.file&.url || @instance_presenter.thumbnail&.file&.url || asset_pack_path('media/images/preview.jpg'), alt: @instance_presenter.site_title, class: 'parallax'

.column-1
.landing-page__call-to-action{ dir: 'ltr' }
Expand All @@ -25,7 +25,7 @@
%span= t 'about.status_count_after', count: @instance_presenter.status_count
.row__mascot
.landing-page__mascot
= image_tag @instance_presenter.mascot&.file&.url || asset_pack_path('elephant_ui_plane.svg'), alt: ''
= image_tag @instance_presenter.mascot&.file&.url || asset_pack_path('media/images/elephant_ui_plane.svg'), alt: ''

.column-2
.landing-page__information.contact-widget
Expand Down
4 changes: 2 additions & 2 deletions app/views/about/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
.landing
.landing__brand
= link_to root_url, class: 'brand' do
= image_tag asset_pack_path('logo_full.svg'), alt: 'Mastodon'
= image_pack_tag 'logo_full.svg', alt: 'Mastodon'
%span.brand__tagline=t 'about.tagline'

.landing__grid
Expand Down Expand Up @@ -48,7 +48,7 @@

.hero-widget
.hero-widget__img
= image_tag @instance_presenter.hero&.file&.url || @instance_presenter.thumbnail&.file&.url || asset_pack_path('preview.jpg'), alt: @instance_presenter.site_title
= image_tag @instance_presenter.hero&.file&.url || @instance_presenter.thumbnail&.file&.url || asset_pack_path('media/images/preview.jpg'), alt: @instance_presenter.site_title

- if @instance_presenter.site_short_description.present?
.hero-widget__text
Expand Down
2 changes: 1 addition & 1 deletion app/views/application/_sidebar.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.hero-widget
.hero-widget__img
= image_tag @instance_presenter.hero&.file&.url || @instance_presenter.thumbnail&.file&.url || asset_pack_path('preview.jpg'), alt: @instance_presenter.site_title
= image_tag @instance_presenter.hero&.file&.url || @instance_presenter.thumbnail&.file&.url || asset_pack_path('media/images/preview.jpg'), alt: @instance_presenter.site_title

.hero-widget__text
%p= @instance_presenter.site_short_description.html_safe.presence || @instance_presenter.site_description.html_safe.presence || t('about.generic_description', domain: site_hostname)
2 changes: 1 addition & 1 deletion app/views/home/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

.app-holder#mastodon{ data: { props: Oj.dump(default_props) } }
%noscript
= image_tag asset_pack_path('logo.svg'), alt: 'Mastodon'
= image_pack_tag 'logo.svg', alt: 'Mastodon'

%div
= t('errors.noscript_html', apps_path: 'https://joinmastodon.org/apps')
2 changes: 1 addition & 1 deletion app/views/layouts/admin.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.sidebar-wrapper
.sidebar
= link_to root_path do
= image_tag asset_pack_path('logo.svg'), class: 'logo', alt: 'Mastodon'
= image_pack_tag 'logo.svg', class: 'logo', alt: 'Mastodon'

= render_navigation
.content-wrapper
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/auth.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
.logo-container
%h1
= link_to root_path do
= image_tag asset_pack_path('logo_full.svg'), alt: 'Mastodon'
= image_pack_tag 'logo_full.svg', alt: 'Mastodon'

.form-container
= render 'flashes'
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/mailer.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
%tr
%td.column-cell
= link_to root_url do
= image_tag full_pack_url('logo_full.png'), alt: 'Mastodon', height: 34, class: 'logo'
= image_tag full_pack_url('media/images/mailer/logo_full.png'), alt: 'Mastodon', height: 34, class: 'logo'

= yield

Expand All @@ -49,4 +49,4 @@
%p= link_to t('application_mailer.notification_preferences'), settings_notifications_url
%td.column-cell.text-right
= link_to root_url do
= image_tag full_pack_url('logo_transparent.png'), alt: 'Mastodon', height: 24
= image_tag full_pack_url('media/images/mailer/logo_transparent.png'), alt: 'Mastodon', height: 24
2 changes: 1 addition & 1 deletion app/views/layouts/public.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
%nav.header
.nav-left
= link_to root_url, class: 'brand' do
= image_tag asset_pack_path('logo_full.svg'), alt: 'Mastodon'
= image_pack_tag 'logo_full.svg', alt: 'Mastodon'

= link_to t('directories.directory'), explore_path, class: 'nav-link optional' if Setting.profile_directory
= link_to t('about.about_this'), about_more_path, class: 'nav-link optional'
Expand Down
2 changes: 1 addition & 1 deletion app/views/notification_mailer/favourite.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_grade.png'), alt:''
= image_tag full_pack_url('media/images/mailer/icon_grade.png'), alt:''

%h1= t 'notification_mailer.favourite.title'
%p.lead= t('notification_mailer.favourite.body', name: @account.acct)
Expand Down
2 changes: 1 addition & 1 deletion app/views/notification_mailer/follow.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_person_add.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_person_add.png'), alt: ''

%h1= t 'notification_mailer.follow.title'
%p.lead= t('notification_mailer.follow.body', name: @account.acct)
Expand Down
2 changes: 1 addition & 1 deletion app/views/notification_mailer/follow_request.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_person_add.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_person_add.png'), alt: ''

%h1= t 'notification_mailer.follow_request.title'
%p.lead= t('notification_mailer.follow_request.body', name: @account.acct)
Expand Down
2 changes: 1 addition & 1 deletion app/views/notification_mailer/mention.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_reply.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_reply.png'), alt: ''

%h1= t 'notification_mailer.mention.title'
%p.lead= t('notification_mailer.mention.body', name: @status.account.acct)
Expand Down
2 changes: 1 addition & 1 deletion app/views/notification_mailer/reblog.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_cached.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_cached.png'), alt: ''

%h1= t 'notification_mailer.reblog.title'
%p.lead= t('notification_mailer.reblog.body', name: @account.acct)
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/_og.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
= opengraph 'og:type', 'website'
= opengraph 'og:title', @instance_presenter.site_title
= opengraph 'og:description', description
= opengraph 'og:image', full_asset_url(thumbnail&.file&.url || asset_pack_path('preview.jpg', protocol: :request))
= opengraph 'og:image', full_asset_url(thumbnail&.file&.url || asset_pack_path('media/images/preview.jpg', protocol: :request))
= opengraph 'og:image:width', thumbnail ? thumbnail.meta['width'] : '1200'
= opengraph 'og:image:height', thumbnail ? thumbnail.meta['height'] : '630'
= opengraph 'twitter:card', 'summary_large_image'
2 changes: 1 addition & 1 deletion app/views/user_mailer/backup_ready.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_file_download.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_file_download.png'), alt: ''

%h1= t 'user_mailer.backup_ready.title'

Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/confirmation_instructions.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_email.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_email.png'), alt: ''

%h1= t 'devise.mailer.confirmation_instructions.title'

Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/email_changed.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_email.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_email.png'), alt: ''

%h1= t 'devise.mailer.email_changed.title'
%p.lead= t 'devise.mailer.email_changed.explanation'
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/password_change.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_lock_open.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_lock_open.png'), alt: ''

%h1= t 'devise.mailer.password_change.title'
%p.lead= t 'devise.mailer.password_change.explanation'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_email.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_email.png'), alt: ''

%h1= t 'devise.mailer.reconfirmation_instructions.title'
%p.lead= t 'devise.mailer.reconfirmation_instructions.explanation'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_lock_open.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_lock_open.png'), alt: ''

%h1= t 'devise.mailer.reset_password_instructions.title'
%p.lead= t 'devise.mailer.reset_password_instructions.explanation'
Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/warning.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_warning.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_warning.png'), alt: ''

%h1= t "user_mailer.warning.title.#{@warning.action}"

Expand Down
2 changes: 1 addition & 1 deletion app/views/user_mailer/welcome.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
%tbody
%tr
%td
= image_tag full_pack_url('icon_done.png'), alt: ''
= image_tag full_pack_url('media/images/mailer/icon_done.png'), alt: ''

%h1= t 'user_mailer.welcome.title', name: @resource.account.username
%p.lead= t 'user_mailer.welcome.explanation'
Expand Down
6 changes: 5 additions & 1 deletion bin/webpack
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ require "bundler/setup"

require "webpacker"
require "webpacker/webpack_runner"
Webpacker::WebpackRunner.run(ARGV)

APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::WebpackRunner.run(ARGV)
end
6 changes: 5 additions & 1 deletion bin/webpack-dev-server
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ require "bundler/setup"

require "webpacker"
require "webpacker/dev_server_runner"
Webpacker::DevServerRunner.run(ARGV)

APP_ROOT = File.expand_path("..", __dir__)
Dir.chdir(APP_ROOT) do
Webpacker::DevServerRunner.run(ARGV)
end
4 changes: 1 addition & 3 deletions config/webpack/configuration.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Common configuration for webpacker loaded from config/webpacker.yml

const { join, resolve } = require('path');
const { resolve } = require('path');
const { env } = require('process');
const { safeLoad } = require('js-yaml');
const { readFileSync } = require('fs');

const configPath = resolve('config', 'webpacker.yml');
const loadersDir = join(__dirname, 'loaders');
const settings = safeLoad(readFileSync(configPath), 'utf8')[env.RAILS_ENV || env.NODE_ENV];

const themePath = resolve('config', 'themes.yml');
Expand Down Expand Up @@ -37,6 +36,5 @@ module.exports = {
CDN_HOST: env.CDN_HOST,
NODE_ENV: env.NODE_ENV,
},
loadersDir,
output,
};
40 changes: 28 additions & 12 deletions config/webpack/development.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// Note: You must restart bin/webpack-dev-server for changes to take effect

const merge = require('webpack-merge');
const sharedConfig = require('./shared.js');
const { settings, output } = require('./configuration.js');
const sharedConfig = require('./shared');
const { settings, output } = require('./configuration');

const watchOptions = {
ignored: /node_modules/,
};
const watchOptions = {};

if (process.env.VAGRANT) {
// If we are in Vagrant, we can't rely on inotify to update us with changed
Expand All @@ -17,7 +15,7 @@ if (process.env.VAGRANT) {

module.exports = merge(sharedConfig, {
mode: 'development',

cache: true,
devtool: 'cheap-module-eval-source-map',

stats: {
Expand All @@ -30,15 +28,33 @@ module.exports = merge(sharedConfig, {

devServer: {
clientLogLevel: 'none',
https: settings.dev_server.https,
compress: settings.dev_server.compress,
quiet: settings.dev_server.quiet,
disableHostCheck: settings.dev_server.disable_host_check,
host: settings.dev_server.host,
port: settings.dev_server.port,
https: settings.dev_server.https,
hot: settings.dev_server.hmr,
contentBase: output.path,
inline: settings.dev_server.inline,
useLocalIp: settings.dev_server.use_local_ip,
public: settings.dev_server.public,
publicPath: output.publicPath,
compress: true,
headers: { 'Access-Control-Allow-Origin': '*' },
historyApiFallback: true,
disableHostCheck: true,
watchOptions: watchOptions,
historyApiFallback: {
disableDotRule: true,
},
headers: settings.dev_server.headers,
overlay: settings.dev_server.overlay,
stats: {
entrypoints: false,
errorDetails: false,
modules: false,
moduleTrace: false,
},
watchOptions: Object.assign(
{},
settings.dev_server.watch_options,
watchOptions
),
},
});
Loading

0 comments on commit 8347479

Please sign in to comment.