In reply to Ahmad Awais.

@Andreas, to be fair the text widget does selective refresh starting with 4.6 or 4.5 (an ajax request sent to the server to calculate new html) and not a full page, but probably no complex widget that needs to change CSS and JS will be able to use selective refresh.

@ahmad, since it seems like you are the expert, maybe you can suggest to me how can I in my widget trigger full page refresh when I have to (change JS settings/ libraries being queued) and selective refresh when I can avoid the full page one?