mediawiki-extensions-Visual.../modules
Bartosz Dziewoński 461c76981f Rewrite mw.libs.ve.getTargetDataFromHref with URL API
At first I was going for a more minimal replacement of mw.Uri with URL,
until I discovered that this code depends on a mw.Uri bug that would be
difficult to replicate:

  // Expected: Relative URLs are accepted
  new mw.Uri( '/foo' ).toString() // => 'https://localhost/foo'
  // Expected: Protocol is optional
  new mw.Uri( 'example.com/foo' ).toString() // => 'https://example.com/foo'
  // Unexpected: Treated as empty domain with no protocol rather than relative URL
  new mw.Uri( './foo' ).toString() // => 'https://./foo'

So I went for a bigger rewrite to preserve the intent rather than the
exact logic.

I had to change some test cases to use more realistic fake data. They
previously relied on bugs in our URL handling to pass despite the base
URLs being incorrect, particularly for non-short URLs (see T270219).
In my testing non-short URLs behave the same as before in practice.

Depends-On: I07a8c097dba0f5572c0aedf4febdf1434063ea6f
Bug: T325249
Change-Id: I232361266c1dda795b88018c3aaa3d9ecbe42b93
2023-01-23 14:59:23 +00:00
..
ve-mw Rewrite mw.libs.ve.getTargetDataFromHref with URL API 2023-01-23 14:59:23 +00:00
ve-mw-collab Update eslint-config-wikimedia to 0.24.0 2023-01-18 14:39:04 +00:00
.eslintrc.json Update eslint-config-wikimedia to 0.24.0 2023-01-18 14:39:04 +00:00
eslint-shared.json Update eslint-config-wikimedia to 0.24.0 2023-01-18 14:39:04 +00:00