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

Migrate to Sentry JavaScript V8 #675

Merged
merged 26 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2c7cf36
migrate V8 initial commit
lucas-zimerman Jun 17, 2024
ad81a4a
add polyfill, changed integrations structure
lucas-zimerman Jun 19, 2024
8fb8140
format prettier and update prettier
lucas-zimerman Jun 20, 2024
27f8e6a
remove enable out of memory and update packages
lucas-zimerman Jun 21, 2024
ed0823e
update jest, replace scope with scopeSync
lucas-zimerman Jul 1, 2024
e986e2c
fix deprecated expect tests
lucas-zimerman Jul 1, 2024
743c4d2
fix test build rule
lucas-zimerman Jul 1, 2024
41df7db
fix default integrations init. Fix SDK tests
lucas-zimerman Jul 1, 2024
669cff8
fix sdkinfo tests
lucas-zimerman Jul 1, 2024
9841962
fix release tests
lucas-zimerman Jul 2, 2024
6ee9981
fix native options, rewrite frames and webview tests
lucas-zimerman Jul 2, 2024
2903ee4
lint
lucas-zimerman Jul 2, 2024
cc803b7
isolate race condition
lucas-zimerman Jul 2, 2024
d71ec83
nit build errors
lucas-zimerman Jul 2, 2024
6d07c22
expose registerSpanErrorInstrumentation and add changelog/migration g…
lucas-zimerman Jul 4, 2024
29c369d
Apply suggestions from code review
lucas-zimerman Jul 8, 2024
638eede
removed testutils.ts, migration.md, altered changelog with requested …
lucas-zimerman Jul 8, 2024
274fb18
forgot to add textEncoders.ts
lucas-zimerman Jul 8, 2024
375cbcb
ordering issue
lucas-zimerman Jul 8, 2024
760dbcb
add back isolationscope
lucas-zimerman Jul 10, 2024
96e618b
requested changes
lucas-zimerman Jul 15, 2024
6070e88
add missing get scope
lucas-zimerman Jul 15, 2024
a1cfe44
yarn fix
lucas-zimerman Jul 15, 2024
d02e0e3
Prepare Samples for Sentry Javascript V8 (#686)
lucas-zimerman Jul 31, 2024
322d811
requested changes
lucas-zimerman Jul 31, 2024
63134ab
test download artifact v4
lucas-zimerman Jul 31, 2024
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
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/unbound-method': 'off',
},
},
{
Expand All @@ -48,6 +49,5 @@ module.exports = {
'@sentry-internal/sdk/no-optional-chaining': 'off',
'@sentry-internal/sdk/no-nullish-coalescing': 'off',
'@sentry-internal/sdk/no-class-field-initializers': 'off',
'deprecation/deprecation': 'off',
},
};
2 changes: 1 addition & 1 deletion .github/workflows/buildandtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
run: yarn global add @ionic/cli

- name: Download Sentry Capacitor package
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: yalc-package
path: ~/.yalc # Ensure this path matches where yalc expects to find the package
Expand Down
32 changes: 32 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,34 @@

## Unreleased


### How to Upgrade to Version 1:

- Angular minimum supported version changed to version 14, upgrade to Angular 14 or higher for using the latest SDK.

- When using the package `@sentry/angular-ivy`, you will need to replace it by `@sentry/angular`.

- enableOutOfMemoryTracking was removed and replaced by enableWatchdogTerminationTracking.

- We recommend reading the
[migration guide docs](https://docs.sentry.io/platforms/javascript/migration/v7-to-v8/#migration-codemod) to find out
how to address any breaking changes in your code for your specific platform or framework.

To automate upgrading to v8 as much as possible, use our migration codemod `@sentry/migr8`:

```sh
npx @sentry/migr8@latest
```

All deprecations from the v7 cycle, with the exception of `getCurrentHub()`, have been removed and can no longer be used
in v8. If you have an advanced Sentry SDK setup, we additionally recommend reading the
[in-depth migration guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#upgrading-from-7x-to-8x) in our repo which highlights all changes with additional details and
information.
lucas-zimerman marked this conversation as resolved.
Show resolved Hide resolved


### Features

- Support for Angular 18 ([#675](https://github.com/getsentry/sentry-capacitor/pull/675))
- Add close function on `@sentry/capacitor` ([#664](https://github.com/getsentry/sentry-capacitor/pull/664))
- Expose `getClient` on `@sentry/capacitor` ([#664](https://github.com/getsentry/sentry-capacitor/pull/664))
- Add the following functions to `@sentry/capacitor` ([#666](https://github.com/getsentry/sentry-capacitor/pull/666))
Expand All @@ -13,6 +39,12 @@

- Accept undefined as value for tags ([#656](https://github.com/getsentry/sentry-capacitor/pull/656))

### Dependencies

- Bump JavaScript SDK from v7.114.0 to v8.9.2 ([#675](https://github.com/getsentry/sentry-capacitor/pull/675))
- [changelog](https://github.com/getsentry/sentry-javascript/blob/8.9.2/CHANGELOG.md)
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.114.0...8.9.2)

## 0.18.0

### Features
Expand Down
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.

26 changes: 13 additions & 13 deletions example/ionic-angular-v3/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
{
"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",
"@sentry/angular-ivy": "7.114.0",
"@ionic/angular": "6.7.5",
"@sentry/angular": "8.9.2",
"@sentry/capacitor": "file:.yalc/@sentry/capacitor",
"rxjs": "~6.5.5",
"tslib": "^2.0.0",
"zone.js": "~0.11.4"
},
"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
Loading