Bug 1668117 - [devtools] do not load PluralForm from devtools-modules in debugger r=nchevobbe
authorJulian Descottes <jdescottes@mozilla.com>
Fri, 02 Oct 2020 15:38:19 +0000
changeset 551355 18a203ae7737208a22eddac90f8825e303c0d57d
parent 551354 040c0c95a70f8feb7f2fb2175f585718215f6f39
child 551356 6f00b5773bb4c636f9bbbdc6e1186f636363ee61
push id127820
push userjdescottes@mozilla.com
push dateFri, 02 Oct 2020 22:08:32 +0000
treeherderautoland@ba4685a82eea [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnchevobbe
bugs1668117
milestone83.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1668117 - [devtools] do not load PluralForm from devtools-modules in debugger r=nchevobbe Depends on D91852 Differential Revision: https://phabricator.services.mozilla.com/D91853
devtools/client/debugger/jest-test.config.js
devtools/client/debugger/src/components/Editor/SearchBar.js
devtools/client/debugger/src/components/ProjectSearch.js
devtools/client/debugger/src/test/fixtures/plural-form.js
--- a/devtools/client/debugger/jest-test.config.js
+++ b/devtools/client/debugger/jest-test.config.js
@@ -38,12 +38,13 @@ module.exports = {
     "enzyme-to-json/serializer",
   ],
   moduleNameMapper: {
     "\\.css$": "<rootDir>/src/test/__mocks__/styleMock.js",
     "\\.svg$": "<rootDir>/src/test/__mocks__/svgMock.js",
     "^Services": "<rootDir>/src/test/fixtures/Services",
     "^chrome": "<rootDir>/src/test/fixtures/Chrome",
     "^ChromeUtils": "<rootDir>/src/test/fixtures/ChromeUtils",
+    "\\/plural-form$": "<rootDir>/src/test/fixtures/plural-form",
     // Map all require("devtools/...") to the real devtools root.
     "^devtools\\/(.*)": "<rootDir>/../../$1",
   },
 };
--- a/devtools/client/debugger/src/components/Editor/SearchBar.js
+++ b/devtools/client/debugger/src/components/Editor/SearchBar.js
@@ -26,17 +26,19 @@ import { scrollList } from "../../utils/
 import classnames from "classnames";
 
 import type { Source, Context } from "../../types";
 import type { Modifiers, SearchResults } from "../../reducers/file-search";
 
 import SearchInput from "../shared/SearchInput";
 import { debounce } from "lodash";
 import "./SearchBar.css";
-import { PluralForm } from "devtools-modules";
+
+// $FlowIgnore
+const { PluralForm } = require("devtools/shared/plural-form");
 
 import type SourceEditor from "../../utils/editor/source-editor";
 
 function getShortcuts() {
   const searchAgainKey = L10N.getStr("sourceSearch.search.again.key3");
   const searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key3");
   const searchKey = L10N.getStr("sourceSearch.search.key2");
 
--- a/devtools/client/debugger/src/components/ProjectSearch.js
+++ b/devtools/client/debugger/src/components/ProjectSearch.js
@@ -26,17 +26,19 @@ import {
 import ManagedTree from "./shared/ManagedTree";
 import SearchInput from "./shared/SearchInput";
 import AccessibleImage from "./shared/AccessibleImage";
 
 import type { List } from "immutable";
 import type { ActiveSearchType } from "../reducers/types";
 import type { StatusType } from "../reducers/project-text-search";
 import type { Context, SourceId } from "../types";
-import { PluralForm } from "devtools-modules";
+
+// $FlowIgnore
+const { PluralForm } = require("devtools/shared/plural-form");
 
 import "./ProjectSearch.css";
 
 export type Match = {
   type: "MATCH",
   sourceId: SourceId,
   line: number,
   column: number,
new file mode 100644
--- /dev/null
+++ b/devtools/client/debugger/src/test/fixtures/plural-form.js
@@ -0,0 +1,11 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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";
+
+module.exports.PluralForm = {
+  get(num, str) {
+    return str.split(";")[1];
+  },
+};