AdobeXD / xd-to-flutter-plugin

Generate assets from XD for use in an existing Flutter project
BSD 2-Clause "Simplified" License
953 stars 97 forks source link

Automatic hot reload can generate Flutter debug console errors in some cases #101

Open gskinner opened 3 years ago

gskinner commented 3 years ago

Flutter's automatic hot reload has a 50ms debounce, but because we parse and write widgets sequentially sometimes the delay between writes exceeds this. In some cases, that can lead to errors in Flutter's debug console because it attempts a build while subsequent files are still being written.

It should be possible to defer all file writes to the end of a parse, which should mostly resolve the issue (barring any massive files that take >50ms to write, or any file system delays).

I'm chatting with Dan, who devs the Flutter plugin for VS Code about more reliable solutions.

gskinner commented 3 years ago

Chatting with Dan, it sounds like the best solution will be deferring file writes, at least for now. This will take some restructuring, and might make sense to combine with work on #62 (NOTE: images should probably be written first if we auto export them)