Page MenuHomePhabricator

T8. Eliminate unnecessary serialization and deserialization (Parsoid HTML <-> wikitext)
Closed, ResolvedPublic2 Estimated Story Points

Description

When opening a VE editor (e.g. to edit an existing post), we're currently deserializing it from HTML to wikitext (on the server) (this step is done for wikitext editing too). Then, we re-serialize it to HTML to open VE.

When the user is done editing, we then deserialize the HTML (which the user just entered in VE) to wikitext using a network round-trip to Parsoid, post wikitext to the server (to submit the form), then reserialize it to HTML on the server (this last step is again done for wikitext editing too). (Parsoid does not yet have a HTML validator (for XSS, etc.), so we currently need to convert it to wikitext then back to HTML as validation. However, this should be done on the server, rather than making the user wait for an AJAX request (for conversion) and then another for posting it.

Basically, it should never do an unnecessary serialization or deserialization. For the no-JS edit and post pages, we will continue to need to serialize on the server.

However, whenever we're saving VE content, we already have the HTML and should post it like that to the server (but see above). Similarly, when starting a VE edit in JS, we should fetch the HTML, rather than fetching wikitext and requiring a network round trip.

This is also related to and will help with fixing T73474: R5. Flow uses synchronous XMLHttpRequests (VE+Flow). See also T88182: Q2. Define and estimate work for Minimum Viable Product of VisualEditor in Flow (spike) (Catalan, Translatewiki).

Event Timeline

Mattflaschen-WMF raised the priority of this task from to Needs Triage.
Mattflaschen-WMF updated the task description. (Show Details)
DannyH renamed this task from Eliminate unnecessary serialization and deserialization (Parsoid HTML <-> wikitext) to T8. Eliminate unnecessary serialization and deserialization (Parsoid HTML <-> wikitext).Mar 25 2015, 7:34 PM

Change 202335 had a related patch set uploaded (by Matthias Mullie):
Stop doing pointless Parsoid roundtrips

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

Change 202339 had a related patch set uploaded (by Matthias Mullie):
Add content type: fixed-html

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

Change 202335 merged by jenkins-bot:
Stop doing pointless Parsoid roundtrips

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

Change 202339 merged by jenkins-bot:
Add content type: fixed-html

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