Browse Source

Upgrade Babel to version 7.0.0 (#5925)

pull/4/head
Yamagishi Kazutoshi 3 years ago
committed by Eugen Rochko
parent
commit
0ddbccf7e6
78 changed files with 2387 additions and 2322 deletions
  1. +0
    -66
      .babelrc
  2. +1
    -1
      Gemfile
  3. +2
    -2
      Gemfile.lock
  4. +0
    -6
      app/javascript/mastodon/components/__tests__/__snapshots__/button-test.js.snap
  5. +2
    -2
      app/javascript/mastodon/components/account.js
  6. +2
    -2
      app/javascript/mastodon/components/column_header.js
  7. +2
    -2
      app/javascript/mastodon/components/domain.js
  8. +2
    -2
      app/javascript/mastodon/components/load_gap.js
  9. +2
    -2
      app/javascript/mastodon/components/media_gallery.js
  10. +2
    -2
      app/javascript/mastodon/components/relative_timestamp.js
  11. +2
    -2
      app/javascript/mastodon/components/status.js
  12. +2
    -2
      app/javascript/mastodon/components/status_action_bar.js
  13. +2
    -2
      app/javascript/mastodon/features/account/components/action_bar.js
  14. +2
    -2
      app/javascript/mastodon/features/account/components/header.js
  15. +2
    -2
      app/javascript/mastodon/features/account_gallery/index.js
  16. +2
    -2
      app/javascript/mastodon/features/account_timeline/index.js
  17. +2
    -2
      app/javascript/mastodon/features/blocks/index.js
  18. +2
    -2
      app/javascript/mastodon/features/community_timeline/components/column_settings.js
  19. +2
    -2
      app/javascript/mastodon/features/community_timeline/index.js
  20. +2
    -2
      app/javascript/mastodon/features/compose/components/action_bar.js
  21. +2
    -2
      app/javascript/mastodon/features/compose/components/compose_form.js
  22. +2
    -2
      app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js
  23. +2
    -2
      app/javascript/mastodon/features/compose/components/privacy_dropdown.js
  24. +2
    -2
      app/javascript/mastodon/features/compose/components/reply_indicator.js
  25. +2
    -2
      app/javascript/mastodon/features/compose/components/search.js
  26. +2
    -2
      app/javascript/mastodon/features/compose/components/upload.js
  27. +2
    -2
      app/javascript/mastodon/features/compose/components/upload_button.js
  28. +2
    -2
      app/javascript/mastodon/features/compose/index.js
  29. +2
    -2
      app/javascript/mastodon/features/direct_timeline/components/column_settings.js
  30. +2
    -2
      app/javascript/mastodon/features/direct_timeline/index.js
  31. +2
    -2
      app/javascript/mastodon/features/domain_blocks/index.js
  32. +2
    -2
      app/javascript/mastodon/features/favourited_statuses/index.js
  33. +2
    -2
      app/javascript/mastodon/features/favourites/index.js
  34. +2
    -2
      app/javascript/mastodon/features/follow_requests/components/account_authorize.js
  35. +2
    -2
      app/javascript/mastodon/features/follow_requests/index.js
  36. +2
    -2
      app/javascript/mastodon/features/followers/index.js
  37. +2
    -2
      app/javascript/mastodon/features/following/index.js
  38. +2
    -2
      app/javascript/mastodon/features/getting_started/index.js
  39. +2
    -2
      app/javascript/mastodon/features/hashtag_timeline/index.js
  40. +2
    -2
      app/javascript/mastodon/features/home_timeline/components/column_settings.js
  41. +2
    -2
      app/javascript/mastodon/features/home_timeline/index.js
  42. +2
    -2
      app/javascript/mastodon/features/keyboard_shortcuts/index.js
  43. +2
    -2
      app/javascript/mastodon/features/list_editor/components/account.js
  44. +2
    -2
      app/javascript/mastodon/features/list_editor/components/search.js
  45. +2
    -2
      app/javascript/mastodon/features/list_editor/index.js
  46. +2
    -2
      app/javascript/mastodon/features/list_timeline/index.js
  47. +2
    -2
      app/javascript/mastodon/features/lists/components/new_list_form.js
  48. +2
    -2
      app/javascript/mastodon/features/lists/index.js
  49. +2
    -2
      app/javascript/mastodon/features/mutes/index.js
  50. +2
    -2
      app/javascript/mastodon/features/notifications/components/notification.js
  51. +2
    -2
      app/javascript/mastodon/features/notifications/index.js
  52. +2
    -2
      app/javascript/mastodon/features/pinned_statuses/index.js
  53. +2
    -2
      app/javascript/mastodon/features/public_timeline/index.js
  54. +2
    -2
      app/javascript/mastodon/features/reblogs/index.js
  55. +2
    -2
      app/javascript/mastodon/features/standalone/community_timeline/index.js
  56. +2
    -2
      app/javascript/mastodon/features/standalone/hashtag_timeline/index.js
  57. +2
    -2
      app/javascript/mastodon/features/standalone/public_timeline/index.js
  58. +2
    -2
      app/javascript/mastodon/features/status/components/action_bar.js
  59. +2
    -2
      app/javascript/mastodon/features/status/index.js
  60. +2
    -2
      app/javascript/mastodon/features/ui/components/boost_modal.js
  61. +2
    -2
      app/javascript/mastodon/features/ui/components/columns_area.js
  62. +2
    -2
      app/javascript/mastodon/features/ui/components/confirmation_modal.js
  63. +2
    -2
      app/javascript/mastodon/features/ui/components/embed_modal.js
  64. +2
    -2
      app/javascript/mastodon/features/ui/components/focal_point_modal.js
  65. +2
    -2
      app/javascript/mastodon/features/ui/components/media_modal.js
  66. +2
    -2
      app/javascript/mastodon/features/ui/components/mute_modal.js
  67. +2
    -2
      app/javascript/mastodon/features/ui/components/onboarding_modal.js
  68. +2
    -2
      app/javascript/mastodon/features/ui/components/report_modal.js
  69. +2
    -2
      app/javascript/mastodon/features/ui/components/tabs_bar.js
  70. +2
    -2
      app/javascript/mastodon/features/ui/index.js
  71. +2
    -2
      app/javascript/mastodon/features/video/index.js
  72. +65
    -0
      babel.config.js
  73. +1
    -1
      bin/webpack
  74. +1
    -1
      bin/webpack-dev-server
  75. +0
    -1
      config/webpack/loaders/babel.js
  76. +0
    -1
      config/webpack/production.js
  77. +44
    -36
      package.json
  78. +2139
    -2073
      yarn.lock

+ 0
- 66
.babelrc View File

@ -1,66 +0,0 @@
{
"presets": [
"react",
[
"env",
{
"exclude": ["transform-async-to-generator", "transform-regenerator"],
"loose": true,
"modules": false,
"targets": {
"browsers": ["last 2 versions", "IE >= 11", "iOS >= 9"]
}
}
]
],
"plugins": [
"syntax-dynamic-import",
["transform-object-rest-spread", { "useBuiltIns": true }],
"transform-decorators-legacy",
"transform-class-properties",
[
"react-intl",
{
"messagesDir": "./build/messages"
}
],
"preval"
],
"env": {
"development": {
"plugins": [
"transform-react-jsx-source",
"transform-react-jsx-self"
]
},
"production": {
"plugins": [
"lodash",
[
"transform-react-remove-prop-types",
{
"mode": "remove",
"removeImport": true,
"additionalLibraries": [
"react-immutable-proptypes"
]
}
],
"transform-react-inline-elements",
[
"transform-runtime",
{
"helpers": true,
"polyfill": false,
"regenerator": false
}
]
]
},
"test": {
"plugins": [
"transform-es2015-modules-commonjs"
]
}
}
}

+ 1
- 1
Gemfile View File

@ -87,7 +87,7 @@ gem 'tty-command', '~> 0.8', require: false
gem 'tty-prompt', '~> 0.16', require: false
gem 'twitter-text', '~> 1.14'
gem 'tzinfo-data', '~> 1.2018'
gem 'webpacker', '~> 3.4'
gem 'webpacker', '~> 3.5'
gem 'webpush'
gem 'json-ld', '~> 2.2'

+ 2
- 2
Gemfile.lock View File

@ -627,7 +627,7 @@ GEM
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff
webpacker (3.4.3)
webpacker (3.5.5)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
@ -758,7 +758,7 @@ DEPENDENCIES
twitter-text (~> 1.14)
tzinfo-data (~> 1.2018)
webmock (~> 3.3)
webpacker (~> 3.4)
webpacker (~> 3.5)
webpush
RUBY VERSION

+ 0
- 6
app/javascript/mastodon/components/__tests__/__snapshots__/button-test.js.snap View File

@ -3,7 +3,6 @@
exports[`<Button /> adds class "button-secondary" if props.secondary given 1`] = `
<button
className="button button-secondary"
disabled={undefined}
onClick={[Function]}
style={
Object {
@ -18,7 +17,6 @@ exports[`
exports[`<Button /> renders a button element 1`] = `
<button
className="button"
disabled={undefined}
onClick={[Function]}
style={
Object {
@ -48,7 +46,6 @@ exports[`
exports[`<Button /> renders class="button--block" if props.block given 1`] = `
<button
className="button button--block"
disabled={undefined}
onClick={[Function]}
style={
Object {
@ -63,7 +60,6 @@ exports[`
exports[`<Button /> renders the children 1`] = `
<button
className="button"
disabled={undefined}
onClick={[Function]}
style={
Object {
@ -82,7 +78,6 @@ exports[`
exports[`<Button /> renders the given text 1`] = `
<button
className="button"
disabled={undefined}
onClick={[Function]}
style={
Object {
@ -99,7 +94,6 @@ exports[`
exports[`<Button /> renders the props.text instead of children 1`] = `
<button
className="button"
disabled={undefined}
onClick={[Function]}
style={
Object {

+ 2
- 2
app/javascript/mastodon/components/account.js View File

@ -19,8 +19,8 @@ const messages = defineMessages({
unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' },
});
@injectIntl
export default class Account extends ImmutablePureComponent {
export default @injectIntl
class Account extends ImmutablePureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,

+ 2
- 2
app/javascript/mastodon/components/column_header.js View File

@ -10,8 +10,8 @@ const messages = defineMessages({
moveRight: { id: 'column_header.moveRight_settings', defaultMessage: 'Move column to the right' },
});
@injectIntl
export default class ColumnHeader extends React.PureComponent {
export default @injectIntl
class ColumnHeader extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/components/domain.js View File

@ -8,8 +8,8 @@ const messages = defineMessages({
unblockDomain: { id: 'account.unblock_domain', defaultMessage: 'Unhide {domain}' },
});
@injectIntl
export default class Account extends ImmutablePureComponent {
export default @injectIntl
class Account extends ImmutablePureComponent {
static propTypes = {
domain: PropTypes.string,

+ 2
- 2
app/javascript/mastodon/components/load_gap.js View File

@ -6,8 +6,8 @@ const messages = defineMessages({
load_more: { id: 'status.load_more', defaultMessage: 'Load more' },
});
@injectIntl
export default class LoadGap extends React.PureComponent {
export default @injectIntl
class LoadGap extends React.PureComponent {
static propTypes = {
disabled: PropTypes.bool,

+ 2
- 2
app/javascript/mastodon/components/media_gallery.js View File

@ -179,8 +179,8 @@ class Item extends React.PureComponent {
}
@injectIntl
export default class MediaGallery extends React.PureComponent {
export default @injectIntl
class MediaGallery extends React.PureComponent {
static propTypes = {
sensitive: PropTypes.bool,

+ 2
- 2
app/javascript/mastodon/components/relative_timestamp.js View File

@ -86,8 +86,8 @@ export const timeAgoString = (intl, date, now, year) => {
return relativeTime;
};
@injectIntl
export default class RelativeTimestamp extends React.Component {
export default @injectIntl
class RelativeTimestamp extends React.Component {
static propTypes = {
intl: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/components/status.js View File

@ -35,8 +35,8 @@ export const textForScreenReader = (intl, status, rebloggedByText = false) => {
return values.join(', ');
};
@injectIntl
export default class Status extends ImmutablePureComponent {
export default @injectIntl
class Status extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/components/status_action_bar.js View File

@ -42,8 +42,8 @@ const obfuscatedCount = count => {
}
};
@injectIntl
export default class StatusActionBar extends ImmutablePureComponent {
export default @injectIntl
class StatusActionBar extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/features/account/components/action_bar.js View File

@ -36,8 +36,8 @@ const messages = defineMessages({
unendorse: { id: 'account.unendorse', defaultMessage: 'Don\'t feature on profile' },
});
@injectIntl
export default class ActionBar extends React.PureComponent {
export default @injectIntl
class ActionBar extends React.PureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,

+ 2
- 2
app/javascript/mastodon/features/account/components/header.js View File

@ -65,8 +65,8 @@ class Avatar extends ImmutablePureComponent {
}
@injectIntl
export default class Header extends ImmutablePureComponent {
export default @injectIntl
class Header extends ImmutablePureComponent {
static propTypes = {
account: ImmutablePropTypes.map,

+ 2
- 2
app/javascript/mastodon/features/account_gallery/index.js View File

@ -43,8 +43,8 @@ class LoadMoreMedia extends ImmutablePureComponent {
}
@connect(mapStateToProps)
export default class AccountGallery extends ImmutablePureComponent {
export default @connect(mapStateToProps)
class AccountGallery extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/account_timeline/index.js View File

@ -23,8 +23,8 @@ const mapStateToProps = (state, { params: { accountId }, withReplies = false })
};
};
@connect(mapStateToProps)
export default class AccountTimeline extends ImmutablePureComponent {
export default @connect(mapStateToProps)
class AccountTimeline extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/blocks/index.js View File

@ -20,9 +20,9 @@ const mapStateToProps = state => ({
accountIds: state.getIn(['user_lists', 'blocks', 'items']),
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class Blocks extends ImmutablePureComponent {
class Blocks extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/community_timeline/components/column_settings.js View File

@ -4,8 +4,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, FormattedMessage } from 'react-intl';
import SettingToggle from '../../notifications/components/setting_toggle';
@injectIntl
export default class ColumnSettings extends React.PureComponent {
export default @injectIntl
class ColumnSettings extends React.PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,

+ 2
- 2
app/javascript/mastodon/features/community_timeline/index.js View File

@ -25,9 +25,9 @@ const mapStateToProps = (state, { onlyMedia, columnId }) => {
};
};
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class CommunityTimeline extends React.PureComponent {
class CommunityTimeline extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/features/compose/components/action_bar.js View File

@ -17,8 +17,8 @@ const messages = defineMessages({
filters: { id: 'navigation_bar.filters', defaultMessage: 'Muted words' },
});
@injectIntl
export default class ActionBar extends React.PureComponent {
export default @injectIntl
class ActionBar extends React.PureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,

+ 2
- 2
app/javascript/mastodon/features/compose/components/compose_form.js View File

@ -27,8 +27,8 @@ const messages = defineMessages({
publishLoud: { id: 'compose_form.publish_loud', defaultMessage: '{publish}!' },
});
@injectIntl
export default class ComposeForm extends ImmutablePureComponent {
export default @injectIntl
class ComposeForm extends ImmutablePureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/compose/components/emoji_picker_dropdown.js View File

@ -278,8 +278,8 @@ class EmojiPickerMenu extends React.PureComponent {
}
@injectIntl
export default class EmojiPickerDropdown extends React.PureComponent {
export default @injectIntl
class EmojiPickerDropdown extends React.PureComponent {
static propTypes = {
custom_emojis: ImmutablePropTypes.list,

+ 2
- 2
app/javascript/mastodon/features/compose/components/privacy_dropdown.js View File

@ -149,8 +149,8 @@ class PrivacyDropdownMenu extends React.PureComponent {
}
@injectIntl
export default class PrivacyDropdown extends React.PureComponent {
export default @injectIntl
class PrivacyDropdown extends React.PureComponent {
static propTypes = {
isUserTouching: PropTypes.func,

+ 2
- 2
app/javascript/mastodon/features/compose/components/reply_indicator.js View File

@ -12,8 +12,8 @@ const messages = defineMessages({
cancel: { id: 'reply_indicator.cancel', defaultMessage: 'Cancel' },
});
@injectIntl
export default class ReplyIndicator extends ImmutablePureComponent {
export default @injectIntl
class ReplyIndicator extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/features/compose/components/search.js View File

@ -43,8 +43,8 @@ class SearchPopout extends React.PureComponent {
}
@injectIntl
export default class Search extends React.PureComponent {
export default @injectIntl
class Search extends React.PureComponent {
static propTypes = {
value: PropTypes.string.isRequired,

+ 2
- 2
app/javascript/mastodon/features/compose/components/upload.js View File

@ -11,8 +11,8 @@ const messages = defineMessages({
description: { id: 'upload_form.description', defaultMessage: 'Describe for the visually impaired' },
});
@injectIntl
export default class Upload extends ImmutablePureComponent {
export default @injectIntl
class Upload extends ImmutablePureComponent {
static propTypes = {
media: ImmutablePropTypes.map.isRequired,

+ 2
- 2
app/javascript/mastodon/features/compose/components/upload_button.js View File

@ -23,9 +23,9 @@ const iconStyle = {
lineHeight: '27px',
};
@connect(makeMapStateToProps)
export default @connect(makeMapStateToProps)
@injectIntl
export default class UploadButton extends ImmutablePureComponent {
class UploadButton extends ImmutablePureComponent {
static propTypes = {
disabled: PropTypes.bool,

+ 2
- 2
app/javascript/mastodon/features/compose/index.js View File

@ -30,9 +30,9 @@ const mapStateToProps = (state, ownProps) => ({
showSearch: ownProps.multiColumn ? state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']) : ownProps.isSearchPage,
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class Compose extends React.PureComponent {
class Compose extends React.PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

+ 2
- 2
app/javascript/mastodon/features/direct_timeline/components/column_settings.js View File

@ -9,8 +9,8 @@ const messages = defineMessages({
settings: { id: 'home.settings', defaultMessage: 'Column settings' },
});
@injectIntl
export default class ColumnSettings extends React.PureComponent {
export default @injectIntl
class ColumnSettings extends React.PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,

+ 2
- 2
app/javascript/mastodon/features/direct_timeline/index.js View File

@ -17,9 +17,9 @@ const mapStateToProps = state => ({
hasUnread: state.getIn(['timelines', 'direct', 'unread']) > 0,
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class DirectTimeline extends React.PureComponent {
class DirectTimeline extends React.PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

+ 2
- 2
app/javascript/mastodon/features/domain_blocks/index.js View File

@ -21,9 +21,9 @@ const mapStateToProps = state => ({
domains: state.getIn(['domain_lists', 'blocks', 'items']),
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class Blocks extends ImmutablePureComponent {
class Blocks extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/favourited_statuses/index.js View File

@ -21,9 +21,9 @@ const mapStateToProps = state => ({
hasMore: !!state.getIn(['status_lists', 'favourites', 'next']),
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class Favourites extends ImmutablePureComponent {
class Favourites extends ImmutablePureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

+ 2
- 2
app/javascript/mastodon/features/favourites/index.js View File

@ -15,8 +15,8 @@ const mapStateToProps = (state, props) => ({
accountIds: state.getIn(['user_lists', 'favourited_by', props.params.statusId]),
});
@connect(mapStateToProps)
export default class Favourites extends ImmutablePureComponent {
export default @connect(mapStateToProps)
class Favourites extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/follow_requests/components/account_authorize.js View File

@ -13,8 +13,8 @@ const messages = defineMessages({
reject: { id: 'follow_request.reject', defaultMessage: 'Reject' },
});
@injectIntl
export default class AccountAuthorize extends ImmutablePureComponent {
export default @injectIntl
class AccountAuthorize extends ImmutablePureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,

+ 2
- 2
app/javascript/mastodon/features/follow_requests/index.js View File

@ -20,9 +20,9 @@ const mapStateToProps = state => ({
accountIds: state.getIn(['user_lists', 'follow_requests', 'items']),
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class FollowRequests extends ImmutablePureComponent {
class FollowRequests extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/followers/index.js View File

@ -22,8 +22,8 @@ const mapStateToProps = (state, props) => ({
hasMore: !!state.getIn(['user_lists', 'followers', props.params.accountId, 'next']),
});
@connect(mapStateToProps)
export default class Followers extends ImmutablePureComponent {
export default @connect(mapStateToProps)
class Followers extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/following/index.js View File

@ -22,8 +22,8 @@ const mapStateToProps = (state, props) => ({
hasMore: !!state.getIn(['user_lists', 'following', props.params.accountId, 'next']),
});
@connect(mapStateToProps)
export default class Following extends ImmutablePureComponent {
export default @connect(mapStateToProps)
class Following extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/getting_started/index.js View File

@ -53,9 +53,9 @@ const badgeDisplay = (number, limit) => {
}
};
@connect(mapStateToProps, mapDispatchToProps)
export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
export default class GettingStarted extends ImmutablePureComponent {
class GettingStarted extends ImmutablePureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/hashtag_timeline/index.js View File

@ -13,8 +13,8 @@ const mapStateToProps = (state, props) => ({
hasUnread: state.getIn(['timelines', `hashtag:${props.params.id}`, 'unread']) > 0,
});
@connect(mapStateToProps)
export default class HashtagTimeline extends React.PureComponent {
export default @connect(mapStateToProps)
class HashtagTimeline extends React.PureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/home_timeline/components/column_settings.js View File

@ -4,8 +4,8 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import { injectIntl, FormattedMessage } from 'react-intl';
import SettingToggle from '../../notifications/components/setting_toggle';
@injectIntl
export default class ColumnSettings extends React.PureComponent {
export default @injectIntl
class ColumnSettings extends React.PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,

+ 2
- 2
app/javascript/mastodon/features/home_timeline/index.js View File

@ -19,9 +19,9 @@ const mapStateToProps = state => ({
isPartial: state.getIn(['timelines', 'home', 'items', 0], null) === null,
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class HomeTimeline extends React.PureComponent {
class HomeTimeline extends React.PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

+ 2
- 2
app/javascript/mastodon/features/keyboard_shortcuts/index.js View File

@ -9,8 +9,8 @@ const messages = defineMessages({
heading: { id: 'keyboard_shortcuts.heading', defaultMessage: 'Keyboard Shortcuts' },
});
@injectIntl
export default class KeyboardShortcuts extends ImmutablePureComponent {
export default @injectIntl
class KeyboardShortcuts extends ImmutablePureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/list_editor/components/account.js View File

@ -31,9 +31,9 @@ const mapDispatchToProps = (dispatch, { accountId }) => ({
onAdd: () => dispatch(addToListEditor(accountId)),
});
@connect(makeMapStateToProps, mapDispatchToProps)
export default @connect(makeMapStateToProps, mapDispatchToProps)
@injectIntl
export default class Account extends ImmutablePureComponent {
class Account extends ImmutablePureComponent {
static propTypes = {
account: ImmutablePropTypes.map.isRequired,

+ 2
- 2
app/javascript/mastodon/features/list_editor/components/search.js View File

@ -19,9 +19,9 @@ const mapDispatchToProps = dispatch => ({
onChange: value => dispatch(changeListSuggestions(value)),
});
@connect(mapStateToProps, mapDispatchToProps)
export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
export default class Search extends React.PureComponent {
class Search extends React.PureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/list_editor/index.js View File

@ -22,9 +22,9 @@ const mapDispatchToProps = dispatch => ({
onReset: () => dispatch(resetListEditor()),
});
@connect(mapStateToProps, mapDispatchToProps)
export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
export default class ListEditor extends ImmutablePureComponent {
class ListEditor extends ImmutablePureComponent {
static propTypes = {
listId: PropTypes.string.isRequired,

+ 2
- 2
app/javascript/mastodon/features/list_timeline/index.js View File

@ -25,9 +25,9 @@ const mapStateToProps = (state, props) => ({
hasUnread: state.getIn(['timelines', `list:${props.params.id}`, 'unread']) > 0,
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class ListTimeline extends React.PureComponent {
class ListTimeline extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/features/lists/components/new_list_form.js View File

@ -20,9 +20,9 @@ const mapDispatchToProps = dispatch => ({
onSubmit: () => dispatch(submitListEditor(true)),
});
@connect(mapStateToProps, mapDispatchToProps)
export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
export default class NewListForm extends React.PureComponent {
class NewListForm extends React.PureComponent {
static propTypes = {
value: PropTypes.string.isRequired,

+ 2
- 2
app/javascript/mastodon/features/lists/index.js View File

@ -31,9 +31,9 @@ const mapStateToProps = state => ({
lists: getOrderedLists(state),
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class Lists extends ImmutablePureComponent {
class Lists extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/mutes/index.js View File

@ -20,9 +20,9 @@ const mapStateToProps = state => ({
accountIds: state.getIn(['user_lists', 'mutes', 'items']),
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class Mutes extends ImmutablePureComponent {
class Mutes extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/notifications/components/notification.js View File

@ -16,8 +16,8 @@ const notificationForScreenReader = (intl, message, timestamp) => {
return output.join(', ');
};
@injectIntl
export default class Notification extends ImmutablePureComponent {
export default @injectIntl
class Notification extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/features/notifications/index.js View File

@ -31,9 +31,9 @@ const mapStateToProps = state => ({
hasMore: state.getIn(['notifications', 'hasMore']),
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class Notifications extends React.PureComponent {
class Notifications extends React.PureComponent {
static propTypes = {
columnId: PropTypes.string,

+ 2
- 2
app/javascript/mastodon/features/pinned_statuses/index.js View File

@ -18,9 +18,9 @@ const mapStateToProps = state => ({
hasMore: !!state.getIn(['status_lists', 'pins', 'next']),
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class PinnedStatuses extends ImmutablePureComponent {
class PinnedStatuses extends ImmutablePureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

+ 2
- 2
app/javascript/mastodon/features/public_timeline/index.js View File

@ -25,9 +25,9 @@ const mapStateToProps = (state, { onlyMedia, columnId }) => {
};
};
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class PublicTimeline extends React.PureComponent {
class PublicTimeline extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/features/reblogs/index.js View File

@ -15,8 +15,8 @@ const mapStateToProps = (state, props) => ({
accountIds: state.getIn(['user_lists', 'reblogged_by', props.params.statusId]),
});
@connect(mapStateToProps)
export default class Reblogs extends ImmutablePureComponent {
export default @connect(mapStateToProps)
class Reblogs extends ImmutablePureComponent {
static propTypes = {
params: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/standalone/community_timeline/index.js View File

@ -12,9 +12,9 @@ const messages = defineMessages({
title: { id: 'standalone.public_title', defaultMessage: 'A look inside...' },
});
@connect()
export default @connect()
@injectIntl
export default class CommunityTimeline extends React.PureComponent {
class CommunityTimeline extends React.PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

+ 2
- 2
app/javascript/mastodon/features/standalone/hashtag_timeline/index.js View File

@ -7,8 +7,8 @@ import Column from '../../../components/column';
import ColumnHeader from '../../../components/column_header';
import { connectHashtagStream } from '../../../actions/streaming';
@connect()
export default class HashtagTimeline extends React.PureComponent {
export default @connect()
class HashtagTimeline extends React.PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

+ 2
- 2
app/javascript/mastodon/features/standalone/public_timeline/index.js View File

@ -12,9 +12,9 @@ const messages = defineMessages({
title: { id: 'standalone.public_title', defaultMessage: 'A look inside...' },
});
@connect()
export default @connect()
@injectIntl
export default class PublicTimeline extends React.PureComponent {
class PublicTimeline extends React.PureComponent {
static propTypes = {
dispatch: PropTypes.func.isRequired,

+ 2
- 2
app/javascript/mastodon/features/status/components/action_bar.js View File

@ -28,8 +28,8 @@ const messages = defineMessages({
embed: { id: 'status.embed', defaultMessage: 'Embed' },
});
@injectIntl
export default class ActionBar extends React.PureComponent {
export default @injectIntl
class ActionBar extends React.PureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/features/status/index.js View File

@ -104,9 +104,9 @@ const makeMapStateToProps = () => {
return mapStateToProps;
};
@injectIntl
export default @injectIntl
@connect(makeMapStateToProps)
export default class Status extends ImmutablePureComponent {
class Status extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/features/ui/components/boost_modal.js View File

@ -13,8 +13,8 @@ const messages = defineMessages({
reblog: { id: 'status.reblog', defaultMessage: 'Boost' },
});
@injectIntl
export default class BoostModal extends ImmutablePureComponent {
export default @injectIntl
class BoostModal extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object,

+ 2
- 2
app/javascript/mastodon/features/ui/components/columns_area.js View File

@ -35,8 +35,8 @@ const messages = defineMessages({
const shouldHideFAB = path => path.match(/^\/statuses\//);
@component => injectIntl(component, { withRef: true })
export default class ColumnsArea extends ImmutablePureComponent {
export default @(component => injectIntl(component, { withRef: true }))
class ColumnsArea extends ImmutablePureComponent {
static contextTypes = {
router: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/ui/components/confirmation_modal.js View File

@ -3,8 +3,8 @@ import PropTypes from 'prop-types';
import { injectIntl, FormattedMessage } from 'react-intl';
import Button from '../../../components/button';
@injectIntl
export default class ConfirmationModal extends React.PureComponent {
export default @injectIntl
class ConfirmationModal extends React.PureComponent {
static propTypes = {
message: PropTypes.node.isRequired,

+ 2
- 2
app/javascript/mastodon/features/ui/components/embed_modal.js View File

@ -4,8 +4,8 @@ import ImmutablePureComponent from 'react-immutable-pure-component';
import { FormattedMessage, injectIntl } from 'react-intl';
import api from '../../../api';
@injectIntl
export default class EmbedModal extends ImmutablePureComponent {
export default @injectIntl
class EmbedModal extends ImmutablePureComponent {
static propTypes = {
url: PropTypes.string.isRequired,

+ 2
- 2
app/javascript/mastodon/features/ui/components/focal_point_modal.js View File

@ -19,8 +19,8 @@ const mapDispatchToProps = (dispatch, { id }) => ({
});
@connect(mapStateToProps, mapDispatchToProps)
export default class FocalPointModal extends ImmutablePureComponent {
export default @connect(mapStateToProps, mapDispatchToProps)
class FocalPointModal extends ImmutablePureComponent {
static propTypes = {
media: ImmutablePropTypes.map.isRequired,

+ 2
- 2
app/javascript/mastodon/features/ui/components/media_modal.js View File

@ -18,8 +18,8 @@ const messages = defineMessages({
export const previewState = 'previewMediaModal';
@injectIntl
export default class MediaModal extends ImmutablePureComponent {
export default @injectIntl
class MediaModal extends ImmutablePureComponent {
static propTypes = {
media: ImmutablePropTypes.list.isRequired,

+ 2
- 2
app/javascript/mastodon/features/ui/components/mute_modal.js View File

@ -33,9 +33,9 @@ const mapDispatchToProps = dispatch => {
};
};
@connect(mapStateToProps, mapDispatchToProps)
export default @connect(mapStateToProps, mapDispatchToProps)
@injectIntl
export default class MuteModal extends React.PureComponent {
class MuteModal extends React.PureComponent {
static propTypes = {
isSubmitting: PropTypes.bool.isRequired,

+ 2
- 2
app/javascript/mastodon/features/ui/components/onboarding_modal.js View File

@ -177,9 +177,9 @@ const mapStateToProps = state => ({
domain: state.getIn(['meta', 'domain']),
});
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
export default class OnboardingModal extends React.PureComponent {
class OnboardingModal extends React.PureComponent {
static propTypes = {
onClose: PropTypes.func.isRequired,

+ 2
- 2
app/javascript/mastodon/features/ui/components/report_modal.js View File

@ -37,9 +37,9 @@ const makeMapStateToProps = () => {
return mapStateToProps;
};
@connect(makeMapStateToProps)
export default @connect(makeMapStateToProps)
@injectIntl
export default class ReportModal extends ImmutablePureComponent {
class ReportModal extends ImmutablePureComponent {
static propTypes = {
isSubmitting: PropTypes.bool,

+ 2
- 2
app/javascript/mastodon/features/ui/components/tabs_bar.js View File

@ -24,9 +24,9 @@ export function getLink (index) {
return links[index].props.to;
}
@injectIntl
export default @injectIntl
@withRouter
export default class TabsBar extends React.PureComponent {
class TabsBar extends React.PureComponent {
static propTypes = {
intl: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/ui/index.js View File

@ -187,10 +187,10 @@ class SwitchingColumnsArea extends React.PureComponent {
}
@connect(mapStateToProps)
export default @connect(mapStateToProps)
@injectIntl
@withRouter
export default class UI extends React.PureComponent {
class UI extends React.PureComponent {
static contextTypes = {
router: PropTypes.object.isRequired,

+ 2
- 2
app/javascript/mastodon/features/video/index.js View File

@ -84,8 +84,8 @@ export const getPointerPosition = (el, event) => {
return position;
};
@injectIntl
export default class Video extends React.PureComponent {
export default @injectIntl
class Video extends React.PureComponent {
static propTypes = {
preview: PropTypes.string,

+ 65
- 0
babel.config.js View File

@ -0,0 +1,65 @@
module.exports = (api) => {
const env = api.env();
const envOptions = {
debug: false,
loose: true,
modules: false,
};
const config = {
presets: [
'@babel/react',
['@babel/env', envOptions],
],
plugins: [
'@babel/syntax-dynamic-import',
['@babel/proposal-object-rest-spread', { useBuiltIns: true }],
['@babel/proposal-decorators', { legacy: true }],
'@babel/proposal-class-properties',
['react-intl', { messagesDir: './build/messages' }],
'preval',
],
};
switch (env) {
case 'production':
envOptions.debug = false;
config.plugins.push(...[
'lodash',
[
'transform-react-remove-prop-types',
{
mode: 'remove',
removeImport: true,
additionalLibraries: [
'react-immutable-proptypes',
],
},
],
'@babel/transform-react-inline-elements',
[
'@babel/transform-runtime',
{
helpers: true,
regenerator: false,
useESModules: true,
},
],
]);
break;
case 'development':
envOptions.debug = true;
config.plugins.push(...[
'@babel/transform-react-jsx-source',
'@babel/transform-react-jsx-self',
]);
break;
case 'test':
envOptions.modules = 'commonjs';
break;
}
return config;
};

+ 1
- 1
bin/webpack View File

@ -1,7 +1,7 @@
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= ENV["NODE_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",

+ 1
- 1
bin/webpack-dev-server View File

@ -1,7 +1,7 @@
#!/usr/bin/env ruby
ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= ENV["NODE_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"
require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",

+ 0
- 1
config/webpack/loaders/babel.js View File

@ -7,7 +7,6 @@ module.exports = {
exclude: /node_modules/,
loader: 'babel-loader',
options: {
forceEnv: env,
cacheDirectory: env === 'development' ? false : resolve(__dirname, '..', '..', '..', 'tmp', 'cache', 'babel-loader'),
},
};

+ 0
- 1
config/webpack/production.js View File

@ -69,7 +69,6 @@ module.exports = merge(sharedConfig, {
plugins: [
new CompressionPlugin({
asset: '[path].gz[query]',
algorithm: compressionAlgorithm,
test: /\.(js|css|html|json|ico|svg|eot|otf|ttf)$/,
}),

+ 44
- 36
package.json View File

@ -6,8 +6,8 @@
},
"scripts": {
"postversion": "git push --tags",
"build:development": "cross-env RAILS_ENV=development ./bin/webpack",
"build:production": "cross-env RAILS_ENV=production ./bin/webpack",
"build:development": "cross-env RAILS_ENV=development NODE_ENV=development ./bin/webpack",
"build:production": "cross-env RAILS_ENV=production NODE_ENV=production ./bin/webpack",
"manage:translations": "node ./config/webpack/translationRunner.js",
"start": "node ./streaming/index.js",
"test": "npm-run-all test:lint test:jest",
@ -18,32 +18,38 @@
"type": "git",
"url": "https://github.com/tootsuite/mastodon.git"
},
"browserslist": [
"last 2 versions",
"IE >= 11",
"iOS >= 9"
],
"private": true,
"dependencies": {
"@babel/core": "^7.0.1",
"@babel/plugin-proposal-class-properties": "^7.0.0",
"@babel/plugin-proposal-decorators": "^7.0.0",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
"@babel/plugin-transform-react-inline-elements": "^7.0.0",
"@babel/plugin-transform-react-jsx-self": "^7.0.0",
"@babel/plugin-transform-react-jsx-source": "^7.0.0",
"@babel/plugin-transform-runtime": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"@babel/preset-react": "^7.0.0",
"@babel/runtime": "^7.0.0",
"array-includes": "^3.0.3",
"autoprefixer": "^8.6.5",
"axios": "~0.16.2",
"babel-core": "^6.26.3",
"babel-loader": "^7.1.5",
"babel-core": "^7.0.0-bridge.0",
"babel-loader": "^8.0.2",
"babel-plugin-lodash": "^3.3.4",
"babel-plugin-preval": "^1.6.1",
"babel-plugin-react-intl": "^2.4.0",
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
"babel-plugin-transform-object-rest-spread": "^6.23.0",
"babel-plugin-transform-react-inline-elements": "^6.22.0",
"babel-plugin-transform-react-jsx-self": "^6.22.0",
"babel-plugin-transform-react-jsx-source": "^6.22.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-plugin-preval": "^3.0.1",
"babel-plugin-react-intl": "^3.0.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.15",
"classnames": "^2.2.5",
"compression-webpack-plugin": "^1.1.11",
"compression-webpack-plugin": "^2.0.0",
"cross-env": "^5.1.4",
"css-loader": "^0.28.11",
"css-loader": "^1.0.0",
"detect-passive-events": "^1.0.2",
"dotenv": "^4.0.0",
"emoji-mart": "Gargron/emoji-mart#build",
@ -51,9 +57,10 @@
"escape-html": "^1.0.3",
"exif-js": "^2.3.0",
"express": "^4.16.2",
"file-loader": "^1.1.11",
"file-loader": "^2.0.0",
"font-awesome": "^4.7.0",
"glob": "^7.1.1",
"history": "^4.7.2",
"http-link-header": "^0.8.0",
"immutable": "^3.8.2",
"imports-loader": "^0.8.0",
@ -66,7 +73,7 @@
"lodash": "^4.17.5",
"mark-loader": "^0.1.6",
"marky": "^1.2.0",
"mini-css-extract-plugin": "^0.4.1",
"mini-css-extract-plugin": "^0.4.2",
"mkdirp": "^0.5.1",
"node-sass": "^4.9.2",
"npm-run-all": "^4.1.2",
@ -77,28 +84,28 @@
"offline-plugin": "^5.0.5",
"path-complete-extname": "^1.0.0",
"pg": "^6.4.0",
"postcss-loader": "^2.1.6",
"postcss-loader": "^3.0.0",
"postcss-object-fit-images": "^1.1.2",
"postcss-smart-import": "^0.7.6",
"precss": "^3.1.2",
"prop-types": "^15.5.10",
"punycode": "^2.1.0",
"rails-ujs": "^5.2.0",
"react": "^16.3.0",
"react-dom": "^16.3.0",
"react": "^16.5.0",
"react-dom": "^16.5.0",
"react-hotkeys": "^0.10.0",
"react-immutable-proptypes": "^2.1.0",
"react-immutable-pure-component": "^1.1.1",
"react-intl": "^2.4.0",
"react-motion": "^0.5.2",
"react-notification": "^6.8.2",
"react-notification": "^6.8.4",
"react-overlays": "^0.8.3",
"react-redux": "^5.0.4",
"react-redux-loading-bar": "^2.9.3",
"react-router-dom": "^4.1.1",
"react-router-scroll-4": "^1.0.0-beta.1",
"react-sparklines": "^1.7.0",
"react-swipeable-views": "0.12.13",
"react-swipeable-views": "^0.12.17",
"react-textarea-autosize": "^5.2.1",
"react-toggle": "^4.0.1",
"redis": "^2.7.1",
@ -111,34 +118,35 @@
"rimraf": "^2.6.1",
"sass-loader": "^7.0.3",
"stringz": "^0.3.0",
"style-loader": "^0.21.0",
"style-loader": "^0.23.0",
"substring-trie": "^1.0.2",
"throng": "^4.0.0",
"tiny-queue": "^0.2.1",
"uglifyjs-webpack-plugin": "^1.2.7",
"uuid": "^3.1.0",
"uws": "10.148.0",
"webpack": "^4.16.0",
"webpack": "^4.18.0",
"webpack-bundle-analyzer": "^2.13.1",
"webpack-cli": "^3.0.8",
"webpack-manifest-plugin": "^2.0.3",
"webpack-manifest-plugin": "^2.0.4",
"webpack-merge": "^4.1.3",
"websocket.js": "^0.1.12"
},
"devDependencies": {
"babel-eslint"