Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Conversation

@dnfield
Copy link
Contributor

@dnfield dnfield commented Oct 15, 2020

TBD: What version/changelog changes to make.

@dnfield dnfield requested review from CareF, blasten and nturgut October 15, 2020 00:53
@google-cla google-cla bot added the cla: yes label Oct 15, 2020
@blasten
Copy link

blasten commented Oct 15, 2020

0.10.0-nullsafety?

@dnfield
Copy link
Contributor Author

dnfield commented Oct 15, 2020

Are we going to use teh -nullsafety for this? I was under the impression that that is a temporary designation for special packages and should not be widely used.

@dnfield
Copy link
Contributor Author

dnfield commented Oct 15, 2020

@blasten
Copy link

blasten commented Oct 15, 2020

Yes, the -nullsafety prerelease is temporary. The general guidance is to consider this as a breaking change (major version bump), so you can clean up/refine the API as needed.

environment:
sdk: ">=2.1.0 <3.0.0"
sdk: '>=2.10.0-56.0.dev <3.0.0'
flutter: ">=1.6.7 <2.0.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also update flutter version?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Dart constraint will take care of that, but we could.

@visibleForTesting vm.VmService? vmService,
}) async {
assert(streams != null);
assert(streams != null); // ignore: unnecessary_null_comparison
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line seems no longer necessary when we have null-safety.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still useful when not in sound null safety e.g. importing a non nnbd package

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: does it make sense to merge to asserts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nturgut I'm not sure I'm understanding what merge asserts would be in this context...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's very nit :)

assert(streams !=null && streams. isNotEmpty, 'Non empty stream is required')

);
}
await _vmService.setVMTimelineFlags(streams);
vmService ??= await _vmService;
Copy link
Contributor

@CareF CareF Oct 15, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be if (vmService != null) _cachedVmService = vmService, so that traceTimeline will use the provided vmService. And to make it logically more consistent I would change the next line back to await _vmService.setVMTimelineFlags(streams);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made the private member a future. I'm also not clear on this, I assumed the param was only for testing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But this parameter is intended to replace the standard vmService for testing purposes. If I understand it correctly, your version traceTimeline will still call the _cachedVmService obtained by vm_io.vmServiceConnectUri, but what it should call is the vmService provided here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. We should add it as a param there then or move it to the ctor/ensureInitialized It's pretty strange to have a method alter a private member for tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've cleaned this up a bit, let me know what you think.

String? destinationDirectory,
}) async {
assert(testOutputFilename != null);
assert(testOutputFilename != null); // ignore: unnecessary_null_comparison
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line seems no longer necessary when we have null-safety.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above - these are still helpful when working in mixed/unsound mode.

@dnfield
Copy link
Contributor Author

dnfield commented Oct 15, 2020

This is going to have problems because of package:mockito and package:vm_service.

Copy link
Contributor

@CareF CareF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM when the mockVM issue is solved.

@dnfield
Copy link
Contributor Author

dnfield commented Oct 15, 2020

So we don't really need mockito for this, and the story around using that for NNBD is still being developed so we can just avoid having it block this.

Still will be blocked on migration of package:vm_service


vm.VmService _vmService;
vm.VmService? _cachedVmService;
Future<vm.VmService> get _vmService async {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change related to nnbd?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be split out into a separate patch. It came up because with nnbd I had to think more carefully about whether this property was nullable or not, and when it'd be set, and came to realize it was getting set by a method when another method might want to use it too.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, let's keep it here. I think it's enough as long as we add it to the change log/pr description (if something goes wrong it will be easier to see 😅 )


environment:
sdk: ">=2.2.2 <3.0.0"
sdk: '>=2.10.0-56.0.dev <3.0.0'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no rush on this, and we won't be able to move forward with it realistically until package:vm_service is migrated, which probably won't happen for at least a couple more weeks.

This constraint should be ok, but by the time we'd publish this it should have a real 2.11 (not .dev) constraint.

Copy link
Contributor

@nturgut nturgut Oct 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the info! :)

Copy link
Contributor

@nturgut nturgut left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a few comments. I think the best way would be to test a web engine integration test locally with the new version (since the existing tests use the old version we won't know if they fail until we try to upgrade)

@dnfield
Copy link
Contributor Author

dnfield commented Nov 12, 2020

I'm going to close this, since this package is moving to the flutter repo.

@dnfield dnfield closed this Nov 12, 2020
@ferhatb
Copy link

ferhatb commented Nov 13, 2020

@dnfield this is blocking us from migrating our tests to non-nullable. Is there a separate issue that tracks move to flutter repo ?

@dnfield
Copy link
Contributor Author

dnfield commented Nov 13, 2020

It's been moved already. The real blocker for this is that vm_service and then flutter_driver need to be migrated

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants