-
Notifications
You must be signed in to change notification settings - Fork 362
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
Enable null safety #472
Enable null safety #472
Conversation
Sadly, |
var pairs = <List<String>>[]; | ||
map.forEach((key, value) => pairs.add([ | ||
Uri.encodeQueryComponent(key, encoding: encoding), | ||
Uri.encodeQueryComponent(value, encoding: encoding) | ||
Uri.encodeQueryComponent(key, encoding: encoding ?? utf8), |
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.
Uri.encodeQueryComponent
encoding
param is now non-null with a default.
So we have to hoist the default value here for a null
encoding
unawaited(xhr.onLoad.first.then((_) { | ||
// TODO(nweiz): Set the response type to "arraybuffer" when issue 18542 |
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 issue is now closed
// TODO(nweiz): Set the response type to "arraybuffer" when issue 18542 | ||
// is fixed. | ||
var blob = xhr.response as Blob ?? Blob([]); | ||
var blob = xhr.response as Blob; |
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.
According to the annotations on the dart:html
types, response
is never null.
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.
What do you mean by this? I think it probably is true that if onLoad.first
doesn't have an error this would be non-null, but I don't know what you mean by "the annotations on the dart:html
types".
@@ -52,16 +52,17 @@ class BrowserClient extends BaseClient { | |||
request.headers.forEach(xhr.setRequestHeader); | |||
|
|||
var completer = Completer<StreamedResponse>(); | |||
|
|||
// TODO(kevmoo): not sure what to do here... | |||
// ignore: void_checks |
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.
Here and below – not sure why we're getting this void_checks
hint...
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 will be worked around by googlearchive/pedantic#69 if we get that in.
This issue looks like https://github.com/dart-lang/linter/issues/2185
I think we can keep the lint and point the todo at that issue.
pubspec.yaml
Outdated
@@ -1,15 +1,19 @@ | |||
name: http | |||
version: 0.12.2 | |||
version: 0.12.3-nullsafety |
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.
I think we are generally going with breaking changes for non-allow-listed packages, although that isn't totally decided
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.
Oh it sounds like from the changelog entry this is in the allow list, even so we really only don't want to do breaking changes for flutter depended on packages.
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.
Flutter doesn't depend on this directly – at least I don't think so.
A lot of stuff in the Flutter ecosystem does, though...
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.
cc @natebosch I would still do a major version bump.
We need to stop setting a bad example here.
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.
Oh it sounds like from the changelog entry this is in the allow list
It isn't.
I would still do a major version bump.
+1. We'll want a breaking change for #424 in any case. I can try to get to that next week so we can make a decision before we need to publish this.
where are we on this review, kind sirs? |
analysis_options.yaml
Outdated
linter: | ||
rules: | ||
- annotate_overrides | ||
- avoid_bool_literals_in_conditional_expressions | ||
- avoid_catching_errors |
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.
Enabling lints is not related to null safety and should go in a separate PR.
lib/src/boundary_characters.dart
Outdated
@@ -10,7 +10,7 @@ | |||
/// | |||
/// [RFC 2046]: http://tools.ietf.org/html/rfc2046#section-5.1.1. | |||
/// [RFC 1521]: https://tools.ietf.org/html/rfc1521#section-4 | |||
const List<int> BOUNDARY_CHARACTERS = <int>[ | |||
const List<int> boundaryCharacters = <int>[ |
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.
use a separate PR.
@@ -52,16 +52,17 @@ class BrowserClient extends BaseClient { | |||
request.headers.forEach(xhr.setRequestHeader); | |||
|
|||
var completer = Completer<StreamedResponse>(); | |||
|
|||
// TODO(kevmoo): not sure what to do here... | |||
// ignore: void_checks |
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 will be worked around by googlearchive/pedantic#69 if we get that in.
This issue looks like https://github.com/dart-lang/linter/issues/2185
I think we can keep the lint and point the todo at that issue.
// TODO(nweiz): Set the response type to "arraybuffer" when issue 18542 | ||
// is fixed. | ||
var blob = xhr.response as Blob ?? Blob([]); | ||
var blob = xhr.response as Blob; |
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.
What do you mean by this? I think it probably is true that if onLoad.first
doesn't have an error this would be non-null, but I don't know what you mean by "the annotations on the dart:html
types".
PTAL – cleaned things up |
Please don't force push because now we can no longer see what you changed compared to our last review :( |
Gah. Right. I wanted to revert a bunch of stuff and that seemed easiest.
…On Tue, Sep 29, 2020 at 8:41 AM Jacob MacDonald ***@***.***> wrote:
Please don't force push because now we can no longer see what you changed
compared to our last review :(
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#472 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAEFCXWVTYLQVINIONLIVDSIH5ZLANCNFSM4RYSLUFQ>
.
|
Is there a beta package with this enabled available? I can't find it and this is blocking in almost any project to being able to safely turn on null safety. |
Publishing is tracked in #501 (comment) |
No description provided.