-
-
Notifications
You must be signed in to change notification settings - Fork 255
null safety on sentry_flutter #337
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
null safety on sentry_flutter #337
Conversation
Yeah sure |
@fzyzcjy See for example: I wonder if we can share those mock between sentry and sentry_flutter. I also think that you could remove most getter and setter in SentryFlutterOptions because the null checks aren't needed anymore. |
@ueman sounds reasonable! I will check them after about 10 hours (after a sleep). |
I know. But as per https://develop.sentry.dev/sdk/philosophy/#dependencies-cost I've decided against it. Also Flutter itself and a lot of other popular libraries are migrating away from it so I'm not that convinced 😅 |
@@ -5,7 +5,7 @@ homepage: https://docs.sentry.io/platforms/flutter/ | |||
repository: https://github.com/getsentry/sentry-dart | |||
|
|||
environment: | |||
sdk: ">=2.8.0 <3.0.0" | |||
sdk: '>=2.12.0 <3.0.0' | |||
flutter: ">=1.17.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.
@marandaneto Does it make sense to keep it this low? I wonder if it causes any problems because Flutter 1.17 doesn't has null safety. On the other hand
package_info for example allows versions as low as 1.12 while also having null safety.
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.
yeah unless we have to, lets keep as it is, all the official plugins are down to 1.12
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.
btw looking at https://dart.dev/null-safety
Sound null safety is available in Dart 2.12 and Flutter 2.
should we bump to min. v2?
I understand your point but you could always add a sub project for tests that doesn't increase the SDK dependency surface and then just generate the mocks. |
Worth noting that document refers to runtime dependencies and not dev or test only ones. |
@ueman most of the reviews are fixed. now I am looking at the tests. |
Done |
Hi, I wonder what should I do to migrate the tests? Shall I use mockito, or not use it? @bruno-garcia @kuhnroyal @ueman |
So I will start working on mockito NULL_SAFETY_README |
Codecov Report
@@ Coverage Diff @@
## feat/null-safety #337 +/- ##
====================================================
+ Coverage 88.41% 89.56% +1.14%
====================================================
Files 51 46 -5
Lines 1692 1466 -226
====================================================
- Hits 1496 1313 -183
+ Misses 196 153 -43
Continue to review full report at Codecov.
|
@fzyzcjy the package score is as low as 70, could you run |
my 2 cents about using or not mockito with auto-generated code, I've not used mockito v5 yet (with null-safety enabled), so I don't have a strong opinion, as the tests are passing/fixed and right now null-safety at sentry is a blocker for some users, I'd prefer to go ahead and merge/release and later, we revisit this if necessary. what do you think @ueman ? |
I agree with you. |
@marandaneto Here is the outputs: (base) ➜ flutter git:(feat/null-safety) pana INFO Running ✓ Follow Dart file conventions (20 / 20)[*] 10/10 points: Provide a valid
|
Package | Constraint | Compatible | Latest |
---|---|---|---|
flutter |
flutter |
0.0.0 | 0.0.0 |
flutter_web_plugins |
flutter |
0.0.0 | 0.0.0 |
package_info |
^2.0.0 |
2.0.0 | 2.0.0 |
sentry |
^4.0.5 |
4.0.6 | 4.0.6 |
Transitive dependencies
Package | Constraint | Compatible | Latest |
---|---|---|---|
characters |
- | 1.1.0 | 1.1.0 |
charcode |
- | 1.2.0 | 1.2.0 |
collection |
- | 1.15.0 | 1.15.0 |
convert |
- | 2.1.1 | 3.0.0 |
crypto |
- | 2.1.5 | 3.0.0 |
http |
- | 0.12.2 | 0.13.0 |
http_parser |
- | 3.1.4 | 4.0.0 |
js |
- | 0.6.3 | 0.6.3 |
meta |
- | 1.3.0 | 1.3.0 |
path |
- | 1.8.0 | 1.8.0 |
sky_engine |
- | 0.0.99 | 0.0.99 |
source_span |
- | 1.8.1 | 1.8.1 |
stack_trace |
- | 1.10.0 | 1.10.0 |
string_scanner |
- | 1.1.0 | 1.1.0 |
term_glyph |
- | 1.2.0 | 1.2.0 |
typed_data |
- | 1.3.0 | 1.3.0 |
uuid |
- | 2.2.2 | 3.0.1 |
vector_math |
- | 2.1.0 | 2.1.0 |
To reproduce run pub outdated --no-dev-dependencies --up-to-date --no-dependency-overrides
.
[*] 10/10 points: Package supports latest stable Dart and Flutter SDKs
✓ Support sound null-safety (0 / 0)
[*] 0/0 points: Package and dependencies are fully migrated to null-safety, and will be awarded additional points in a planned future revision of the pub.dev points model.
Points: 70/100.
Thus, IMHO the problem is caused by, pana does not understand we need to use the overrided version of sentry, but use the old version on Pub? So I guess it is not a problem |
Hi, can we merge this now? 😄 |
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.
LGTM
📜 Description
add support for null safety on sentry_flutter as shown here #247
💡 Motivation and Context
everyone who wants to have sound null safety needs this!
💚 How did you test it?
same tests, no need for any changes
📝 Checklist
🔮 Next steps