-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
restructure dart docs #4701
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
restructure dart docs #4701
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f1bad62
updated dart getting started primer
imatwawana a5d43d0
moved content from advanced usage, deleted dart index page, updated w…
imatwawana 85bb9fe
fixed broken link
imatwawana b423730
added integrations page, updated getting started primer and basic opt…
imatwawana b9467c4
changed file name to try to fix broken structure
imatwawana 6cbb6ef
fixed folder structure and added page description for http integratio…
imatwawana af93f54
updated features list, fixed integration index page, added missing de…
imatwawana aceafe7
Apply suggestions from code review
imatwawana File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,10 +1,4 @@ | ||
| <PlatformContent includePath="capture-error/dart.mdx" /> | ||
|
|
||
| ## Tips for Catching Errors | ||
|
|
||
| - Use a `try/catch` block | ||
| - Use a `catchError` block for `Futures` | ||
| - The SDK already runs your init `callback` on an error handler, such as using `runZonedGuarded`, are captured automatically | ||
| - Flutter-specific errors, such as using `FlutterError.onError`, are captured automatically | ||
| - `Isolate` errors on the `current` Isolate which is the equivalent of a main/UI thread, such as using `Isolate.current.addErrorListener`, are captured automatically (only for non-Web Apps). | ||
| - For your own `Isolates`, add an `ErrorListener` and call `Sentry.captureException` | ||
| - The SDK already runs your init `callback` on an error handler, such as using `runZonedGuarded`, are captured automatically | ||
42 changes: 42 additions & 0 deletions
42
src/includes/enriching-events/breadcrumbs/automatic-breadcrumbs/dart.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| To track automatic [Breadcrumbs for HTTP requests](https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/#breadcrumb-types), you can add a Sentry wrapper that does it automatically for you. | ||
|
|
||
| This is only possible if you are using the [http.Client](https://pub.dev/documentation/http/latest/http/Client-class.html) class from the [http](https://pub.dev/packages/http) library. | ||
|
|
||
| The `SentryHttpClient` can be used as a standalone client like this: | ||
|
|
||
| ```dart | ||
| import 'package:http/http.dart' as http; | ||
| import 'package:sentry/sentry.dart'; | ||
|
|
||
| final client = SentryHttpClient(); | ||
| try { | ||
| final url = 'https://example.com/whatsit/create'; | ||
| final response = await client.post(url, body: { | ||
| 'name': 'doodle', | ||
| 'color': 'blue', | ||
| }); | ||
| print('Response body: ${response.body}'); | ||
| } finally { | ||
| client.close(); | ||
| } | ||
| ``` | ||
|
|
||
| The `SentryHttpClient` can also be used as a wrapper for your own `HTTP Client`: | ||
|
|
||
| ```dart | ||
| import 'package:http/http.dart' as http; | ||
| import 'package:sentry/sentry.dart'; | ||
|
|
||
| final myClient = http.Client(); | ||
| final client = SentryHttpClient(client: myClient); | ||
| try { | ||
| final url = 'https://example.com/whatsit/create'; | ||
| final response = await client.post(url, body: { | ||
| 'name': 'doodle', | ||
| 'color': 'blue', | ||
| }); | ||
| print('Response body: ${response.body}'); | ||
| } finally { | ||
| client.close(); | ||
| } | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,15 @@ | ||
| <Note> | ||
|
|
||
| Pure Dart SDK used by any Dart application like AngularDart, CLI and Server, it enables reporting messages and errors. | ||
| Sentry's Dart SDK enables automatic reporting of errors, messages, and exceptions. The SDK is available on GitHub [`sentry-dart`](https://github.com/getsentry/sentry-dart/). For Flutter apps, refer to [our Flutter documentation](/platforms/flutter) instead. | ||
|
|
||
| </Note> | ||
|
|
||
| **Features:** | ||
|
|
||
| - Breadcrumbs automatically captured: | ||
| - by the [Dart SDK](/platforms/dart/enriching-events/breadcrumbs/#automatic-breadcrumbs) | ||
| - as well as `http` with the [Dart SDK](/platforms/dart/) | ||
| - [Attachments](/platforms/dart/enriching-events/attachments/) enrich your event by storing additional files, such as config or log files. | ||
| - [User Feedback](/platforms/dart/enriching-events/user-feedback/) provides the ability to collect user information when an event occurs. | ||
| - [Performance Monitoring](/product/performance/) creates transactions for: | ||
| - [HTTP requests](/platforms/dart/configuration/integrations/http-integration/#performance-monitoring-for-http-requests) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| title: Integrations | ||
| sidebar_order: 10 | ||
| description: "Learn more about how integrations extend the functionality of our SDK to cover common libraries and environments automatically." | ||
| --- | ||
|
|
||
| <PageGrid /> |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,37 +1,38 @@ | ||
| --- | ||
| title: Migration Guide | ||
| sidebar_order: 1000 | ||
| description: "Migrate between versions of Sentry's SDK for Dart." | ||
| --- | ||
|
|
||
| ## Migrating From `sentry` `5.1.x` to `sentry` `6.0.0` | ||
|
|
||
| * `Sentry.currentHub` was removed. Please use the static methods on `Sentry` | ||
| * `SentryOptions.cacheDirSize` was renamed to `SentryOptions.maxCacheItems` | ||
| * `EventProcessor` was changed from a callback to an interface | ||
| * The data type from the following options was changed from `int` to `Duration`. The old options are still present but deprecated and will be removed in a future version. | ||
| * `SentryOptions.autoSessionTrackingIntervalMillis` to `SentryOptions.autoSessionTrackingInterval` | ||
| * `SentryOptions.anrTimeoutIntervalMillis` to `SentryOptions.anrTimeoutInterval` | ||
| * The `beforeSend` callback now accepts async code. The method signature changed from `SentryEvent? Function(SentryEvent event, {dynamic hint});` to `FutureOr<SentryEvent?> Function(SentryEvent event, {dynamic hint});`. While this is technically a breaking change, your code probably is still valid. | ||
| * Sentry accepts multiple exceptions and multiple threads. If you haven't set exceptions, there's no need to do anything. | ||
| - `Sentry.currentHub` was removed. Please use the static methods on `Sentry` | ||
| - `SentryOptions.cacheDirSize` was renamed to `SentryOptions.maxCacheItems` | ||
| - `EventProcessor` was changed from a callback to an interface | ||
| - The data type from the following options was changed from `int` to `Duration`. The old options are still present but deprecated and will be removed in a future version. | ||
| - `SentryOptions.autoSessionTrackingIntervalMillis` to `SentryOptions.autoSessionTrackingInterval` | ||
| - `SentryOptions.anrTimeoutIntervalMillis` to `SentryOptions.anrTimeoutInterval` | ||
| - The `beforeSend` callback now accepts async code. The method signature changed from `SentryEvent? Function(SentryEvent event, {dynamic hint});` to `FutureOr<SentryEvent?> Function(SentryEvent event, {dynamic hint});`. While this is technically a breaking change, your code probably is still valid. | ||
| - Sentry accepts multiple exceptions and multiple threads. If you haven't set exceptions, there's no need to do anything. | ||
|
|
||
| ### Sentry Self-hosted Compatibility | ||
|
|
||
| * Starting with version `6.0.0` of the `sentry`, [Sentry's version >= v20.6.0](https://github.com/getsentry/self-hosted/releases) is required. This only applies to self-hosted Sentry. If you are using [sentry.io](https://sentry.io), no action is needed. | ||
| - Starting with version `6.0.0` of the `sentry`, [Sentry's version >= v20.6.0](https://github.com/getsentry/self-hosted/releases) is required. This only applies to self-hosted Sentry. If you are using [sentry.io](https://sentry.io), no action is needed. | ||
|
|
||
| ## Migrating From `sentry` `4.0.x` to `sentry` `5.0.0` | ||
|
|
||
| * Sentry's Dart SDK version 5.0.0 and above requires Dart 1.12.0 | ||
| * Fix: Prefix classes with Sentry | ||
| * A couple of classes were often conflicting with user's code. | ||
| - Sentry's Dart SDK version 5.0.0 and above requires Dart 1.12.0 | ||
| - Fix: Prefix classes with Sentry | ||
| - A couple of classes were often conflicting with user's code. | ||
| As a result, this change renames the following classes: | ||
| * `App` -> `SentryApp` | ||
| * `Browser` -> `SentryBrowser` | ||
| * `Device` -> `SentryDevice` | ||
| * `Gpu` -> `SentryGpu` | ||
| * `Integration` -> `SentryIntegration` | ||
| * `Message` -> `SentryMessage` | ||
| * `OperatingSystem` -> `SentryOperatingSystem` | ||
| * `Orientation` -> `SentryOrientation` | ||
| * `Request` -> `SentryRequest` | ||
| * `User` -> `SentryUser` | ||
| * Return type of `Sentry.close()` changed from `void` to `Future<void>` and `Integration.close()` changed from `void` to `FutureOr<void>` | ||
| - `App` -> `SentryApp` | ||
| - `Browser` -> `SentryBrowser` | ||
| - `Device` -> `SentryDevice` | ||
| - `Gpu` -> `SentryGpu` | ||
| - `Integration` -> `SentryIntegration` | ||
| - `Message` -> `SentryMessage` | ||
| - `OperatingSystem` -> `SentryOperatingSystem` | ||
| - `Orientation` -> `SentryOrientation` | ||
| - `Request` -> `SentryRequest` | ||
| - `User` -> `SentryUser` | ||
| - Return type of `Sentry.close()` changed from `void` to `Future<void>` and `Integration.close()` changed from `void` to `FutureOr<void>` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.