We should replace use of mw.Uri in VE with native URL API. The mw.Uri library doesn't handle URLs exactly like browsers and web servers do, which over the years has caused many bugs (T325566, T324976, T286009, T268064, T270331, T106244, T66884, and more).
Previously done for DiscussionTools: T305010