Page MenuHomePhabricator

Move transform endpoints from RESTBase to MediaWiki
Closed, ResolvedPublic

Description

VisualEditor depends on the following transform endpoints:

PHP implementation of these endpoints already exist in the Parsoid extension, see the MWParsoid\Rest\Handler\TransformHandler class. This class should be copied to MediaWiki core and adjusted. The endpoint in the parsoid extension can be retained for backwards compatibility, but should eventually be backed by the core class rather than a class that lives in the parsoid extension.

When transforming HTML to wikitext, the transform handler makes use of the original wikitext and the data-parsoid mapping. Currently, it expects the original page bundle to come from the request body: $origPb = new PageBundle( '', $original['data-parsoid']['body'] ?? null, $original['data-mw']['body'] ?? null );. In the future, we should look up the stashed page bundle based on the etag if it's not in the request (T310464).

Event Timeline

daniel triaged this task as Medium priority.May 24 2022, 8:21 AM

Change 799974 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/core@master] Rest: Move TransformHandler to core (part 1)

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

DAlangi_WMF changed the task status from Open to In Progress.Jun 1 2022, 12:01 PM

Change 799974 merged by jenkins-bot:

[mediawiki/core@master] Rest: Move TransformHandler to core (part 1)

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

Change 802586 had a related patch set uploaded (by D3r1ck01; author: Derick Alangi):

[mediawiki/core@master] Rest: Remove {domain} param from TransformHandler

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

Change 802586 merged by jenkins-bot:

[mediawiki/core@master] Rest: Remove {domain} param from TransformHandler

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

Change 804651 had a related patch set uploaded (by Daniel Kinzler; author: Daniel Kinzler):

[mediawiki/core@master] Make the ParsoidHandler base class usable by the parsoid extension.

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

daniel raised the priority of this task from Medium to High.Jun 13 2022, 7:58 AM

Change 804651 merged by jenkins-bot:

[mediawiki/core@master] Make the ParsoidHandler base class usable by the parsoid extension.

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

daniel lowered the priority of this task from High to Medium.Sep 23 2022, 9:58 AM