Adding js files to vaadin page head update

I’ve seen a few pages regarding the best way to add js files to a page header for a vaadin project, both of which are from 2-3 years ago. I just wanted to confirm if these were still the best way to include a js file for a vaadin created HTML page.

https://vaadin.com/forum/#!/thread/791748/791747

https://vaadin.com/forum#!/thread/1522453