Page MenuHomePhabricator

T8. Eliminate unnecessary serialization and deserialization (Parsoid HTML <-> wikitext)
Closed, ResolvedPublic2 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)
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptFeb 25 2015, 5:23 AM
EBernhardson triaged this task as High priority.Feb 25 2015, 6:41 PM
EBernhardson added a subscriber: EBernhardson.
DannyH edited a custom field.Feb 25 2015, 7:34 PM

I've been doing a little bit of work in https://gerrit.wikimedia.org/r/#/c/195878/ already

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
Restricted Application added a project: Collaboration-Team-Triage. · View Herald TranscriptApr 2 2015, 4:16 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

DannyH closed this task as Resolved.Apr 9 2015, 12:59 AM
DannyH added a subscriber: DannyH.

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