I just want to point out, what the tilde actually does when used as prefix to dependencies in $scrips->register() on view.scripts or $styles->register() on view.styles. I always forgot it and was unsure about, what it actually does as it is not clearly (or exactly) explained in the docs.
my-script is loaded after uikit and after the script which is registered with widget.
But with using tilde ~ as prefix for widget, my-script only gets loaded, if widget get's loaded. This fact Isn't explicitly stated in the docs.
If use it via the Script and Stylehelper, the ~ has no affect, as $view->style() or $view->script() uses the add() method of the AssetManager which does't consider ~.
Hope this helps somebody.