Sentry - Support browser - #22
Conversation
|
Thanks for the PR! A couple of things before we can move forward. This PR needs two reviews, one to cover the dart-for-web side of things and one to cover the Flutter/VM parts. We have a few people on the Flutter team (including myself) who can provide the latter, but not the former. Therefore we need to find someone on our team who would be willing to own the Web functionality for flutter/sentry. @kevmoo, @matanlurey, can you help with this? If you need to move fast and can't wait for these organizational/ownership issues to be resolved, one option is to fork this library (Go open source!). |
|
I already have a fork that we use in production and that is used by angular_sentry for a few month now. I don't need to move fast, the coming release of dart 2 and angular 5 seems to be a good opportunity to build a strong library for sentry. |
|
It is unlikely my team will be able to own this anytime soon @yjbanov |
|
angular implementation => leftyio/angular_sentry#1 |
|
@yjbanov Are you able to continue to shepherd this through? |
|
Unfortunately, no. |
|
https://github.com/getsentry maintains official Sentry plugins, it's possible they would be interested in taking on a fuller-featured sentry plugin for Dart server, browser and flutter. |
|
@lejard-h We've moved this to the |
|
I will do that 👍 |
asked here getsentry/sentry-dart#22 (comment) move the current sentry packages without modifications, except fixing warnings due to new analysis_options.
|
Any news? (Flutter for a web already presented) |
Yes, this will have to align with the Flutter for web efforts, likely after we merge the Web support into Flutter proper. |
|
Any updates as to when this PR will be accepted ? |
|
As of September 10, 2019, Flutter for web merged into the mainline Flutter SDK, so we can certainly reopen this discussion. |
|
I fixed the conflicts. Test are passing but I still need to check my angular_sentry implementation and run additional tests on real env. I also added conditional import support on |
|
I've added sentry without checking first if it's support web :( shame on me lool can't run on web anymore. But now I'm interested to see this merged ^^ |
|
I'm reviewing this PR right now in between other high-priority tasks that have been assigned to me, but it's big! :) So it will take some time. |
| Map<String, dynamic> data, | ||
| Map<String, String> headers, | ||
| ) => | ||
| // Gzip compression is not available on browser |
There was a problem hiding this comment.
To be more precise gzip is available in web browsers but it is done implicitly.
| return '${frame.uri}'; | ||
| } | ||
|
|
||
| class EmptyStacktraceException implements Exception { |
There was a problem hiding this comment.
Let's document all public API, including the class and public members.
There was a problem hiding this comment.
Actually It was not used, It just removed it
| const String sdkName = 'dart'; | ||
|
|
||
| /// The name of the SDK platform reported to Sentry.io in the submitted events. | ||
| /// Used for IO version |
There was a problem hiding this comment.
Separate paragraphs with one blank line. End the sentence with a period.
| /// Used for IO version | ||
| const String sdkPlatform = 'dart'; | ||
|
|
||
| /// Used to report browser Stacktrace to sentry |
There was a problem hiding this comment.
End the sentence with a period.
| import 'src/utils.dart'; | ||
| import 'src/version.dart'; | ||
|
|
||
| export 'src/base.dart'; |
There was a problem hiding this comment.
Please keep the license header.
| // Use of this source code is governed by a BSD-style license that can be | ||
| // found in the LICENSE file. | ||
|
|
||
| /// A pure Dart client for Sentry.io crash reporting. |
There was a problem hiding this comment.
This comment would be most useful in lib/sentry.dart than here. Let's move it there.
| @@ -1,7 +0,0 @@ | |||
| #!/bin/sh | |||
| @@ -1,5 +1,12 @@ | |||
| # package:sentry changelog | |||
|
|
|||
| ## 2.4.0 | |||
There was a problem hiding this comment.
How about making it a 3.0.0-dev0, given how big and probably subtly breaking this change is?
| import 'client_stub.dart' | ||
| // ignore: uri_does_not_exist | ||
| if (dart.library.html) 'browser.dart' | ||
| // ignore: uri_does_not_exist |
There was a problem hiding this comment.
Why are ignores necessary?
yjbanov
left a comment
There was a problem hiding this comment.
Do browser_client.dart and io_client.dart add much value on top of the configurable imports?
| const String _testDsnWithPort = | ||
| 'https://public:secret@sentry.example.com:8888/1'; | ||
| void main() { | ||
| group('$SentryBrowserClient', () { |
There was a problem hiding this comment.
You can also do group(SentryBrowserClient, ...
| @@ -0,0 +1,425 @@ | |||
| // Copyright 2017 The Chromium Authors. All rights reserved. | |||
There was a problem hiding this comment.
It looks like a lot of the test code is identical with the io version. Would it be possible to have shared test code configurable via a typedef SentryClientFactory that provides either io or browser implementation of the client??
There was a problem hiding this comment.
The conditional import made it really simple to do, I moved all common and configurable tests under the test_utils.dart file using a single function
runTest({Codec<List<int>, List<int>> gzip, bool isWeb = false})Also moved Event test under event_test.dart file.
|
All good now @yjbanov ? :) |
| @@ -1,653 +1,8 @@ | |||
| // Copyright 2017 The Chromium Authors. All rights reserved. | |||
| // Copyright 2019 The Chromium Authors. All rights reserved. | |||
There was a problem hiding this comment.
Let's keep the original year.
| @@ -0,0 +1,16 @@ | |||
| import 'package:http/http.dart'; | |||
There was a problem hiding this comment.
This needs a license header.
There was a problem hiding this comment.
should be good now
|
@lejard-h I can't thank you enough for your boundless patience! As I read through the history of this PR, I'm amazed at how things have changed since August 2018, when it was first filed. This PR survived tectonic shifts in Flutter and Dart. |

SentryClientfrompackage:sentry/sentry.dartwith conditional importSentryBrowserClientfor web frompackage:sentry/browser_client.dartSentryIOClientfor VM and Flutter frompackage:sentry/io_client.dartMain implementation difference are:
window.location.originto be resolve by sentry