diff --git a/bin/copy-assets.js b/bin/copy-assets.js index 513d68b9ee..4aea5c228e 100644 --- a/bin/copy-assets.js +++ b/bin/copy-assets.js @@ -126,13 +126,6 @@ function copySVGs({ projectPath, mcPath }) { const mozBuildSourcePath = path.join(mcPath, "devtools/client/debugger/new/images/sources/moz.build"); fs.writeFileSync(mozBuildSourcePath, mozBuildSourceText, "utf-8"); - - console.log("[copy-assets] - Svg.js"); - copyFile( - path.join(projectPath, "/images/Svg.js"), - path.join(mcPath, "devtools/client/debugger/new/images/Svg.js"), - { cwd: projectPath } - ); } function copyTests({ mcPath, projectPath, mcModulePath, shouldSymLink }) { diff --git a/images/BreakpointSvg.js b/images/BreakpointSvg.js deleted file mode 100644 index adba0a048f..0000000000 --- a/images/BreakpointSvg.js +++ /dev/null @@ -1,21 +0,0 @@ -/* 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 . */ - -import React from "react"; - -const BREAKPOINT_SVG = - ''; -const COLUMN_MARKER_SVG = - ''; - -type Props = { - column: boolean -}; - -export default function BreakpointSvg({ column }: Props) { - const svg = column ? COLUMN_MARKER_SVG : BREAKPOINT_SVG; - - /* eslint-disable react/no-danger */ - return ; -} diff --git a/src/components/Editor/Breakpoint.js b/src/components/Editor/Breakpoint.js index 43bc1118fe..88a423065f 100644 --- a/src/components/Editor/Breakpoint.js +++ b/src/components/Editor/Breakpoint.js @@ -4,10 +4,8 @@ // @flow -import React, { PureComponent } from "react"; -import ReactDOM from "react-dom"; +import { PureComponent } from "react"; import classnames from "classnames"; -import BreakpointSvg from "../shared/BreakpointSvg"; import { getDocument, toEditorLine } from "../../utils/editor"; import { getSelectedLocation } from "../../utils/source-maps"; @@ -20,7 +18,8 @@ import type { EditorItemActions } from "./menus/editor"; import type { Source, Breakpoint as BreakpointType } from "../../types"; const breakpointSvg = document.createElement("div"); -ReactDOM.render(, breakpointSvg); +breakpointSvg.innerHTML = + ''; type Props = { breakpoint: BreakpointType, diff --git a/src/components/Editor/ColumnBreakpoint.js b/src/components/Editor/ColumnBreakpoint.js index 6f7227a0a5..ce709a5a60 100644 --- a/src/components/Editor/ColumnBreakpoint.js +++ b/src/components/Editor/ColumnBreakpoint.js @@ -3,12 +3,11 @@ * file, You can obtain one at . */ // @flow -import React, { PureComponent } from "react"; -import ReactDOM from "react-dom"; +import { PureComponent } from "react"; import classnames from "classnames"; -import { getDocument } from "../../utils/editor"; -import BreakpointSvg from "../shared/BreakpointSvg"; import { showMenu } from "devtools-contextmenu"; + +import { getDocument } from "../../utils/editor"; import { breakpointItems, createBreakpointItems } from "./menus/breakpoints"; // eslint-disable-next-line max-len @@ -27,11 +26,12 @@ type Props = { breakpointActions: BreakpointItemActions }; -const breakpointImg = document.createElement("button"); -ReactDOM.render(, breakpointImg); +const breakpointButton = document.createElement("button"); +breakpointButton.innerHTML = + ''; function makeBookmark({ breakpoint }, { onClick, onContextMenu }) { - const bp = breakpointImg.cloneNode(true); + const bp = breakpointButton.cloneNode(true); const isActive = breakpoint && !breakpoint.disabled; const isDisabled = breakpoint && breakpoint.disabled; diff --git a/src/components/shared/BreakpointSvg.js b/src/components/shared/BreakpointSvg.js deleted file mode 100644 index 20f4e00127..0000000000 --- a/src/components/shared/BreakpointSvg.js +++ /dev/null @@ -1,12 +0,0 @@ -/* 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 . */ - -// @flow -/** - * This file maps the SVG React Components in the images directory. - */ - -import BreakpointSvg from "../../../images/BreakpointSvg"; - -export default BreakpointSvg; diff --git a/src/vendors.js b/src/vendors.js index 8ee422b77f..50c1465c37 100644 --- a/src/vendors.js +++ b/src/vendors.js @@ -33,7 +33,6 @@ import * as reselect from "reselect"; import classnames from "classnames"; import devtoolsSplitter from "devtools-splitter"; import move from "lodash-move"; -import BreakpointSvg from "./components/shared/BreakpointSvg"; // We cannot directly export literals containing special characters // (eg. "my-module/Test") which is why they are nested in "vendored". @@ -52,8 +51,5 @@ export const vendored = { "lodash-move": move, "react-aria-components/src/tabs": reactAriaComponentsTabs, "react-transition-group/Transition": transition, - reselect, - // Svg is required via relative paths, so the key is not imported path. - // See .babel/transform-mc.js - BreakpointSvg + reselect };