Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added sentry support #98

Merged
merged 1 commit into from
Jun 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
REACT_APP_GLIFIC_API="http://localhost:4000/api"
REACT_APP_WEB_SOCKET="ws://localhost:4000/socket"
SENTRY_DSN=""
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@material-ui/styles": "^4.10.0",
"@sentry/browser": "^5.18.1",
"@testing-library/jest-dom": "^5.10.1",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
Expand Down
2 changes: 1 addition & 1 deletion src/config/absinthe.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SOCKET } from './config';
import { SOCKET } from '.';
const AbsintheSocket = require('@absinthe/socket');
const SocketApolloLink = require('@absinthe/socket-apollo-link');
const Socket = require('phoenix');
Expand Down
2 changes: 1 addition & 1 deletion src/config/apolloclient.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApolloClient, InMemoryCache, createHttpLink, split } from '@apollo/client';
import absinthe from './absinthe';
import { URI } from './config';
import { URI } from '.';

const subscribe = require('@jumpn/utils-graphql');

Expand Down
1 change: 1 addition & 0 deletions src/config/config.ts → src/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ const envVariables = process.env;

export const URI = envVariables.REACT_APP_GLIFIC_API;
export const SOCKET = envVariables.REACT_APP_WEB_SOCKET;
export const SENTRY_DSN = envVariables.SENTRY_DSN;
7 changes: 7 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,21 @@ import ReactDOM from 'react-dom';
import { BrowserRouter } from 'react-router-dom';
import { ThemeProvider, CssBaseline } from '@material-ui/core';
import { ApolloProvider } from '@apollo/client';
import * as Sentry from '@sentry/browser';

import theme from './config/theme';
import gqlClient from './config/apolloclient';
import { SENTRY_DSN } from './config/';

import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';

// setup data source for sentry
if (SENTRY_DSN) {
Sentry.init({ dsn: SENTRY_DSN });
}

ReactDOM.render(
<React.StrictMode>
<CssBaseline />
Expand Down