Last modified: 2013-08-26 23:14:20 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T55135, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53135 - Clean up single vs. multi-part data-mw
Clean up single vs. multi-part data-mw
Status: ASSIGNED
Product: Parsoid
Classification: Unclassified
DOM (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: ssastry
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-20 23:56 UTC by Gabriel Wicke
Modified: 2013-08-26 23:14 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Gabriel Wicke 2013-08-20 23:56:03 UTC
We currently use { target: {}, params: {} } for single-transclusion content, and {parts: [{template:{target: {}, params: {}, i: 0}}]} for multi-part transclusions and extensions. This creates special cases and makes it necessary to know all keys to convert the single-transclusion format into the parts bit.

The missing namespacing also makes it harder than necessary to add additional information to data-mw.

To clean this up, we should consider moving to always using an array format like this:

parts: [{"@type":"mw:Transclusion", target: {}, params: {}}]

The change to always use an array is already supported by VisualEditor. Flattening the nested object and using a JSON-LDish @type key makes the parts structure more regular and easier to extend. It also moves it closer to the RDFa names. Both us and VE can support both formats as an input for a while to avoid caching issues, but should start by only emitting the new format.

See also:
http://json-ld.org/playground/index.html -- some example JSON-LD
Comment 1 Gerrit Notification Bot 2013-08-26 22:56:02 UTC
Change 81143 had a related patch set uploaded by Subramanya Sastry:
(Bug 53135) Step 1: Always use parts array for transclusion data-mw

https://gerrit.wikimedia.org/r/81143
Comment 2 Gerrit Notification Bot 2013-08-26 23:08:24 UTC
Change 81143 merged by jenkins-bot:
(Bug 53135) Step 1: Always use parts array for transclusion data-mw

https://gerrit.wikimedia.org/r/81143
Comment 3 ssastry 2013-08-26 23:14:20 UTC
The other changes in this ticket will require co-ordination with VE since it will break existing code.

This will also require the cached HTML versioning to be implemented to prevent weird editing errors between when parsoid is deployed and varnish caches or cleared.  Alternatively, VE and Parsoid serializer would have to handle old and new formats of data-mw temporarily.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links