How to perform asynchronous functions in plugin

Not only your plugin UI, but the whole Figma UI.

This is a problem only for long-running complex tasks, e.g. traversing the Figma nodes tree.