-
Notifications
You must be signed in to change notification settings - Fork 29.8k
[flutter_tools] allow device classes to provide platform-specific interface for devFS Sync #66266
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
[flutter_tools] allow device classes to provide platform-specific interface for devFS Sync #66266
Conversation
| @override | ||
| Future<UpdateFSReport> update({ | ||
| Uri mainUri, | ||
| @required Uri mainUri, |
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 is just a reorganization of the params to match the parent devFS class, which revealed that 'pathToReload' was missing a required
jmagman
left a comment
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 wish we had more desktop integration tests...
| content.copySync(destination.path); | ||
| continue; | ||
| } | ||
| destination.writeAsBytesSync(await devFSContent.contentsAsBytes()); |
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.
Note to self: fall through is for DevFSStringContent/DevFSByteContent
|
We do have macOS hot reload/restart tests thankfully. I double check what the status is for linux/windows |
|
|
||
| /// An implementation of a devFS writer which copies physical files for devices | ||
| /// running on the same host. | ||
| class DesktopDevFSWriter implements DevFSWriter { |
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.
We also discussed using this same code for the iOS simulator (can be in a future PR).
| @required MacOSWorkflow macOSWorkflow, | ||
| @required ProcessManager processManager, | ||
| @required Logger logger, | ||
| @required FileSystem fileSystem, |
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.
g3 doesn't like this new @required, it's passing one into the context.
| LinuxDevices({ | ||
| @required Platform platform, | ||
| @required FeatureFlags featureFlags, | ||
| @required FileSystem fileSystem, |
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.
Same, g3 doesn't like this new @required.
|
We could actually figure out if this is usable on Android by checking if the created devFS directory exists on the host file system |
|
Updated to make this landable in g3, no longer enables the change immediately |
Description
Part of the investigation of go/flutter-improving-devfs-reliability revealed an easy optimization for hot reload/restart on desktop devices. This should improve performance of hot restart by several hundred milliseconds and reduce memory usage of both the tool and application.