[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.
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.
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.
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.
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.
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.
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.