Repository navigation
Send RPC request to switch assets directory on hot reload. - #12872
Merged
Merged
Conversation
This is needed to pick up updated assets that are expected to be picked up on hot reload.
a-siva
approved these changes
Nov 6, 2017
| } | ||
|
|
||
| Future<Null> setAssetDirectory(Uri assetsDirectory) async { | ||
| if (assetsDirectory != null) { |
Contributor
There was a problem hiding this comment.
when will the assetsDirectory be null?
I am wondering if it is sufficient to assert that assetsDirectory is not null.
|
|
||
| Future<Null> resetAssetDirectory() async { | ||
| final Uri deviceAssetsDirectoryUri = devFS.baseUri.resolveUri( | ||
| fs.path.toUri(getAssetBuildDirectory())); |
Contributor
There was a problem hiding this comment.
assert deviceAssetsDirectoryUri != null ?
Contributor
|
cc @cbracken for review |
cbracken
approved these changes
Nov 22, 2017
| assert(deviceAssetsDirectoryUri != null); | ||
| for (FlutterView view in views) { | ||
| await view.setAssetDirectory(deviceAssetsDirectoryUri); | ||
| } |
Member
There was a problem hiding this comment.
Maybe very slightly better?
await Future.wait(views.map((view) => view.setAssetDirectory(deviceAssetsDirectoryUri)));
cbracken
approved these changes
Nov 28, 2017
| final Uri deviceAssetsDirectoryUri = devFS.baseUri.resolveUri( | ||
| fs.path.toUri(getAssetBuildDirectory())); | ||
| assert(deviceAssetsDirectoryUri != null); | ||
| await Future.wait(views.map((view) => view.setAssetDirectory(deviceAssetsDirectoryUri))); |
Member
Member
Author
|
Currently this is pending on flutter-team-archive/engine#4323 being reviewed and landed. |
Contributor
|
This seems to have dramatically regressed some of the hot reload benchmarks. |
Member
Author
|
There is something fishy going on with those benchmarks. See discussion on original commit: 8da5af5#commitcomment-26676085 |
DaveShuckerow
pushed a commit
to DaveShuckerow/flutter
that referenced
this pull request
May 14, 2018
…2872) * Send RPC request to switch assets directory on hot reload. This is needed to pick up updated assets that are expected to be picked up on hot reload. * Assert assets directory is not null. * Better multiple future wait * Add type annotation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This is needed to pick up updated assets that are expected to be picked up on hot reload.
This relies on flutter-team-archive/engine#4323