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

Migration page for Dart and Flutter v7 #6090

Merged
merged 15 commits into from
Jan 20, 2023
Merged
37 changes: 37 additions & 0 deletions src/platforms/dart/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@ sidebar_order: 1000
description: "Migrate between versions of Sentry's SDK for Dart."
---

## Migrating From `sentry` `6.18.x` to `sentry` `7.0.0`

API changes:

- Sentry's Dart SDK version 7.0.0 and above requires Dart `2.17.0`.
- Methods that used to take a `dynamic hint` optional parameter now takes `Hint? hint` instead.
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
- Remove deprecated fields from the `SentryDevice` class.
- `screenResolution`, using the `screenHeightPixels` and `screenWidthPixels` instead.
- `timezone`, using the `SentryCulture#timezone` instead.
- `language`, using the `SentryCulture#locale` instead.
- `theme`, using the `SentryOperatingSystem#theme` instead.
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
- Remove deprecated field from the `Contexts#dart_context` databag.
- `isolate`, using the `SentryThread#name` instead.
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
- `SentryMeasurementUnit` has been redesigned to be strongly typed.
- `DurationSentryMeasurementUnit`
- `InformationSentryMeasurementUnit`
- `FractionSentryMeasurementUnit`
- `CustomSentryMeasurementUnit`
- `NoneSentryMeasurementUnit`
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
- Remove deprecated fields from the `Scope` class.
- `user(SentryUser? user)`, using the `setUser(SentryUser? user)` instead.
- `attachements`, using the `attachments` instead.
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
- Classes or methods that used to take the bellow optional parameters were moved to the `SentryOptions` class.
- `captureFailedRequests`, using `SentryOptions#captureFailedRequests` instead.
- `sendDefaultPii`, using `SentryOptions#sendDefaultPii` instead.
- `maxRequestBodySize`, using `SentryOptions#maxRequestBodySize` instead.
- `networkTracing`, using `SentryOptions#tracesSampleRate` or `SentryOptions#tracesSampler` instead.
- `recordBreadcrumbs`, using `SentryOptions#recordHttpBreadcrumbs` instead.
marandaneto marked this conversation as resolved.
Show resolved Hide resolved

Behavior changes:

- Sentry's Dart SDK version 7.0.0 and above supports Dart `3.0.0`.
- When an unhandled error happens and there's a running transaction, the transaction status will be set to `internal_error`.
- The `captureFailedRequests` feature is now enabled by default.
- The `enableStructuredDataTracing` feature is now enabled by default.
- The `enableUserInteractionTracing` feature is now enabled by default.

## Migrating From `sentry` `6.5.x` to `sentry` `6.6.x`

- `SentryOptions#sendClientReports` is now enabled by default. To disable it, use the code snippet below:
Expand Down
14 changes: 14 additions & 0 deletions src/platforms/flutter/migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,20 @@ title: Migration Guide
sidebar_order: 1000
---

## Migrating From `sentry_flutter` `6.18.x` to `sentry` `7.0.0`

In addition to the changes introduced in [sentry](/platforms/dart/migration/):

API changes:

- Sentry's Flutter SDK version 7.0.0 and above requires Flutter `3.0.0`.
- The Sentry Cocoa SDK was upgraded to `8.0.0` which introduces breaking changes, see the [migration guide](/platforms/apple/migration/#migrating-from-7x-to-8x).
- `enableAutoPerformanceTracking` was renamed to `enableAutoPerformanceTracing`.
- `enableOutOfMemoryTracking` was renamed to `enableWatchdogTerminationTracking`.
- Remove deprecated field from the `SentryFlutterOptions` class.
- `anrTimeoutIntervalMillis`, using the `anrTimeoutInterval` instead.
- `autoSessionTrackingIntervalMillis`, using the `autoSessionTrackingInterval` instead.

## Migrating From `sentry_flutter` `6.12.x` to `sentry` `6.13.x`

The SDK already runs your init `callback` on an error handler, such as [`runZonedGuarded`](https://api.flutter.dev/flutter/dart-async/runZonedGuarded.html) on Flutter versions prior to `3.3`, or [`PlatformDispatcher.onError`](https://api.flutter.dev/flutter/dart-ui/PlatformDispatcher/onError.html) on Flutter versions 3.3 and higher, so that errors are automatically captured. No code changes are needed on your part.
Expand Down