Skip to content

Commit

Permalink
Bump Sentry to 8.0.0 (#267)
Browse files Browse the repository at this point in the history
* bump sentry sdk version

* bump sentry to 8.0.0 & update feedback widget
  • Loading branch information
c298lee authored May 13, 2024
1 parent 3357300 commit cbbcd31
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 104 deletions.
125 changes: 57 additions & 68 deletions src/NuGetTrends.Web/Portal/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions src/NuGetTrends.Web/Portal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"@angular/platform-browser": "^17.1.3",
"@angular/platform-browser-dynamic": "^17.1.3",
"@angular/router": "^17.1.3",
"@sentry/angular": "^8.0.0-alpha.9",
"@sentry-internal/feedback": "^8.0.0-alpha.9",
"@sentry/angular": "^8.0.0",
"@types/chart.js": "2.9.32",
"bulma": "^0.9.4",
"bulma-start": "^0.0.5",
Expand Down
59 changes: 25 additions & 34 deletions src/NuGetTrends.Web/Portal/src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { NgModule, ErrorHandler } from '@angular/core';
import { DatePipe } from '@angular/common';
import { HttpClientModule } from '@angular/common/http';
import { Router } from '@angular/router';
import * as Sentry from '@sentry/angular';
import { feedbackIntegration, feedbackModalIntegration, feedbackScreenshotIntegration } from "@sentry-internal/feedback";
import { BrowserModule } from "@angular/platform-browser";
import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
import { NgModule, ErrorHandler } from "@angular/core";
import { DatePipe } from "@angular/common";
import { HttpClientModule } from "@angular/common/http";
import { Router } from "@angular/router";
import * as Sentry from "@sentry/angular";

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routes.module';
import { environment } from '../environments/environment';
import { PackagesModule } from './packages/packages.module';
import { SharedModule } from './shared/shared.module';
import { HomeModule } from './home/home.module';
import { CoreModule } from './core/core.module';
import { AppComponent } from "./app.component";
import { AppRoutingModule } from "./app-routes.module";
import { environment } from "../environments/environment";
import { PackagesModule } from "./packages/packages.module";
import { SharedModule } from "./shared/shared.module";
import { HomeModule } from "./home/home.module";
import { CoreModule } from "./core/core.module";

if (process.env.NODE_ENV === "development") {
import('@spotlightjs/spotlight').then((Spotlight) =>
import("@spotlightjs/spotlight").then((Spotlight) =>
Spotlight.init({
anchor: 'centerRight',
injectImmediately: true })
anchor: "centerRight",
injectImmediately: true,
})
);
}

Expand All @@ -42,18 +42,12 @@ Sentry.init({
networkResponseHeaders: ["Server"],
}),
Sentry.replayCanvasIntegration(),
feedbackIntegration({
Sentry.feedbackIntegration({
colorScheme: "light", // no dark theme yet
themeLight: {
submitBackground: '#215C84',
submitBackgroundHover: '#A2BACB',
submitBorder: '#153b54',
inputBackground: '#ffffff',
inputForeground: '#374151',
accentBackground: "#215C84",
},
}),
feedbackModalIntegration(),
feedbackScreenshotIntegration(),
Sentry.browserTracingIntegration({
idleTimeout: 30000,
}),
Expand All @@ -62,9 +56,7 @@ Sentry.init({
});

@NgModule({
declarations: [
AppComponent
],
declarations: [AppComponent],
imports: [
Sentry.TraceModule,
AppRoutingModule,
Expand All @@ -74,27 +66,26 @@ Sentry.init({
CoreModule,
SharedModule,
PackagesModule,
HomeModule
HomeModule,
],
providers: [
DatePipe,
{
provide: ErrorHandler,
useValue: Sentry.createErrorHandler({
showDialog: environment.production, // User Feedback enabled in production
logErrors: !environment.production // log console errors in dev mode
logErrors: !environment.production, // log console errors in dev mode
}),
},
{
provide: Sentry.TraceService,
deps: [Router],
},
],
bootstrap: [AppComponent]
bootstrap: [AppComponent],
})
export class AppModule {

// force instantiating Sentry tracing
// https://docs.sentry.io/platforms/javascript/guides/angular/#monitor-performance
constructor(_: Sentry.TraceService) { }
constructor(_: Sentry.TraceService) {}
}

0 comments on commit cbbcd31

Please sign in to comment.