Remove tinymce external dependency

This commit is contained in:
Abhinav Jha 2020-04-17 10:29:43 +05:30
parent 8fc9c68782
commit b5a4e231d7
10 changed files with 28 additions and 34 deletions

View File

@ -1,22 +1,24 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const SentryWebpackPlugin = require('@sentry/webpack-plugin');
const merge = require('webpack-merge');
const common = require('./craco.common.config.js');
const SentryWebpackPlugin = require("@sentry/webpack-plugin");
const merge = require("webpack-merge");
const common = require("./craco.common.config.js");
const env = process.env.REACT_APP_ENVIRONMENT
const env = process.env.REACT_APP_ENVIRONMENT;
const plugins = []
const plugins = [];
if(env === "PRODUCTION" || env === "STAGING") {
plugins.push(new SentryWebpackPlugin({
include: 'build',
ignore: ['node_modules', 'webpack.config.js'],
release: process.env.REACT_APP_SENTRY_RELEASE
}))
if (env === "PRODUCTION" || env === "STAGING") {
plugins.push(
new SentryWebpackPlugin({
include: "build",
ignore: ["node_modules", "webpack.config.js"],
release: process.env.REACT_APP_SENTRY_RELEASE,
}),
);
}
module.exports = merge(common, {
webpack: {
plugins: plugins
plugins: plugins,
},
});

View File

@ -95,7 +95,6 @@
"shallowequal": "^1.1.0",
"styled-components": "^4.1.3",
"tinycolor2": "^1.4.1",
"tinymce": "^5.2.0",
"toposort": "^2.0.2",
"ts-loader": "^6.0.4",
"typescript": "^3.6.3",
@ -165,9 +164,9 @@
"react-test-renderer": "^16.11.0",
"redux-devtools": "^3.5.0",
"redux-devtools-extension": "^2.13.8",
"source-map-explorer": "^2.4.2",
"storybook-addon-designs": "^5.1.1",
"webpack-merge": "^4.2.2",
"source-map-explorer": "^2.4.2"
"webpack-merge": "^4.2.2"
},
"husky": {
"hooks": {

View File

@ -3,7 +3,6 @@
<head>
<script rel="prefetch" type="text/javascript" src="/shims/realms-shim.umd.min.js"></script>
<script rel="prefetch" type="text/javascript" src="/tinymce/tinymce.min.js"></script>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="theme-color" content="#000000" />

View File

@ -196,7 +196,6 @@ class ChartComponent extends React.Component<ChartComponentProps> {
dataFormat: "json",
dataSource: dataSource,
};
console.log("chartConfig", chartConfig);
this.chartInstance = new FusionCharts(chartConfig);
};

View File

@ -1,9 +1,6 @@
import React from "react";
import { Editor } from "@tinymce/tinymce-react";
import styled from "styled-components";
require("tinymce/tinymce");
require("tinymce/themes/silver");
const StyledRTEditor = styled.div`
&& {
width: 100%;
@ -28,6 +25,7 @@ export const RichtextEditorComponent = (
return (
<StyledRTEditor>
<Editor
apiKey="joninoujfadq0q38n0us4tu89d2pawl1jxk4q09vcvxyfqrl"
value={props.defaultValue}
disabled={props.isDisabled}
init={{

View File

@ -28,7 +28,9 @@ import {
} from "constants/routes";
const loadingIndicator = <Loader />;
const App = lazy(() => import("./App"));
const App = lazy(() =>
import(/* webpackChunkName: "appsmith",webpackPrefetch: 10 */ "./App"),
);
const UserAuth = lazy(() =>
import(/* webpackChunkName: "auth",webpackPrefetch: 5 */ "./pages/UserAuth"),
);
@ -41,9 +43,7 @@ const Applications = lazy(() =>
),
);
const PageNotFound = lazy(() =>
import(
/* webpackChunkName: "404",webpackPrefetch: true */ "./pages/common/PageNotFound"
),
import(/* webpackChunkName: "404"*/ "./pages/common/PageNotFound"),
);
const AppViewer = lazy(() =>
import(
@ -51,9 +51,7 @@ const AppViewer = lazy(() =>
),
);
const Organization = lazy(() =>
import(
/* webpackChunkName: "orgs",webpackPrefetch: 1 */ "./pages/organization"
),
import(/* webpackChunkName: "orgs" */ "./pages/organization"),
);
const Users = lazy(() => import(/* webpackPrefetch: true */ "./pages/users"));
appInitializer();

View File

@ -8,7 +8,7 @@ import Skeleton from "components/utils/Skeleton";
const ChartComponent = lazy(() =>
import(
/* webpackPrefetch: true */ "components/designSystems/appsmith/ChartComponent"
/* webpackPrefetch: true, webpackChunkName: "charts" */ "components/designSystems/appsmith/ChartComponent"
),
);

View File

@ -8,7 +8,9 @@ import { TriggerPropertiesMap } from "utils/WidgetFactory";
import Skeleton from "components/utils/Skeleton";
const RichtextEditorComponent = lazy(() =>
import("components/designSystems/appsmith/RichTextEditorComponent"),
import(
/* webpackChunkName: "rte",webpackPrefetch: 2 */ "components/designSystems/appsmith/RichTextEditorComponent"
),
);
class RichTextEditorWidget extends BaseWidget<

View File

@ -17,7 +17,7 @@ import Skeleton from "components/utils/Skeleton";
const TableComponent = lazy(() =>
import(
/* webpackPrefetch: true */ "components/designSystems/syncfusion/TableComponent"
/* webpackPrefetch: true, webpackChunkName: "table" */ "components/designSystems/syncfusion/TableComponent"
),
);

View File

@ -2157,6 +2157,7 @@
"@tinymce/tinymce-react@^3.5.0":
version "3.5.0"
resolved "https://registry.yarnpkg.com/@tinymce/tinymce-react/-/tinymce-react-3.5.0.tgz#5017be56aeab1077f09d3f74a386883e5524a33f"
integrity sha512-sZPerYmSWQcdk7F9KEvCC3/kPNZ9Bb+dk8rS0RoYyYql/gqgNpLpycC+CC/KhgT0wDaYuRoCcdV1DVZGam+oOg==
dependencies:
prop-types "^15.6.2"
@ -13544,10 +13545,6 @@ tinycolor2@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.1.tgz#f4fad333447bc0b07d4dc8e9209d8f39a8ac77e8"
tinymce@^5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-5.2.0.tgz#e838640f61c8a936317bc27a5d2e16c297df3418"
tmp@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.1.0.tgz#ee434a4e22543082e294ba6201dcc6eafefa2877"