Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Conversation

turt2live
Copy link
Member

@turt2live turt2live commented Dec 23, 2019

This is against travis/sourcemaps for safety.

Split from #3744

Part 1 of a few for ES6 conversion. Best reviewed commit-by-commit.


This PR and others in the series have their overview covered here: https://gist.github.com/turt2live/a3fc7c9712b8ef0f1f758611aa33382d

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.
@turt2live turt2live requested a review from a team December 23, 2019 04:02
turt2live added a commit that referenced this pull request Dec 23, 2019
@turt2live
Copy link
Member Author

turt2live commented Dec 23, 2019

A failing build is not surprising - this will be fixed in a future PR before the feature branch goes to develop.

'use strict';

module.exports = function(dest, src) {
export default function(dest, src) {
Copy link
Member

Choose a reason for hiding this comment

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

I thought export default broke things?

Copy link
Member Author

Choose a reason for hiding this comment

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

It does for the js-sdk, not for the react-sdk. We don't have a central index for the react-sdk that we need to worry about

import {PushRuleVectorState} from "./PushRuleVectorState";

module.exports = {
export class ContentRules {
Copy link
Member

Choose a reason for hiding this comment

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

Same comment as matrix-org/matrix-js-sdk#1134 on classes of static methods.

'use strict';

module.exports = {
export class NotificationUtils {
Copy link
Member

Choose a reason for hiding this comment

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

ditto

@turt2live turt2live merged commit 59f608f into travis/sourcemaps Jan 8, 2020
@turt2live turt2live deleted the travis/babel7-wp-es6-export branch January 8, 2020 16:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants