-
-
Notifications
You must be signed in to change notification settings - Fork 237
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
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. |
lib/src/browser.dart
Outdated
Map<String, dynamic> data, | ||
Map<String, String> headers, | ||
) => | ||
// Gzip compression is not available on browser |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more precise gzip is available in web browsers but it is done implicitly.
lib/src/stack_trace.dart
Outdated
@@ -70,3 +82,9 @@ String _absolutePathForCrashReport(Frame frame) { | |||
|
|||
return '${frame.uri}'; | |||
} | |||
|
|||
class EmptyStacktraceException implements Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's document all public API, including the class and public members.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually It was not used, It just removed it
lib/src/version.dart
Outdated
|
||
/// The SDK name reported to Sentry.io in the submitted events. | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separate paragraphs with one blank line. End the sentence with a period.
lib/src/version.dart
Outdated
const String sdkPlatform = 'dart'; | ||
|
||
/// Used to report browser Stacktrace to sentry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the license header.
lib/src/base.dart
Outdated
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment would be most useful in lib/sentry.dart
than here. Let's move it there.
@@ -1,7 +0,0 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice clean-up! Thanks.
CHANGELOG.md
Outdated
@@ -1,5 +1,12 @@ | |||
# package:sentry changelog | |||
|
|||
## 2.4.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about making it a 3.0.0-dev0
, given how big and probably subtly breaking this change is?
lib/src/base.dart
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are ignores necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do browser_client.dart
and io_client.dart
add much value on top of the configurable imports?
test/sentry_browser_test.dart
Outdated
const String _testDsnWithPort = | ||
'https://public:[email protected]:8888/1'; | ||
void main() { | ||
group('$SentryBrowserClient', () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 ? :) |
lib/sentry.dart
Outdated
@@ -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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep the original year.
@@ -0,0 +1,16 @@ | |||
import 'package:http/http.dart'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a license header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
SentryClient
frompackage:sentry/sentry.dart
with conditional importSentryBrowserClient
for web frompackage:sentry/browser_client.dart
SentryIOClient
for VM and Flutter frompackage:sentry/io_client.dart
Main implementation difference are:
window.location.origin
to be resolve by sentry