Convert CommonJS exports to ES6-compatible exports

We use `export default` begrudgingly here. Ideally we'd use just `export`, though this entire SDK expects things to be exported as a default. Instead of breaking everything, we'll sacrifice our export pattern for a smaller diff - a later commit can always do the default export -> regular export conversion.
This commit is contained in:
Travis Ralston
2019-12-22 21:01:02 -07:00
parent 0b0fe92b17
commit 344dac4fb9
147 changed files with 649 additions and 620 deletions
+1 -1
View File
@@ -194,7 +194,7 @@ function computedStyle(element) {
return cssText;
}
module.exports = createReactClass({
export default createReactClass({
displayName: 'MFileBody',
getInitialState: function() {
+2 -1
View File
@@ -1,5 +1,6 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -23,7 +24,7 @@ import { decryptFile } from '../../../utils/DecryptFile';
import { _t } from '../../../languageHandler';
import SettingsStore from "../../../settings/SettingsStore";
module.exports = createReactClass({
export default createReactClass({
displayName: 'MVideoBody',
propTypes: {
@@ -21,7 +21,7 @@ import sdk from '../../../index';
import SettingsStore from "../../../settings/SettingsStore";
import {Mjolnir} from "../../../mjolnir/Mjolnir";
module.exports = createReactClass({
export default createReactClass({
displayName: 'MessageEvent',
propTypes: {
@@ -1,6 +1,7 @@
/*
Copyright 2017 Vector Creations Ltd
Copyright 2019 Michael Telatynski <7t3chguy@gmail.com>
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -24,7 +25,7 @@ import sdk from '../../../index';
import Modal from '../../../Modal';
import AccessibleButton from '../elements/AccessibleButton';
module.exports = createReactClass({
export default createReactClass({
displayName: 'RoomAvatarEvent',
propTypes: {
+2 -1
View File
@@ -1,5 +1,6 @@
/*
Copyright 2018 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -23,7 +24,7 @@ import { RoomPermalinkCreator } from '../../../utils/permalinks/Permalinks';
import { _t } from '../../../languageHandler';
import MatrixClientPeg from '../../../MatrixClientPeg';
module.exports = createReactClass({
export default createReactClass({
displayName: 'RoomCreate',
propTypes: {
+1 -1
View File
@@ -35,7 +35,7 @@ import {IntegrationManagers} from "../../../integrations/IntegrationManagers";
import {isPermalinkHost} from "../../../utils/permalinks/Permalinks";
import {toRightOf} from "../../structures/ContextMenu";
module.exports = createReactClass({
export default createReactClass({
displayName: 'TextualBody',
propTypes: {
@@ -1,5 +1,6 @@
/*
Copyright 2015, 2016 OpenMarket Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -20,7 +21,7 @@ import createReactClass from 'create-react-class';
const TextForEvent = require('../../../TextForEvent');
module.exports = createReactClass({
export default createReactClass({
displayName: 'TextualEvent',
propTypes: {
+1 -1
View File
@@ -18,7 +18,7 @@ import React from 'react';
import createReactClass from 'create-react-class';
import { _t } from '../../../languageHandler';
module.exports = createReactClass({
export default createReactClass({
displayName: 'UnknownBody',
render: function() {