Commit 75bab3ba authored by Katherine Patenio's avatar Katherine Patenio
Browse files

Bug 1830809 - Convert JS modules in browser/components/syncedtabs to ES module...

Bug 1830809 - Convert JS modules in browser/components/syncedtabs to ES module r=webdriver-reviewers,Standard8,whimboo

Differential Revision: https://phabricator.services.mozilla.com/D178368
parent de10bf98
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -2,12 +2,8 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

var EXPORTED_SYMBOLS = ["EventEmitter"];

// Simple event emitter abstraction for storage objects to use.
function EventEmitter() {
export function EventEmitter() {
  this._events = new Map();
}

+8 −34
Original line number Diff line number Diff line
@@ -2,39 +2,13 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

const { XPCOMUtils } = ChromeUtils.importESModule(
  "resource://gre/modules/XPCOMUtils.sys.mjs"
);

const { SyncedTabsDeckStore } = ChromeUtils.import(
  "resource:///modules/syncedtabs/SyncedTabsDeckStore.js"
);
const { SyncedTabsDeckView } = ChromeUtils.import(
  "resource:///modules/syncedtabs/SyncedTabsDeckView.js"
);
const { SyncedTabsListStore } = ChromeUtils.import(
  "resource:///modules/syncedtabs/SyncedTabsListStore.js"
);
const { TabListComponent } = ChromeUtils.import(
  "resource:///modules/syncedtabs/TabListComponent.js"
);
const { TabListView } = ChromeUtils.import(
  "resource:///modules/syncedtabs/TabListView.js"
);
let { getChromeWindow } = ChromeUtils.import(
  "resource:///modules/syncedtabs/util.js"
);
const { UIState } = ChromeUtils.importESModule(
  "resource://services-sync/UIState.sys.mjs"
);

let log = ChromeUtils.importESModule(
  "resource://gre/modules/Log.sys.mjs"
).Log.repository.getLogger("Sync.RemoteTabs");

var EXPORTED_SYMBOLS = ["SyncedTabsDeckComponent"];
import { SyncedTabsDeckStore } from "resource:///modules/syncedtabs/SyncedTabsDeckStore.sys.mjs";
import { SyncedTabsDeckView } from "resource:///modules/syncedtabs/SyncedTabsDeckView.sys.mjs";
import { SyncedTabsListStore } from "resource:///modules/syncedtabs/SyncedTabsListStore.sys.mjs";
import { TabListComponent } from "resource:///modules/syncedtabs/TabListComponent.sys.mjs";
import { TabListView } from "resource:///modules/syncedtabs/TabListView.sys.mjs";
import { getChromeWindow } from "resource:///modules/syncedtabs/util.sys.mjs";
import { UIState } from "resource://services-sync/UIState.sys.mjs";

/* SyncedTabsDeckComponent
 * This component instantiates views and storage objects as well as defines
@@ -42,7 +16,7 @@ var EXPORTED_SYMBOLS = ["SyncedTabsDeckComponent"];
 * isolated and easier to test.
 */

function SyncedTabsDeckComponent({
export function SyncedTabsDeckComponent({
  window,
  SyncedTabs,
  deckStore,
+2 −8
Original line number Diff line number Diff line
@@ -2,13 +2,7 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

let { EventEmitter } = ChromeUtils.import(
  "resource:///modules/syncedtabs/EventEmitter.jsm"
);

var EXPORTED_SYMBOLS = ["SyncedTabsDeckStore"];
import { EventEmitter } from "resource:///modules/syncedtabs/EventEmitter.sys.mjs";

/**
 * SyncedTabsDeckStore
@@ -19,7 +13,7 @@ var EXPORTED_SYMBOLS = ["SyncedTabsDeckStore"];
 * will have `isUpdatable` set to true so the view can skip rerendering the whole
 * DOM.
 */
function SyncedTabsDeckStore() {
export function SyncedTabsDeckStore() {
  EventEmitter.call(this);
  this._panels = [];
}
+1 −9
Original line number Diff line number Diff line
@@ -2,14 +2,6 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

let log = ChromeUtils.importESModule(
  "resource://gre/modules/Log.sys.mjs"
).Log.repository.getLogger("Sync.RemoteTabs");

var EXPORTED_SYMBOLS = ["SyncedTabsDeckView"];

/**
 * SyncedTabsDeckView
 *
@@ -18,7 +10,7 @@ var EXPORTED_SYMBOLS = ["SyncedTabsDeckView"];
 * rerender unless the state flags `isUpdatable`, which helps
 * make small changes without the overhead of a full rerender.
 */
const SyncedTabsDeckView = function (window, tabListComponent, props) {
export const SyncedTabsDeckView = function (window, tabListComponent, props) {
  this.props = props;

  this._window = window;
+2 −8
Original line number Diff line number Diff line
@@ -2,13 +2,7 @@
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

"use strict";

let { EventEmitter } = ChromeUtils.import(
  "resource:///modules/syncedtabs/EventEmitter.jsm"
);

var EXPORTED_SYMBOLS = ["SyncedTabsListStore"];
import { EventEmitter } from "resource:///modules/syncedtabs/EventEmitter.sys.mjs";

/**
 * SyncedTabsListStore
@@ -17,7 +11,7 @@ var EXPORTED_SYMBOLS = ["SyncedTabsListStore"];
 * The state includes the clients, their tabs, the row that is currently selected,
 * and the filtered query.
 */
function SyncedTabsListStore(SyncedTabs) {
export function SyncedTabsListStore(SyncedTabs) {
  EventEmitter.call(this);
  this._SyncedTabs = SyncedTabs;
  this.data = [];
Loading