Skip to content

Watch wildcard directories in addition to asset bundle#29883

Merged
jonahwilliams merged 4 commits intoflutter:masterfrom
jonahwilliams:handle_wildcard_updates
Mar 27, 2019
Merged

Watch wildcard directories in addition to asset bundle#29883
jonahwilliams merged 4 commits intoflutter:masterfrom
jonahwilliams:handle_wildcard_updates

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Mar 24, 2019

Description

Currently we only update assets when we detect either a change to an existing asset or an update to the asset manifest. Due to the existence of wildcard assets foo/ (all files directly under foo), it is possible for a user to add a new asset which isn't detected through either of these previous approaches.

To fix this, we can track each wildcard directory in addition to the asset manifest, and mark the bundle as needing to be updated when the directory stat has occurred after the last build time. This allows adding a new asset to a wildcard directory and hot reloading it.

Related Issues

Fixes #18896

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]). This will ensure a smooth and quick review process.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes tests for all changed/updated/fixed behaviors (See Test Coverage).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require Flutter developers to manually update their apps to accommodate your change?

@jonahwilliams jonahwilliams marked this pull request as ready for review March 25, 2019 16:28
@jonahwilliams jonahwilliams requested a review from zanderso March 25, 2019 16:30
@goderbauer goderbauer added the tool Affects the "flutter" command-line tool. See also t: labels. label Mar 25, 2019
Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

lgtm w/ nit

Add documentation describing which assets are expected.
@jonahwilliams jonahwilliams merged commit bafe7cb into flutter:master Mar 27, 2019
@jonahwilliams jonahwilliams deleted the handle_wildcard_updates branch March 27, 2019 04:40
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Trigger assets scan again if a file is added/removed to scanned folder

4 participants