Skip to content

Commit

Permalink
Prepare Samples for Sentry Javascript V8 (#686)
Browse files Browse the repository at this point in the history
* apply break changes to code, update yarn from v6

* port sample v6

* bump v5

* bump v4

* bump v3

* bump vue

* ios test

* expose registerSpanErrorInstrumentation and add changelog/migration guide

* Apply suggestions from code review

Co-authored-by: Krystof Woldrich <[email protected]>

* removed testutils.ts, migration.md, altered changelog with requested changes.  removed setup from integrations. Added check for TextEncoder.

* forgot to add textEncoders.ts

* ordering issue

* add back isolationscope

* requested changes

* yarn
 fix

* requested changes

---------

Co-authored-by: Krystof Woldrich <[email protected]>
  • Loading branch information
lucas-zimerman and krystofwoldrich committed Jul 31, 2024
1 parent a1cfe44 commit d02e0e3
Show file tree
Hide file tree
Showing 31 changed files with 7,102 additions and 5,668 deletions.
6 changes: 4 additions & 2 deletions example/ionic-angular-v3/angular.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"defaultProject": "app",
"newProjectRoot": "projects",
"projects": {
"app": {
Expand Down Expand Up @@ -171,7 +170,10 @@
}
},
"cli": {
"defaultCollection": "@ionic/angular-toolkit"
"schematicCollections": [
"@ionic/angular-toolkit"
],
"analytics": false
},
"schematics": {
"@ionic/angular-toolkit:component": {
Expand Down
12 changes: 0 additions & 12 deletions example/ionic-angular-v3/browserslist

This file was deleted.

24 changes: 12 additions & 12 deletions example/ionic-angular-v3/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"author": "Ionic Framework",
"dependencies": {
"@angular/common": "~13.3.0",
"@angular/core": "~13.3.0",
"@angular/forms": "~13.3.0",
"@angular/platform-browser": "~13.3.0",
"@angular/platform-browser-dynamic": "~13.3.0",
"@angular/router": "~13.3.0",
"@angular/common": "^14.3.0",
"@angular/core": "^14.3.0",
"@angular/forms": "^14.3.0",
"@angular/platform-browser": "^14.3.0",
"@angular/platform-browser-dynamic": "^14.3.0",
"@angular/router": "^14.3.0",
"@capacitor/android": "^3.9.0",
"@capacitor/core": "^3.9.0",
"@capacitor/ios": "^3.9.0",
"@ionic-native/core": "^5.0.0",
"@ionic-native/splash-screen": "^5.0.0",
"@ionic-native/status-bar": "^5.0.0",
"@ionic/angular": "^5.0.0",
"@ionic/angular": "6.7.5",
"@sentry/angular": "8.9.2",
"@sentry/capacitor": "file:.yalc/@sentry/capacitor",
"rxjs": "~6.5.5",
Expand All @@ -22,11 +22,11 @@
},
"description": "An Ionic project",
"devDependencies": {
"@angular-devkit/build-angular": "~13.3.0",
"@angular/cli": "~13.3.0",
"@angular/compiler": "~13.3.0",
"@angular/compiler-cli": "~13.3.0",
"@angular/language-service": "~13.3.0",
"@angular-devkit/build-angular": "^14.2.13",
"@angular/cli": "^14.2.13",
"@angular/compiler": "^14.3.0",
"@angular/compiler-cli": "^14.3.0",
"@angular/language-service": "^14.3.0",
"@capacitor/cli": "^3.9.0",
"@ionic/angular-toolkit": "^2.3.0",
"@ionic/cli": "^6.16.3",
Expand Down
38 changes: 22 additions & 16 deletions example/ionic-angular-v3/src/app/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

import * as Sentry from '@sentry/capacitor';
import { init as sentryAngularInit, createErrorHandler } from '@sentry/angular-ivy';
import { init as sentryAngularInit, createErrorHandler } from '@sentry/angular';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
Expand All @@ -24,7 +24,13 @@ Sentry.init(
// Whether SDK should be enabled or not
enabled: true,
// Use the tracing integration to see traces and add performance monitoring
integrations: [new Sentry.BrowserTracing()],
integrations: [
Sentry.browserTracingIntegration(),
Sentry.replayIntegration({
maskAllText: false,
blockAllMedia: true,
}),
],
// A release identifier
release: '1.0.0',
// A dist identifier
Expand All @@ -39,18 +45,18 @@ Sentry.init(
);

@NgModule({
declarations: [AppComponent],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
/* Provide the @sentry/angular error handler */
{
provide: ErrorHandler,
useValue: createErrorHandler(),
},
],
bootstrap: [AppComponent]
declarations: [AppComponent],
imports: [BrowserModule, IonicModule.forRoot(), AppRoutingModule],
providers: [
StatusBar,
SplashScreen,
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },
/* Provide the @sentry/angular error handler */
{
provide: ErrorHandler,
useValue: createErrorHandler(),
},
],
bootstrap: [AppComponent]
})
export class AppModule {}
export class AppModule { }
16 changes: 6 additions & 10 deletions example/ionic-angular-v3/src/app/tab1/tab1.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { SeverityLevel } from '@sentry/types';
styleUrls: ['tab1.page.scss'],
})
export class Tab1Page {
constructor() {}
constructor() { }

public throwUnhandledException(): void {
// @ts-ignore intentionally calling to demonstrate global error handling
Expand Down Expand Up @@ -126,20 +126,16 @@ export class Tab1Page {
}

public clearUser(): void {
Sentry.configureScope(scope => {
scope.setUser(null);
});
Sentry.setUser(null);
}

public clearBreadcrumbs(): void {
Sentry.configureScope(scope => {
scope.clearBreadcrumbs();
});
Sentry.getGlobalScope().clearBreadcrumbs();
Sentry.getIsolationScope().clearBreadcrumbs();
Sentry.getCurrentScope().clearBreadcrumbs();
}

public clearTestContext(): void {
Sentry.configureScope(scope => {
scope.setContext('TEST-CONTEXT', null);
});
Sentry.setContext('TEST-CONTEXT', null);
}
}
2 changes: 1 addition & 1 deletion example/ionic-angular-v3/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"module": "esnext",
"moduleResolution": "node",
"importHelpers": true,
"target": "es2015",
"target": "es2020",
"lib": [
"es2018",
"dom"
Expand Down
Loading

0 comments on commit d02e0e3

Please sign in to comment.