Sentry-dart: Prepare for NNBD

Created on 8 Oct 2020  路  11Comments  路  Source: getsentry/sentry-dart

For now the package has almost 200 errors with NNDB activated cf. https://dart.dev/null-safety

enhancement

All 11 comments

@rxlabz would be great to add null safety as early as possible. Since retrofitting it is much harder than adding code while having it turned on. @marandaneto ?

yep I'd love to turn it on as well but we'd need to see how much work is to fix all the 200 errors.
@rxlabz would be possible to do a small investigation to understand how much work would we need to tackle all those null-safety issues?

The number is high because of the json encoding/decoding, it makes a lot of potentially null values. Should not be very long/hard to fix. Anyway, I think the Dart team talked about releasing a tool to help the migration. Next week I'll check if something is already available.

@rxlabz worth noting that from Sentry's perspective {} is a valid event. So literally everything is optional. Not everything is documented optional, because some things wouldn't make sense like you send a frame line number but no function name. And other combination of data.

Thanks, I'll keep that in mind !

NNBD is not Flutter ready and we are blocked by it, let's revisit this at a later time.

Flutter now recommends migration for packages and has a migration tool for assistance: https://dart.dev/null-safety/migration-guide

@MisterJimson true, I've been watching this tool, the thing is, supporting null safety right now would require to bump the min. Dart and Flutter SDK versions and not everyone is comfortable using beta versions right.

See: https://develop.sentry.dev/sdk/philosophy/#compatibility-is-king

Ideally, we'd do that using a branch, so we could publish a Prerelease with the null-safety feature, but still supporting older versions.
I'd start this only when our dependencies are null-safety ready though, see #247

A -nullsafety Prerelease would be great. This is sort of a hen/egg problem at the moment.

Absolutely I would expect null safety as a pre release and not in the main line for a while, just as the migration docs suggest.

We'll implement this as part of #247
Tracking dependencies and progress on that issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fzyzcjy picture fzyzcjy  路  3Comments

lukaglo picture lukaglo  路  7Comments

bruno-garcia picture bruno-garcia  路  4Comments

bruno-garcia picture bruno-garcia  路  5Comments

babulpatel1309 picture babulpatel1309  路  4Comments