Bug 1838440 - Migrate kinto-http-client to ES module r=Standard8,robwu

Differential Revision: https://phabricator.services.mozilla.com/D181066
This commit is contained in:
Mathieu Leplatre 2023-06-26 09:03:01 +00:00
parent 69a1947f9f
commit 712ef17f9e
10 changed files with 3073 additions and 2889 deletions

View file

@ -200,7 +200,7 @@ remote/shared/messagehandler/test/browser/resources/modules/root/invalid.sys.mjs
# services/ exclusions
# Third party services
services/common/kinto-http-client.js
services/common/kinto-http-client.sys.mjs
services/common/kinto-offline-client.js
# Webpack-bundled library

View file

@ -1174,10 +1174,6 @@ remote/shared/messagehandler/test/browser/resources/modules/root/invalid.sys.mjs
# services/ exclusions
# Third party services
services/common/kinto-http-client.js
services/common/kinto-offline-client.js
# Webpack-bundled library
services/fxaccounts/FxAccountsPairingChannel.sys.mjs
@ -1405,6 +1401,8 @@ security/manager/tools/log_list.json
security/nss/
security/sandbox/chromium/
security/sandbox/chromium-shim/
services/common/kinto-http-client.sys.mjs
services/common/kinto-offline-client.js
testing/gtest/gmock/
testing/gtest/gtest/
testing/mochitest/MochiKit/

View file

@ -15,6 +15,7 @@ const lazy = {};
ChromeUtils.defineESModuleGetters(lazy, {
Downloader: "resource://services-settings/Attachments.sys.mjs",
ExperimentAPI: "resource://nimbus/ExperimentAPI.sys.mjs",
KintoHttpClient: "resource://services-common/kinto-http-client.sys.mjs",
MacAttribution: "resource:///modules/MacAttribution.sys.mjs",
NimbusFeatures: "resource://nimbus/ExperimentAPI.sys.mjs",
PanelTestProvider: "resource://activity-stream/lib/PanelTestProvider.sys.mjs",
@ -41,7 +42,6 @@ XPCOMUtils.defineLazyModuleGetters(lazy, {
"resource://activity-stream/lib/ASRouterPreferences.jsm",
ASRouterTriggerListeners:
"resource://activity-stream/lib/ASRouterTriggerListeners.jsm",
KintoHttpClient: "resource://services-common/kinto-http-client.js",
});
XPCOMUtils.defineLazyServiceGetters(lazy, {

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -2596,10 +2596,10 @@ var EXPORTED_SYMBOLS = ["Kinto"];
const { XPCOMUtils } = ChromeUtils.importESModule("resource://gre/modules/XPCOMUtils.sys.mjs");
XPCOMUtils.defineLazyGlobalGetters(global, ["fetch", "indexedDB"]);
ChromeUtils.defineESModuleGetters(global, {
EventEmitter: "resource://gre/modules/EventEmitter.sys.mjs"
EventEmitter: "resource://gre/modules/EventEmitter.sys.mjs",
// Use standalone kinto-http module landed in FFx.
KintoHttpClient: "resource://services-common/kinto-http-client.sys.mjs"
});
// Use standalone kinto-http module landed in FFx.
ChromeUtils.defineModuleGetter(global, "KintoHttpClient", "resource://services-common/kinto-http-client.js");
XPCOMUtils.defineLazyGetter(global, "generateUUID", () => {
const { generateUUID } = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator);
return generateUUID;

View file

@ -19,7 +19,7 @@ EXTRA_COMPONENTS += [
EXTRA_JS_MODULES["services-common"] += [
"async.sys.mjs",
"kinto-http-client.js",
"kinto-http-client.sys.mjs",
"kinto-offline-client.js",
"kinto-storage-adapter.sys.mjs",
"logmanager.sys.mjs",

View file

@ -14,6 +14,7 @@ ChromeUtils.defineESModuleGetters(lazy, {
"resource://gre/modules/components-utils/ClientEnvironment.sys.mjs",
Database: "resource://services-settings/Database.sys.mjs",
IDBHelpers: "resource://services-settings/IDBHelpers.sys.mjs",
KintoHttpClient: "resource://services-common/kinto-http-client.sys.mjs",
RemoteSettingsWorker:
"resource://services-settings/RemoteSettingsWorker.sys.mjs",
SharedUtils: "resource://services-settings/SharedUtils.sys.mjs",
@ -22,7 +23,6 @@ ChromeUtils.defineESModuleGetters(lazy, {
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
KintoHttpClient: "resource://services-common/kinto-http-client.js",
ObjectUtils: "resource://gre/modules/ObjectUtils.jsm",
});

View file

@ -42,12 +42,12 @@ ChromeUtils.defineESModuleGetters(lazy, {
CryptoUtils: "resource://services-crypto/utils.sys.mjs",
ExtensionCommon: "resource://gre/modules/ExtensionCommon.sys.mjs",
FirefoxAdapter: "resource://services-common/kinto-storage-adapter.sys.mjs",
KintoHttpClient: "resource://services-common/kinto-http-client.sys.mjs",
Observers: "resource://services-common/observers.sys.mjs",
Utils: "resource://services-sync/util.sys.mjs",
});
XPCOMUtils.defineLazyModuleGetters(lazy, {
KintoHttpClient: "resource://services-common/kinto-http-client.js",
Kinto: "resource://services-common/kinto-offline-client.js",
});

View file

@ -154,6 +154,8 @@ security/manager/tools/log_list.json
security/nss/
security/sandbox/chromium/
security/sandbox/chromium-shim/
services/common/kinto-http-client.sys.mjs
services/common/kinto-offline-client.js
testing/gtest/gmock/
testing/gtest/gtest/
testing/mochitest/MochiKit/