Page MenuHomePhabricator

UrlShortener should not load all of oojs-ui on all pages
Closed, ResolvedPublic

Description

See T112401 for the disaster that happened when Echo did that. We need some kind of lazy load for OOUI.

Event Timeline

Legoktm raised the priority of this task from to High.
Legoktm updated the task description. (Show Details)
Legoktm added subscribers: Legoktm, Prtksxna.

I was thinking, we don't really need OOjs UI for the toolbar link. We just want to show the shortened URL, a simple input is fine for that. We can turn that into an OO.ui.TextInputWidget at some point when OOjs UI is loaded everywhere.

The issue is that there is no place to show an error message. Technically, its not showing anything useful right now either (because I forgot to load the error messages for ext.urlShortener.toolbar), but that is not the point. Do you think we can get away by not showing anything useful whatsoever and turning the link into an actual link to Special:UrlShortener with the current URL?

Change 246833 had a related patch set uploaded (by Prtksxna):
ext.urlShortener.toolbar: Remove dependency on OOjs UI

https://gerrit.wikimedia.org/r/246833

Do you think we can get away by not showing anything useful whatsoever and turning the link into an actual link to Special:UrlShortener with the current URL?

If the API errors out, we could forward the user directly to Special:UrlShortener (i.e. no-JS mode) and rely upon that to display any error message.

Do you think we can get away by not showing anything useful whatsoever and turning the link into an actual link to Special:UrlShortener with the current URL?

If the API errors out, we could forward the user directly to Special:UrlShortener (i.e. no-JS mode) and rely upon that to display any error message.

Not sure if forwarding them without them specifically asking is a good idea. The link already lets them do that and also gives them an option to open in a new tab.

Change 246833 merged by jenkins-bot:
ext.urlShortener.toolbar: Remove dependency on OOjs UI

https://gerrit.wikimedia.org/r/246833