Browse Source

Upgrade Babel to version 7.0.0 (#5925)

Yamagishi Kazutoshi 3 months ago
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 @@
1
-{
2
-  "presets": [
3
-    "react",
4
-    [
5
-      "env",
6
-      {
7
-        "exclude": ["transform-async-to-generator", "transform-regenerator"],
8
-        "loose": true,
9
-        "modules": false,
10
-        "targets": {
11
-          "browsers": ["last 2 versions", "IE >= 11", "iOS >= 9"]
12
-        }
13
-      }
14
-    ]
15
-  ],
16
-  "plugins": [
17
-    "syntax-dynamic-import",
18
-    ["transform-object-rest-spread", { "useBuiltIns": true }],
19
-    "transform-decorators-legacy",
20
-    "transform-class-properties",
21
-    [
22
-      "react-intl",
23
-      {
24
-        "messagesDir": "./build/messages"
25
-      }
26
-    ],
27
-    "preval"
28
-  ],
29
-  "env": {
30
-    "development": {
31
-      "plugins": [
32
-        "transform-react-jsx-source",
33
-        "transform-react-jsx-self"
34
-      ]
35
-    },
36
-    "production": {
37
-      "plugins": [
38
-        "lodash",
39
-        [
40
-          "transform-react-remove-prop-types",
41
-          {
42
-            "mode": "remove",
43
-            "removeImport": true,
44
-            "additionalLibraries": [
45
-              "react-immutable-proptypes"
46
-            ]
47
-          }
48
-        ],
49
-        "transform-react-inline-elements",
50
-        [
51
-          "transform-runtime",
52
-          {
53
-            "helpers": true,
54
-            "polyfill": false,
55
-            "regenerator": false
56
-          }
57
-        ]
58
-      ]
59
-    },
60
-    "test": {
61
-      "plugins": [
62
-        "transform-es2015-modules-commonjs"
63
-      ]
64
-    }
65
-  }
66
-}

+ 1
- 1
Gemfile View File

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

+ 2
- 2
Gemfile.lock View File

@@ -627,7 +627,7 @@ GEM
627 627
       addressable (>= 2.3.6)
628 628
       crack (>= 0.3.2)
629 629
       hashdiff
630
-    webpacker (3.4.3)
630
+    webpacker (3.5.5)
631 631
       activesupport (>= 4.2)
632 632
       rack-proxy (>= 0.6.1)
633 633
       railties (>= 4.2)
@@ -758,7 +758,7 @@ DEPENDENCIES
758 758
   twitter-text (~> 1.14)
759 759
   tzinfo-data (~> 1.2018)
760 760
   webmock (~> 3.3)
761
-  webpacker (~> 3.4)
761
+  webpacker (~> 3.5)
762 762
   webpush
763 763
 
764 764
 RUBY VERSION

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

@@ -3,7 +3,6 @@
3 3
 exports[`<Button /> adds class "button-secondary" if props.secondary given 1`] = `
4 4
 <button
5 5
   className="button button-secondary"
6
-  disabled={undefined}
7 6
   onClick={[Function]}
8 7
   style={
9 8
     Object {
@@ -18,7 +17,6 @@ exports[`<Button /> adds class "button-secondary" if props.secondary given 1`] =
18 17
 exports[`<Button /> renders a button element 1`] = `
19 18
 <button
20 19
   className="button"
21
-  disabled={undefined}
22 20
   onClick={[Function]}
23 21
   style={
24 22
     Object {
@@ -48,7 +46,6 @@ exports[`<Button /> renders a disabled attribute if props.disabled given 1`] = `
48 46
 exports[`<Button /> renders class="button--block" if props.block given 1`] = `
49 47
 <button
50 48
   className="button button--block"
51
-  disabled={undefined}
52 49
   onClick={[Function]}
53 50
   style={
54 51
     Object {
@@ -63,7 +60,6 @@ exports[`<Button /> renders class="button--block" if props.block given 1`] = `
63 60
 exports[`<Button /> renders the children 1`] = `
64 61
 <button
65 62
   className="button"
66
-  disabled={undefined}
67 63
   onClick={[Function]}
68 64
   style={
69 65
     Object {
@@ -82,7 +78,6 @@ exports[`<Button /> renders the children 1`] = `
82 78
 exports[`<Button /> renders the given text 1`] = `
83 79
 <button
84 80
   className="button"
85
-  disabled={undefined}
86 81
   onClick={[Function]}
87 82
   style={
88 83
     Object {
@@ -99,7 +94,6 @@ exports[`<Button /> renders the given text 1`] = `
99 94
 exports[`<Button /> renders the props.text instead of children 1`] = `
100 95
 <button
101 96
   className="button"
102
-  disabled={undefined}
103 97
   onClick={[Function]}
104 98
   style={
105 99
     Object {

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

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

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

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

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

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

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

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

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

@@ -179,8 +179,8 @@ class Item extends React.PureComponent {
179 179
 
180 180
 }
181 181
 
182
-@injectIntl
183
-export default class MediaGallery extends React.PureComponent {
182
+export default @injectIntl
183
+class MediaGallery extends React.PureComponent {
184 184
 
185 185
   static propTypes = {
186 186
     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) => {
86 86
   return relativeTime;
87 87
 };
88 88
 
89
-@injectIntl
90
-export default class RelativeTimestamp extends React.Component {
89
+export default @injectIntl
90
+class RelativeTimestamp extends React.Component {
91 91
 
92 92
   static propTypes = {
93 93
     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) => {
35 35
   return values.join(', ');
36 36
 };
37 37
 
38
-@injectIntl
39
-export default class Status extends ImmutablePureComponent {
38
+export default @injectIntl
39
+class Status extends ImmutablePureComponent {
40 40
 
41 41
   static contextTypes = {
42 42
     router: PropTypes.object,

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

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

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

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

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

@@ -65,8 +65,8 @@ class Avatar extends ImmutablePureComponent {
65 65
 
66 66
 }
67 67
 
68
-@injectIntl
69
-export default class Header extends ImmutablePureComponent {
68
+export default @injectIntl
69
+class Header extends ImmutablePureComponent {
70 70
 
71 71
   static propTypes = {
72 72
     account: ImmutablePropTypes.map,

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

@@ -43,8 +43,8 @@ class LoadMoreMedia extends ImmutablePureComponent {
43 43
 
44 44
 }
45 45
 
46
-@connect(mapStateToProps)
47
-export default class AccountGallery extends ImmutablePureComponent {
46
+export default @connect(mapStateToProps)
47
+class AccountGallery extends ImmutablePureComponent {
48 48
 
49 49
   static propTypes = {
50 50
     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 })
23 23
   };
24 24
 };
25 25
 
26
-@connect(mapStateToProps)
27
-export default class AccountTimeline extends ImmutablePureComponent {
26
+export default @connect(mapStateToProps)
27
+class AccountTimeline extends ImmutablePureComponent {
28 28
 
29 29
   static propTypes = {
30 30
     params: PropTypes.object.isRequired,

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

@@ -20,9 +20,9 @@ const mapStateToProps = state => ({
20 20
   accountIds: state.getIn(['user_lists', 'blocks', 'items']),
21 21
 });
22 22
 
23
-@connect(mapStateToProps)
23
+export default @connect(mapStateToProps)
24 24
 @injectIntl
25
-export default class Blocks extends ImmutablePureComponent {
25
+class Blocks extends ImmutablePureComponent {
26 26
 
27 27
   static propTypes = {
28 28
     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';
4 4
 import { injectIntl, FormattedMessage } from 'react-intl';
5 5
 import SettingToggle from '../../notifications/components/setting_toggle';
6 6
 
7
-@injectIntl
8
-export default class ColumnSettings extends React.PureComponent {
7
+export default @injectIntl
8
+class ColumnSettings extends React.PureComponent {
9 9
 
10 10
   static propTypes = {
11 11
     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 }) => {
25 25
   };
26 26
 };
27 27
 
28
-@connect(mapStateToProps)
28
+export default @connect(mapStateToProps)
29 29
 @injectIntl
30
-export default class CommunityTimeline extends React.PureComponent {
30
+class CommunityTimeline extends React.PureComponent {
31 31
 
32 32
   static contextTypes = {
33 33
     router: PropTypes.object,

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

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

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

@@ -27,8 +27,8 @@ const messages = defineMessages({
27 27
   publishLoud: { id: 'compose_form.publish_loud', defaultMessage: '{publish}!' },
28 28
 });
29 29
 
30
-@injectIntl
31
-export default class ComposeForm extends ImmutablePureComponent {
30
+export default @injectIntl
31
+class ComposeForm extends ImmutablePureComponent {
32 32
 
33 33
   static propTypes = {
34 34
     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 {
278 278
 
279 279
 }
280 280
 
281
-@injectIntl
282
-export default class EmojiPickerDropdown extends React.PureComponent {
281
+export default @injectIntl
282
+class EmojiPickerDropdown extends React.PureComponent {
283 283
 
284 284
   static propTypes = {
285 285
     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 {
149 149
 
150 150
 }
151 151
 
152
-@injectIntl
153
-export default class PrivacyDropdown extends React.PureComponent {
152
+export default @injectIntl
153
+class PrivacyDropdown extends React.PureComponent {
154 154
 
155 155
   static propTypes = {
156 156
     isUserTouching: PropTypes.func,

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

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

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

@@ -43,8 +43,8 @@ class SearchPopout extends React.PureComponent {
43 43
 
44 44
 }
45 45
 
46
-@injectIntl
47
-export default class Search extends React.PureComponent {
46
+export default @injectIntl
47
+class Search extends React.PureComponent {
48 48
 
49 49
   static propTypes = {
50 50
     value: PropTypes.string.isRequired,

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

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

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

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

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

@@ -30,9 +30,9 @@ const mapStateToProps = (state, ownProps) => ({
30 30
   showSearch: ownProps.multiColumn ? state.getIn(['search', 'submitted']) && !state.getIn(['search', 'hidden']) : ownProps.isSearchPage,
31 31
 });
32 32
 
33
-@connect(mapStateToProps)
33
+export default @connect(mapStateToProps)
34 34
 @injectIntl
35
-export default class Compose extends React.PureComponent {
35
+class Compose extends React.PureComponent {
36 36
 
37 37
   static propTypes = {
38 38
     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({
9 9
   settings: { id: 'home.settings', defaultMessage: 'Column settings' },
10 10
 });
11 11
 
12
-@injectIntl
13
-export default class ColumnSettings extends React.PureComponent {
12
+export default @injectIntl
13
+class ColumnSettings extends React.PureComponent {
14 14
 
15 15
   static propTypes = {
16 16
     settings: ImmutablePropTypes.map.isRequired,

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

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

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

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

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

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

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

@@ -15,8 +15,8 @@ const mapStateToProps = (state, props) => ({
15 15
   accountIds: state.getIn(['user_lists', 'favourited_by', props.params.statusId]),
16 16
 });
17 17
 
18
-@connect(mapStateToProps)
19
-export default class Favourites extends ImmutablePureComponent {
18
+export default @connect(mapStateToProps)
19
+class Favourites extends ImmutablePureComponent {
20 20
 
21 21
   static propTypes = {
22 22
     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({
13 13
   reject: { id: 'follow_request.reject', defaultMessage: 'Reject' },
14 14
 });
15 15
 
16
-@injectIntl
17
-export default class AccountAuthorize extends ImmutablePureComponent {
16
+export default @injectIntl
17
+class AccountAuthorize extends ImmutablePureComponent {
18 18
 
19 19
   static propTypes = {
20 20
     account: ImmutablePropTypes.map.isRequired,

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

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

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

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

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

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

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

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

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

@@ -13,8 +13,8 @@ const mapStateToProps = (state, props) => ({
13 13
   hasUnread: state.getIn(['timelines', `hashtag:${props.params.id}`, 'unread']) > 0,
14 14
 });
15 15
 
16
-@connect(mapStateToProps)
17
-export default class HashtagTimeline extends React.PureComponent {
16
+export default @connect(mapStateToProps)
17
+class HashtagTimeline extends React.PureComponent {
18 18
 
19 19
   static propTypes = {
20 20
     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';
4 4
 import { injectIntl, FormattedMessage } from 'react-intl';
5 5
 import SettingToggle from '../../notifications/components/setting_toggle';
6 6
 
7
-@injectIntl
8
-export default class ColumnSettings extends React.PureComponent {
7
+export default @injectIntl
8
+class ColumnSettings extends React.PureComponent {
9 9
 
10 10
   static propTypes = {
11 11
     settings: ImmutablePropTypes.map.isRequired,

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

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

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

@@ -9,8 +9,8 @@ const messages = defineMessages({
9 9
   heading: { id: 'keyboard_shortcuts.heading', defaultMessage: 'Keyboard Shortcuts' },
10 10
 });
11 11
 
12
-@injectIntl
13
-export default class KeyboardShortcuts extends ImmutablePureComponent {
12
+export default @injectIntl
13
+class KeyboardShortcuts extends ImmutablePureComponent {
14 14
 
15 15
   static propTypes = {
16 16
     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 }) => ({
31 31
   onAdd: () => dispatch(addToListEditor(accountId)),
32 32
 });
33 33
 
34
-@connect(makeMapStateToProps, mapDispatchToProps)
34
+export default @connect(makeMapStateToProps, mapDispatchToProps)
35 35
 @injectIntl
36
-export default class Account extends ImmutablePureComponent {
36
+class Account extends ImmutablePureComponent {
37 37
 
38 38
   static propTypes = {
39 39
     account: ImmutablePropTypes.map.isRequired,

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

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

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

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

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

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

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

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

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

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

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

@@ -20,9 +20,9 @@ const mapStateToProps = state => ({
20 20
   accountIds: state.getIn(['user_lists', 'mutes', 'items']),
21 21
 });
22 22
 
23
-@connect(mapStateToProps)
23
+export default @connect(mapStateToProps)
24 24
 @injectIntl
25
-export default class Mutes extends ImmutablePureComponent {
25
+class Mutes extends ImmutablePureComponent {
26 26
 
27 27
   static propTypes = {
28 28
     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) => {
16 16
   return output.join(', ');
17 17
 };
18 18
 
19
-@injectIntl
20
-export default class Notification extends ImmutablePureComponent {
19
+export default @injectIntl
20
+class Notification extends ImmutablePureComponent {
21 21
 
22 22
   static contextTypes = {
23 23
     router: PropTypes.object,

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

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

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

@@ -18,9 +18,9 @@ const mapStateToProps = state => ({
18 18
   hasMore: !!state.getIn(['status_lists', 'pins', 'next']),
19 19
 });
20 20
 
21
-@connect(mapStateToProps)
21
+export default @connect(mapStateToProps)
22 22
 @injectIntl
23
-export default class PinnedStatuses extends ImmutablePureComponent {
23
+class PinnedStatuses extends ImmutablePureComponent {
24 24
 
25 25
   static propTypes = {
26 26
     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 }) => {
25 25
   };
26 26
 };
27 27
 
28
-@connect(mapStateToProps)
28
+export default @connect(mapStateToProps)
29 29
 @injectIntl
30
-export default class PublicTimeline extends React.PureComponent {
30
+class PublicTimeline extends React.PureComponent {
31 31
 
32 32
   static contextTypes = {
33 33
     router: PropTypes.object,

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

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

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

@@ -12,9 +12,9 @@ const messages = defineMessages({
12 12
   title: { id: 'standalone.public_title', defaultMessage: 'A look inside...' },
13 13
 });
14 14
 
15
-@connect()
15
+export default @connect()
16 16
 @injectIntl
17
-export default class CommunityTimeline extends React.PureComponent {
17
+class CommunityTimeline extends React.PureComponent {
18 18
 
19 19
   static propTypes = {
20 20
     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';
7 7
 import ColumnHeader from '../../../components/column_header';
8 8
 import { connectHashtagStream } from '../../../actions/streaming';
9 9
 
10
-@connect()
11
-export default class HashtagTimeline extends React.PureComponent {
10
+export default @connect()
11
+class HashtagTimeline extends React.PureComponent {
12 12
 
13 13
   static propTypes = {
14 14
     dispatch: PropTypes.func.isRequired,

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

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

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

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

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

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

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

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

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

@@ -35,8 +35,8 @@ const messages = defineMessages({
35 35
 
36 36
 const shouldHideFAB = path => path.match(/^\/statuses\//);
37 37
 
38
-@component => injectIntl(component, { withRef: true })
39
-export default class ColumnsArea extends ImmutablePureComponent {
38
+export default @(component => injectIntl(component, { withRef: true }))
39
+class ColumnsArea extends ImmutablePureComponent {
40 40
 
41 41
   static contextTypes = {
42 42
     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';
3 3
 import { injectIntl, FormattedMessage } from 'react-intl';
4 4
 import Button from '../../../components/button';
5 5
 
6
-@injectIntl
7
-export default class ConfirmationModal extends React.PureComponent {
6
+export default @injectIntl
7
+class ConfirmationModal extends React.PureComponent {
8 8
 
9 9
   static propTypes = {
10 10
     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';
4 4
 import { FormattedMessage, injectIntl } from 'react-intl';
5 5
 import api from '../../../api';
6 6
 
7
-@injectIntl
8
-export default class EmbedModal extends ImmutablePureComponent {
7
+export default @injectIntl
8
+class EmbedModal extends ImmutablePureComponent {
9 9
 
10 10
   static propTypes = {
11 11
     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 }) => ({
19 19
 
20 20
 });
21 21
 
22
-@connect(mapStateToProps, mapDispatchToProps)
23
-export default class FocalPointModal extends ImmutablePureComponent {
22
+export default @connect(mapStateToProps, mapDispatchToProps)
23
+class FocalPointModal extends ImmutablePureComponent {
24 24
 
25 25
   static propTypes = {
26 26
     media: ImmutablePropTypes.map.isRequired,

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

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

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

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

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

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

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

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

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

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

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

@@ -187,10 +187,10 @@ class SwitchingColumnsArea extends React.PureComponent {
187 187
 
188 188
 }
189 189
 
190
-@connect(mapStateToProps)
190
+export default @connect(mapStateToProps)
191 191
 @injectIntl
192 192
 @withRouter
193
-export default class UI extends React.PureComponent {
193
+class UI extends React.PureComponent {
194 194
 
195 195
   static contextTypes = {
196 196
     router: PropTypes.object.isRequired,

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

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

+ 65
- 0
babel.config.js View File

@@ -0,0 +1,65 @@
1
+module.exports = (api) => {
2
+  const env = api.env();
3
+
4
+  const envOptions = {
5
+    debug: false,
6
+    loose: true,
7
+    modules: false,
8
+  };
9
+
10
+  const config = {
11
+    presets: [
12
+      '@babel/react',
13
+      ['@babel/env', envOptions],
14
+    ],
15
+    plugins: [
16
+      '@babel/syntax-dynamic-import',
17
+      ['@babel/proposal-object-rest-spread', { useBuiltIns: true }],
18
+      ['@babel/proposal-decorators', { legacy: true }],
19
+      '@babel/proposal-class-properties',
20
+      ['react-intl', { messagesDir: './build/messages' }],
21
+      'preval',
22
+    ],
23
+  };
24
+
25
+  switch (env) {
26
+  case 'production':
27
+    envOptions.debug = false;
28
+    config.plugins.push(...[
29
+      'lodash',
30
+      [
31
+        'transform-react-remove-prop-types',
32
+        {
33
+          mode: 'remove',
34
+          removeImport: true,
35
+          additionalLibraries: [
36
+            'react-immutable-proptypes',
37
+          ],
38
+        },
39
+      ],
40
+      '@babel/transform-react-inline-elements',
41
+      [
42
+        '@babel/transform-runtime',
43
+        {
44
+          helpers: true,
45
+          regenerator: false,
46
+          useESModules: true,
47
+        },
48
+      ],
49
+    ]);
50
+    break;
51
+  case 'development':
52
+    envOptions.debug = true;
53
+    config.plugins.push(...[
54
+      '@babel/transform-react-jsx-source',
55
+      '@babel/transform-react-jsx-self',
56
+    ]);
57
+    break;
58
+  case 'test':
59
+    envOptions.modules = 'commonjs';
60
+    break;
61
+  }
62
+
63
+  return config;
64
+};
65
+

+ 1
- 1
bin/webpack View File

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

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

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

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

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

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

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

+ 44
- 36
package.json View File

@@ -6,8 +6,8 @@
6 6
   },
7 7
   "scripts": {
8 8
     "postversion": "git push --tags",
9
-    "build:development": "cross-env RAILS_ENV=development ./bin/webpack",
10
-    "build:production": "cross-env RAILS_ENV=production ./bin/webpack",
9
+    "build:development": "cross-env RAILS_ENV=development NODE_ENV=development ./bin/webpack",
10
+    "build:production": "cross-env RAILS_ENV=production NODE_ENV=production ./bin/webpack",
11 11
     "manage:translations": "node ./config/webpack/translationRunner.js",
12 12
     "start": "node ./streaming/index.js",
13 13
     "test": "npm-run-all test:lint test:jest",
@@ -18,32 +18,38 @@
18 18
     "type": "git",
19 19
     "url": "https://github.com/tootsuite/mastodon.git"
20 20
   },
21
+  "browserslist": [
22
+    "last 2 versions",
23
+    "IE >= 11",
24
+    "iOS >= 9"
25
+  ],
21 26
   "private": true,
22 27
   "dependencies": {
28
+    "@babel/core": "^7.0.1",
29
+    "@babel/plugin-proposal-class-properties": "^7.0.0",
30
+    "@babel/plugin-proposal-decorators": "^7.0.0",
31
+    "@babel/plugin-proposal-object-rest-spread": "^7.0.0",
32
+    "@babel/plugin-syntax-dynamic-import": "^7.0.0",
33
+    "@babel/plugin-transform-react-inline-elements": "^7.0.0",
34
+    "@babel/plugin-transform-react-jsx-self": "^7.0.0",
35
+    "@babel/plugin-transform-react-jsx-source": "^7.0.0",
36
+    "@babel/plugin-transform-runtime": "^7.0.0",
37
+    "@babel/preset-env": "^7.0.0",
38
+    "@babel/preset-react": "^7.0.0",
39
+    "@babel/runtime": "^7.0.0",
23 40
     "array-includes": "^3.0.3",
24 41
     "autoprefixer": "^8.6.5",
25 42
     "axios": "~0.16.2",
26
-    "babel-core": "^6.26.3",
27
-    "babel-loader": "^7.1.5",
43
+    "babel-core": "^7.0.0-bridge.0",
44
+    "babel-loader": "^8.0.2",
28 45
     "babel-plugin-lodash": "^3.3.4",
29
-    "babel-plugin-preval": "^1.6.1",
30
-    "babel-plugin-react-intl": "^2.4.0",
31
-    "babel-plugin-syntax-dynamic-import": "^6.18.0",
32
-    "babel-plugin-transform-class-properties": "^6.24.1",
33
-    "babel-plugin-transform-decorators-legacy": "^1.3.5",
34
-    "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
35
-    "babel-plugin-transform-object-rest-spread": "^6.23.0",
36
-    "babel-plugin-transform-react-inline-elements": "^6.22.0",
37
-    "babel-plugin-transform-react-jsx-self": "^6.22.0",
38
-    "babel-plugin-transform-react-jsx-source": "^6.22.0",
39
-    "babel-plugin-transform-react-remove-prop-types": "^0.4.13",
40
-    "babel-plugin-transform-runtime": "^6.23.0",
41
-    "babel-preset-env": "^1.7.0",
42
-    "babel-preset-react": "^6.24.1",
46
+    "babel-plugin-preval": "^3.0.1",
47
+    "babel-plugin-react-intl": "^3.0.0",
48
+    "babel-plugin-transform-react-remove-prop-types": "^0.4.15",
43 49
     "classnames": "^2.2.5",
44
-    "compression-webpack-plugin": "^1.1.11",
50
+    "compression-webpack-plugin": "^2.0.0",
45 51
     "cross-env": "^5.1.4",
46
-    "css-loader": "^0.28.11",
52
+    "css-loader": "^1.0.0",
47 53
     "detect-passive-events": "^1.0.2",
48 54
     "dotenv": "^4.0.0",
49 55
     "emoji-mart": "Gargron/emoji-mart#build",
@@ -51,9 +57,10 @@
51 57
     "escape-html": "^1.0.3",
52 58
     "exif-js": "^2.3.0",
53 59
     "express": "^4.16.2",
54
-    "file-loader": "^1.1.11",
60
+    "file-loader": "^2.0.0",
55 61
     "font-awesome": "^4.7.0",
56 62
     "glob": "^7.1.1",
63
+    "history": "^4.7.2",
57 64
     "http-link-header": "^0.8.0",
58 65
     "immutable": "^3.8.2",
59 66
     "imports-loader": "^0.8.0",
@@ -66,7 +73,7 @@
66 73
     "lodash": "^4.17.5",
67 74
     "mark-loader": "^0.1.6",
68 75
     "marky": "^1.2.0",
69
-    "mini-css-extract-plugin": "^0.4.1",
76
+    "mini-css-extract-plugin": "^0.4.2",
70 77
     "mkdirp": "^0.5.1",
71 78
     "node-sass": "^4.9.2",
72 79
     "npm-run-all": "^4.1.2",
@@ -77,28 +84,28 @@
77 84
     "offline-plugin": "^5.0.5",
78 85
     "path-complete-extname": "^1.0.0",
79 86
     "pg": "^6.4.0",
80
-    "postcss-loader": "^2.1.6",
87
+    "postcss-loader": "^3.0.0",
81 88
     "postcss-object-fit-images": "^1.1.2",
82 89
     "postcss-smart-import": "^0.7.6",
83 90
     "precss": "^3.1.2",
84 91
     "prop-types": "^15.5.10",
85 92
     "punycode": "^2.1.0",
86 93
     "rails-ujs": "^5.2.0",
87
-    "react": "^16.3.0",
88
-    "react-dom": "^16.3.0",
94
+    "react": "^16.5.0",
95
+    "react-dom": "^16.5.0",
89 96
     "react-hotkeys": "^0.10.0",
90 97
     "react-immutable-proptypes": "^2.1.0",
91 98
     "react-immutable-pure-component": "^1.1.1",
92 99
     "react-intl": "^2.4.0",
93 100
     "react-motion": "^0.5.2",
94
-    "react-notification": "^6.8.2",
101
+    "react-notification": "^6.8.4",
95 102
     "react-overlays": "^0.8.3",
96 103
     "react-redux": "^5.0.4",
97 104
     "react-redux-loading-bar": "^2.9.3",
98 105
     "react-router-dom": "^4.1.1",
99 106
     "react-router-scroll-4": "^1.0.0-beta.1",
100 107
     "react-sparklines": "^1.7.0",
101
-    "react-swipeable-views": "0.12.13",
108
+    "react-swipeable-views": "^0.12.17",
102 109
     "react-textarea-autosize": "^5.2.1",
103 110
     "react-toggle": "^4.0.1",
104 111
     "redis": "^2.7.1",
@@ -111,34 +118,35 @@
111 118
     "rimraf": "^2.6.1",
112 119
     "sass-loader": "^7.0.3",
113 120
     "stringz": "^0.3.0",
114
-    "style-loader": "^0.21.0",
121
+    "style-loader": "^0.23.0",
115 122
     "substring-trie": "^1.0.2",
116 123
     "throng": "^4.0.0",
117 124
     "tiny-queue": "^0.2.1",
118 125
     "uglifyjs-webpack-plugin": "^1.2.7",
119 126
     "uuid": "^3.1.0",
120 127
     "uws": "10.148.0",
121
-    "webpack": "^4.16.0",
128
+    "webpack": "^4.18.0",
122 129
     "webpack-bundle-analyzer": "^2.13.1",
123 130
     "webpack-cli": "^3.0.8",
124
-    "webpack-manifest-plugin": "^2.0.3",
131
+    "webpack-manifest-plugin": "^2.0.4",
125 132
     "webpack-merge": "^4.1.3",
126 133
     "websocket.js": "^0.1.12"
127 134
   },
128 135
   "devDependencies": {
129
-    "babel-eslint": "^8.2.6",
130
-    "enzyme": "^3.2.0",
131
-    "enzyme-adapter-react-16": "^1.1.0",
136
+    "babel-eslint": "^9.0.0",
137
+    "babel-jest": "^23.6.0",
138
+    "enzyme": "^3.6.0",
139
+    "enzyme-adapter-react-16": "^1.5.0",
132 140
     "eslint": "^4.19.1",
133 141
     "eslint-plugin-import": "^2.8.0",
134 142
     "eslint-plugin-jsx-a11y": "^6.0.3",
135 143
     "eslint-plugin-promise": "^3.8.0",
136 144
     "eslint-plugin-react": "^7.8.2",
137
-    "jest": "^21.2.1",
145
+    "jest": "^23.6.0",
138 146
     "raf": "^3.4.0",
139 147
     "react-intl-translations-manager": "^5.0.3",
140
-    "react-test-renderer": "^16.2.0",
141
-    "webpack-dev-server": "^3.1.4",
148
+    "react-test-renderer": "^16.5.0",
149
+    "webpack-dev-server": "^3.1.8",
142 150
     "yargs": "^8.0.2"
143 151
   },
144 152
   "optionalDependencies": {

+ 2139
- 2073
yarn.lock
File diff suppressed because it is too large
View File