From a1f003b03c9b3e534a5998a82db1955ea878afe2 Mon Sep 17 00:00:00 2001 From: Henning Dieterichs Date: Sat, 21 Mar 2020 15:33:47 +0100 Subject: [PATCH] Removes webview playground. --- webview/src/playground.tsx | 35 ------------------ webview/src/playground/index.tsx | 62 -------------------------------- webview/webpack.config.ts | 19 ++++------ 3 files changed, 6 insertions(+), 110 deletions(-) delete mode 100644 webview/src/playground.tsx delete mode 100644 webview/src/playground/index.tsx diff --git a/webview/src/playground.tsx b/webview/src/playground.tsx deleted file mode 100644 index f6a465e..0000000 --- a/webview/src/playground.tsx +++ /dev/null @@ -1,35 +0,0 @@ -import * as React from "react"; -import * as ReactDOM from "react-dom"; -import "./style.scss"; -import * as Components from "./playground/index"; - -const url = new URL(window.location.href); - -const theme = url.searchParams.get("theme"); -if (theme && theme === "dark") { - require("./vscode-dark.scss"); -} else { - require("./vscode-light.scss"); -} - -function render(target: HTMLDivElement) { - const c = require("./playground/index") as typeof Components; - ReactDOM.render(, target); -} - -const target = document.createElement("div"); -target.className = "target"; -document.body.appendChild(target); - -render(target); - -declare var module: { - hot?: { accept: (componentName: string, callback: () => void) => void }; -}; -declare var require: (name: string) => any; - -if (module.hot) { - module.hot.accept("./playground/index", () => { - render(target); - }); -} diff --git a/webview/src/playground/index.tsx b/webview/src/playground/index.tsx deleted file mode 100644 index 84da608..0000000 --- a/webview/src/playground/index.tsx +++ /dev/null @@ -1,62 +0,0 @@ -import * as React from "react"; -import "../style.scss"; -import { DecoratedGridComponent } from "@hediet/visualization"; -import { observable } from "mobx"; -import { observer } from "mobx-react"; - -@observer -export class Playground extends React.Component { - @observable - private phase = 0; - - componentDidMount() { - setInterval(() => { - this.phase++; - }, 2000); - } - - render() { - return ( -
-
- -
-
- ); - } -} diff --git a/webview/webpack.config.ts b/webview/webpack.config.ts index dbf580e..7295a83 100644 --- a/webview/webpack.config.ts +++ b/webview/webpack.config.ts @@ -7,12 +7,8 @@ import { CleanWebpackPlugin } from "clean-webpack-plugin"; const r = (file: string) => path.resolve(__dirname, file); -const mode = process.argv.some(v => v === "--playground") - ? "playground" - : "default"; - module.exports = { - entry: [mode === "default" ? r("src/index.tsx") : r("src/playground.tsx")], + entry: [r("src/index.tsx")], output: { path: r("dist"), filename: "[name].js", @@ -47,15 +43,12 @@ module.exports = { }), new ForkTsCheckerWebpackPlugin(), new CleanWebpackPlugin(), + new MonacoWebpackPlugin({ + // Add more languages here once webworker issues are solved. + languages: ["typescript"], + }), ]; - if (mode === "default") { - plugins.push( - new MonacoWebpackPlugin({ - // Add more languages here once webworker issues are solved. - languages: ["typescript"], - }) - ); - } + return plugins; })(), } as webpack.Configuration;