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 take `Hint? hint` instead.
- The following deprecated fields have been removed from the `SentryDevice` class and replaced:
- `screenResolution` replaced with `screenHeightPixels` and `screenWidthPixels`.
- `timezone` replaced with `SentryCulture#timezone`.
- `language` replaced with `SentryCulture#locale`.
- `theme` replaced with `SentryOperatingSystem#theme`.
- The following deprecated field has been removed from the `Contexts#dart_context` databag and replaced:
- `isolate` replaced with `SentryThread#name`.
- The following fields have been removed from the `Scope` class and replaced:
- `user(SentryUser? user)` replaced with `setUser(SentryUser? user)`.
- `attachements` replaced with `attachments`.
- Classes or methods that used to take the bellow optional parameters, have been moved to the `SentryOptions` class:
- `captureFailedRequests` replaced with `SentryOptions#captureFailedRequests` instead.
- `sendDefaultPii` replaced with `SentryOptions#sendDefaultPii` instead.
- `maxRequestBodySize` replaced with `SentryOptions#maxRequestBodySize` instead.
- `networkTracing` replaced with `SentryOptions#tracesSampleRate` or `SentryOptions#tracesSampler` instead.
- `recordBreadcrumbs` replaced with `SentryOptions#recordHttpBreadcrumbs` instead.
marandaneto marked this conversation as resolved.
Show resolved Hide resolved
- The following`SentryMeasurementUnit`s are now strongly typed:
- `DurationSentryMeasurementUnit`
- `InformationSentryMeasurementUnit`
- `FractionSentryMeasurementUnit`
- `CustomSentryMeasurementUnit`
- `NoneSentryMeasurementUnit`
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).
- The following fields have been removed from the `SentryFlutterOptions` class and replaced:
- `enableAutoPerformanceTracking` replaced with `enableAutoPerformanceTracing`.
- `enableOutOfMemoryTracking` replaced with `enableWatchdogTerminationTracking`.
- `anrTimeoutIntervalMillis` replaced with `anrTimeoutInterval` instead.
- `autoSessionTrackingIntervalMillis` replaced with `autoSessionTrackingInterval` instead.
marandaneto marked this conversation as resolved.
Show resolved Hide resolved

## 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