From c2ab9bed3c2ca9f61dc68c8274346b545970ac84 Mon Sep 17 00:00:00 2001 From: afc163 Date: Sat, 21 Mar 2020 14:00:05 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20remove=20SentryBoundary?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 - site/theme/template/Layout/SentryBoundary.jsx | 33 ------------------- 2 files changed, 34 deletions(-) delete mode 100644 site/theme/template/Layout/SentryBoundary.jsx diff --git a/package.json b/package.json index f7778bccf2..e6bb88dc89 100644 --- a/package.json +++ b/package.json @@ -147,7 +147,6 @@ "@ant-design/tools": "^8.0.4", "@packtracker/webpack-plugin": "^2.0.1", "@qixian.cs/github-contributors-list": "^1.0.3", - "@sentry/browser": "^5.4.0", "@stackblitz/sdk": "^1.3.0", "@types/classnames": "^2.2.8", "@types/gtag.js": "^0.0.3", diff --git a/site/theme/template/Layout/SentryBoundary.jsx b/site/theme/template/Layout/SentryBoundary.jsx deleted file mode 100644 index af50e30ebd..0000000000 --- a/site/theme/template/Layout/SentryBoundary.jsx +++ /dev/null @@ -1,33 +0,0 @@ -import React, { Component } from 'react'; -import * as Sentry from '@sentry/browser'; - -// Temp remove sentry since this break the demo: -// https://github.com/ant-design/ant-design/issues/14576 -// Sentry.init({ -// dsn: 'https://41977dd48e5b4da2aa3600ccbe7dda6d@sentry.io/1375756', -// }); - -export default class SentryBoundary extends Component { - state = { error: null }; - - componentDidCatch(error, errorInfo) { - this.setState({ error }); - Sentry.withScope(scope => { - Object.keys(errorInfo).forEach(key => { - scope.setExtra(key, errorInfo[key]); - }); - Sentry.captureException(error); - }); - } - - render() { - const { children } = this.props; - const { error } = this.state; - if (error) { - // render fallback UI - return Sentry.showReportDialog()}>Report feedback; - } - // when there's not an error, render children untouched - return children; - } -}