Skip to content

Commit 343b7ae

Browse files
authored
New sentry (codesandbox#1678)
* Update Sentry to latest version * Remove raven * Update yarn.lock * Lazy laod sentry * Increase available memory for build * Correctly set dsn * Give sentry a chunk name * Mark sentry as initialized
1 parent c8e9c0d commit 343b7ae

File tree

13 files changed

+123
-92
lines changed

13 files changed

+123
-92
lines changed

.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"es6": true
99
},
1010
"globals": {
11-
"Raven": true,
1211
"VERSION": true,
1312
"$PropertyType": true,
1413
"TimeoutID": true,

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"private": true,
66
"scripts": {
77
"build": "NODE_OPTIONS=\"--max-old-space-size=4096\" yarn build:deps && yarn build:prod",
8-
"build:prod": "lerna run build --scope homepage --stream && lerna run build --scope app --stream && gulp",
8+
"build:prod": "NODE_OPTIONS=\"--max-old-space-size=4096\" lerna run build --scope homepage --stream && lerna run build --scope app --stream && gulp",
99
"build:embed": "lerna run build:embed --scope app --stream && gulp",
1010
"build:clean": "lerna run build:clean --scope app --scope homepage && rimraf www",
1111
"build:deps": "lerna run build:dev --scope codesandbox-api && lerna run build:dev --scope @codesandbox/common && lerna run build:dev --scope vscode-textmate --scope codesandbox-browserfs --scope node-services && lerna run build:dev --scope sse-hooks",

packages/app/src/app/components/SubscribeForm/CheckoutForm/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { injectStripe, CardElement } from 'react-stripe-elements';
3-
import reportError from 'app/utils/error';
43
import { Button } from '@codesandbox/common/lib/components/Button';
4+
import { logError } from '@codesandbox/common/lib/utils/analytics';
55

66
import { CardContainer, NameInput, ErrorText, Label } from './elements';
77

@@ -52,7 +52,7 @@ class CheckoutForm extends React.PureComponent {
5252
try {
5353
await this.props.subscribe(token.id);
5454
} catch (e) {
55-
reportError(e);
55+
logError(e);
5656

5757
return this.setState({
5858
loading: false,

packages/app/src/app/index.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
<!-- Injected by server: -->
3434
<!-- {{OEMBED TAG}} -->
3535
<title>CodeSandbox</title>
36-
<script src="https://cdn.ravenjs.com/3.21.0/raven.min.js" crossorigin="anonymous"></script>
3736
<link href="/static/fonts/dmvendor.css" rel="stylesheet"></link>
3837
<!-- Google Tag Manager -->
3938
<script>

packages/app/src/app/index.js

Lines changed: 9 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,18 @@ import { ThemeProvider } from 'styled-components';
44
import { Router } from 'react-router-dom';
55
import { ApolloProvider } from 'react-apollo';
66
import { Provider } from 'mobx-react';
7+
import _debug from '@codesandbox/common/lib/utils/debug';
8+
import {
9+
initializeSentry,
10+
logError,
11+
} from '@codesandbox/common/lib/utils/analytics';
12+
import '@codesandbox/common/lib/global.css';
713

814
import history from 'app/utils/history';
9-
import _debug from '@codesandbox/common/lib/utils/debug';
1015
import { client } from 'app/graphql/client';
11-
import VERSION from '@codesandbox/common/lib/version';
1216
import registerServiceWorker from '@codesandbox/common/lib/registerServiceWorker';
1317
import requirePolyfills from '@codesandbox/common/lib/load-dynamic-polyfills';
1418
import 'normalize.css';
15-
import '@codesandbox/common/lib/global.css';
1619
import theme from '@codesandbox/common/lib/theme';
1720
import { isSafari } from '@codesandbox/common/lib/utils/platform';
1821

@@ -22,7 +25,6 @@ import * as child_process from 'node-services/lib/child_process';
2225
import controller from './controller';
2326
import App from './pages/index';
2427
import './split-pane.css';
25-
import logError from './utils/error';
2628
import { getTypeFetcher } from './vscode/extensionHostWorker/common/type-downloader';
2729

2830
import vscode from './vscode';
@@ -49,50 +51,9 @@ window.addEventListener('unhandledrejection', e => {
4951

5052
if (process.env.NODE_ENV === 'production') {
5153
try {
52-
Raven.config('https://[email protected]/155188', {
53-
release: VERSION,
54-
ignoreErrors: [
55-
// Random plugins/extensions
56-
'top.GLOBALS',
57-
// See: http://blog.errorception.com/2012/03/tale-of-unfindable-js-error. html
58-
'originalCreateNotification',
59-
'canvas.contentDocument',
60-
'MyApp_RemoveAllHighlights',
61-
'http://tt.epicplay.com',
62-
"Can't find variable: ZiteReader",
63-
'jigsaw is not defined',
64-
'ComboSearch is not defined',
65-
'http://loading.retry.widdit.com/',
66-
'atomicFindClose',
67-
// Facebook borked
68-
'fb_xd_fragment',
69-
// ISP "optimizing" proxy - `Cache-Control: no-transform` seems to
70-
// reduce this. (thanks @acdha)
71-
// See http://stackoverflow.com/questions/4113268
72-
'bmi_SafeAddOnload',
73-
'EBCallBackMessageReceived',
74-
// See http://toolbar.conduit.com/Developer/HtmlAndGadget/Methods/JSInjection.aspx
75-
'conduitPage',
76-
],
77-
ignoreUrls: [
78-
// Facebook flakiness
79-
/graph\.facebook\.com/i,
80-
// Facebook blocked
81-
/connect\.facebook\.net\/en_US\/all\.js/i,
82-
// Woopra flakiness
83-
/eatdifferent\.com\.woopra-ns\.com/i,
84-
/static\.woopra\.com\/js\/woopra\.js/i,
85-
// Chrome extensions
86-
/extensions\//i,
87-
/^chrome:\/\//i,
88-
// Other plugins
89-
/127\.0\.0\.1:4001\/isrunning/i, // Cacaoweb
90-
/webappstoolbarba\.texthelp\.com\//i,
91-
/metrics\.itunes\.apple\.com\.edgesuite\.net\//i,
92-
// Monaco debuggers
93-
'https://codesandbox.io/public/14/vs/language/typescript/lib/typescriptServices.js',
94-
],
95-
}).install();
54+
initializeSentry(
55+
'https://[email protected]/155188'
56+
);
9657
} catch (error) {
9758
console.error(error);
9859
}

packages/app/src/app/store/providers/Api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
import { logError } from '@codesandbox/common/lib/utils/analytics';
12
import { values } from 'lodash-es';
23

34
import { camelizeKeys, decamelizeKeys } from 'humps';
45
import { Provider } from 'cerebral';
5-
import sendError from 'app/utils/error';
66
import { addNotification } from '../factories';
77

88
const API_ROOT = '/api/v1';
@@ -21,7 +21,7 @@ const getMessage = (error: Error & { response: ?Object }) => {
2121
const response = error.response;
2222

2323
if (!response || response.status >= 500) {
24-
sendError(error);
24+
logError(error);
2525
}
2626

2727
if (response && response.result) {

packages/app/src/app/utils/analytics.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/app/src/app/utils/error.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages/common/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"dependencies": {
1717
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
18+
"@sentry/browser": "^4.6.6",
1819
"@tippy.js/react": "^2.1.1",
1920
"babel-plugin-preval": "^3.0.1",
2021
"codesandbox-api": "^0.0.22",

packages/common/src/components/Tooltip.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ const GlobalStyle = createGlobalStyle`
1919
}
2020
`;
2121

22-
const Tooltip = ({ children, style = {}, ...props }) => (
22+
const Tooltip = ({ children, style = {}, content, ...props }) => (
2323
<React.Fragment>
2424
<GlobalStyle />
25-
<Tippy delay={[500, 0]} {...props}>
25+
<Tippy delay={[500, 0]} content={content} {...props}>
2626
<span
2727
style={{
2828
...style,

0 commit comments

Comments
 (0)