diff --git a/CHANGELOG.md b/CHANGELOG.md index 65a909d52a..aa2878c530 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,45 @@ -# vNext +# 4.0.0 + +Release of Sentry's new SDK for Dart/Flutter. + +New features not offered by <= v4.0.0: + +## Dart SDK + +* Sentry's [Unified API](https://develop.sentry.dev/sdk/unified-api/). +* Complete Sentry's [Protocol](https://develop.sentry.dev/sdk/event-payloads/) available. +* [Dart SDK](https://docs.sentry.io/platforms/dart/) docs. +* Automatic [HTTP Breadcrumbs](https://docs.sentry.io/platforms/dart/usage/advanced-usage/#automatic-breadcrumbs) for [http.Client](https://pub.dev/documentation/http/latest/http/Client-class.html) +* No boilerplate for `runZonedGuarded` and `Isolate.current.addErrorListener` +* All events are enriched with [Scope's Contexts](https://develop.sentry.dev/sdk/event-payloads/#scope-interfaces), this includes Breadcrumbs, tags, User, etc... + +## Flutter SDK + +* The Flutter SDK is built on top of the Dart SDK, so it includes all the available features, plus +* [Flutter SDK](https://docs.sentry.io/platforms/flutter/) docs. +* Automatic [NavigatorObserver Breadcrumbs](https://docs.sentry.io/platforms/flutter/usage/advanced-usage/#automatic-breadcrumbs) +* Automatic [Device's Breadcrumbs](https://docs.sentry.io/platforms/flutter/usage/advanced-usage/#automatic-breadcrumbs) through the Android and iOS SDKs or via Sentry's `WidgetsBindingObserver` wrapper +* No boilerplate for `FlutterError.onError` +* All events are enriched with [Contexts's data](https://develop.sentry.dev/sdk/event-payloads/contexts/), this includes Device's, OS, App info, etc... +* Offline caching +* [Release health](https://docs.sentry.io/product/releases/health/) +* Captures not only Dart and Flutter errors, but also errors caused on the native platforms, Like Kotlin, Java, C and C++ for Android and Swift, ObjC, C, C++ for iOS +* Supports Fatal crashes, Event is going to be sent on App's restart +* Supports `split-debug-info` for Android only +* Flutter Android, iOS and limited support for Flutter Web + +Improvements: * Feat: Added a copyWith method to all the protocol classes +Packages were released on [sentry pubdev](https://pub.dev/packages/sentry) and [sentry_flutter pubdev](https://pub.dev/packages/sentry_flutter) + +## Sentry Self Hosted Compatibility + +* Since version `4.0.0` of the `sentry_flutter`, [Sentry's version >= v20.6.0](https://github.com/getsentry/onpremise/releases) is required. This only applies to on-premise Sentry, if you are using sentry.io no action is needed. + +We'd love to get feedback. + # 4.0.0-beta.2 * Ref: Remove duplicated attachStackTrace field @@ -71,7 +109,7 @@ First Release of Sentry's new SDK for Dart/Flutter. -New features not offered by <= v3.0.0: +New features not offered by <= v4.0.0: * Sentry's [Unified API](https://develop.sentry.dev/sdk/unified-api/). * Complete Sentry [Protocol](https://develop.sentry.dev/sdk/event-payloads/) available. diff --git a/README.md b/README.md index 3a681ced9c..698f3f6c82 100644 --- a/README.md +++ b/README.md @@ -20,88 +20,9 @@ command-line/server Dart VM, and `AngularDart`. Versions below `3.0.1` are deprecated. -###### Preleases (v4.0.0) - -- If you wish to try out our Prelease versions, check out the inner [dart](https://github.com/getsentry/sentry-dart/tree/main/dart) and [flutter](https://github.com/getsentry/sentry-dart/tree/main/flutter) folders. - ##### Usage -Sign up for a Sentry.io account and get a DSN at http://sentry.io. - -Add `sentry` dependency to your `pubspec.yaml`: - -```yaml -dependencies: - sentry: ">=3.0.1 <4.0.0" -``` - -In your Dart code, import `package:sentry/sentry.dart` and create a `SentryClient` using the DSN issued by Sentry.io: - -```dart -import 'package:sentry/sentry.dart'; - -final SentryClient sentry = new SentryClient(dsn: YOUR_DSN); -``` - -In an exception handler, call `captureException()`: - -```dart -main() async { - try { - doSomethingThatMightThrowAnError(); - } catch(error, stackTrace) { - await sentry.captureException( - exception: error, - stackTrace: stackTrace, - ); - } -} -``` - -##### Tips for catching errors - -- Use a `try/catch` block, like in the example above. -- Create a `Zone` with an error handler, e.g. using `runZonedGuarded`. - - ```dart - var sentry = SentryClient(dsn: "https://..."); - // Run the whole app in a zone to capture all uncaught errors. - runZonedGuarded( - () => runApp(MyApp()), - (error, stackTrace) async { - try { - sentry.captureException( - exception: error, - stackTrace: stackTrace, - ); - print('Error sent to sentry.io: $error'); - } catch (e) { - print('Sending report to sentry.io failed: $e'); - print('Original error: $error'); - } - }, - ); - ``` -- For Flutter-specific errors (such as layout failures), use `FlutterError.onError`. For example: - - ```dart - var sentry = SentryClient(dsn: "https://..."); - FlutterError.onError = (details, {bool forceReport = false}) { - try { - sentry.captureException( - exception: details.exception, - stackTrace: details.stack, - ); - } catch (e) { - print('Sending report to sentry.io failed: $e'); - } finally { - // Also use Flutter's pretty error logging to the device's console. - FlutterError.dumpErrorToConsole(details, forceReport: forceReport); - } - }; - ``` -- Use `Isolate.current.addErrorListener` to capture uncaught errors - in the root zone. +For detailed usage, check out the inner [dart](https://github.com/getsentry/sentry-dart/tree/main/dart) and [flutter](https://github.com/getsentry/sentry-dart/tree/main/flutter) `README's` or our `Resources` section below. #### Resources diff --git a/dart/README.md b/dart/README.md index af0bd69495..86c9814174 100644 --- a/dart/README.md +++ b/dart/README.md @@ -19,12 +19,6 @@ Pure Dart SDK used by any Dart application like AngularDart, CLI and server. For Flutter applications there's [`sentry_flutter`](https://pub.dev/packages/sentry_flutter) which builds on top of this package. That will give you native crash support (for Android and iOS), [release health](https://docs.sentry.io/product/releases/health/), offline caching and more. -#### Versions - -Versions `^4.0.0-alpha.1` are `Prereleases` and are under improvements/testing. - -The current stable version is the Dart SDK, [3.0.1](https://pub.dev/packages/sentry). - #### Usage - Sign up for a Sentry.io account and get a DSN at http://sentry.io. diff --git a/dart/lib/src/version.dart b/dart/lib/src/version.dart index 3590f68d2b..f4bdbf4aed 100644 --- a/dart/lib/src/version.dart +++ b/dart/lib/src/version.dart @@ -11,7 +11,7 @@ library version; import 'utils.dart'; /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '4.0.0-beta.3'; +const String sdkVersion = '4.0.0'; String get sdkName => isWeb ? _browserSdkName : _ioSdkName; diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml index dab9d96d83..f77c663299 100644 --- a/dart/pubspec.yaml +++ b/dart/pubspec.yaml @@ -1,5 +1,5 @@ name: sentry -version: 4.0.0-beta.3 +version: 4.0.0 description: > A crash reporting library for Dart that sends crash reports to Sentry.io. This library supports Dart VM and Web. For Flutter consider sentry_flutter instead. diff --git a/flutter/lib/src/version.dart b/flutter/lib/src/version.dart index 611a1d0b3e..c78745eda0 100644 --- a/flutter/lib/src/version.dart +++ b/flutter/lib/src/version.dart @@ -1,5 +1,5 @@ /// The SDK version reported to Sentry.io in the submitted events. -const String sdkVersion = '4.0.0-beta.3'; +const String sdkVersion = '4.0.0'; /// The default SDK name reported to Sentry.io in the submitted events. const String sdkName = 'sentry.dart.flutter'; diff --git a/flutter/pubspec.yaml b/flutter/pubspec.yaml index 9297b3423d..7307ad5c6c 100644 --- a/flutter/pubspec.yaml +++ b/flutter/pubspec.yaml @@ -1,5 +1,5 @@ name: sentry_flutter -version: 4.0.0-beta.3 +version: 4.0.0 description: Sentry SDK for Flutter. This package aims to support different Flutter targets by relying on the many platforms supported by Sentry with native SDKs. homepage: https://docs.sentry.io/platforms/flutter/ repository: https://github.com/getsentry/sentry-dart @@ -13,7 +13,7 @@ dependencies: sdk: flutter flutter_web_plugins: sdk: flutter - sentry: ">=4.0.0-beta.3 <4.1.0" + sentry: ">=4.0.0 <5.0.0" package_info: ^0.4.0 dev_dependencies: