Skip to content

Release: Update READMEs for v4 GA #239

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

Merged
merged 5 commits into from
Dec 10, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
40 changes: 39 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,45 @@
# vNext
# 4.0.0

Release of Sentry's new SDK for Dart/Flutter.

New features not offered by <= v3.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` version >= `v20.6.0` 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
Expand Down
81 changes: 1 addition & 80 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 0 additions & 6 deletions dart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion dart/lib/src/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion dart/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion flutter/lib/src/version.dart
Original file line number Diff line number Diff line change
@@ -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';
4 changes: 2 additions & 2 deletions flutter/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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 <4.1.0"
package_info: ^0.4.0

dev_dependencies:
Expand Down