Page MenuHomePhabricator

Extend JS/PHP hybrid testing to other Parsoid components
Closed, ResolvedPublic

Description

Currently JS/PHP hybrid testing is enabled for "sync" token transformers and full DOM transformations.

We can / should enable this for at least the following additional components.

  • Tokenizer
  • "async" token transformers
  • DOM Traverser based handlers
  • DOM Diff
  • DOM Normalization
  • Serialization
  • Extensions

This will require us to adopt a new format for the config file. Here is one possibility:

wt2html:
   Tokenizer: yes
   TT:
     ParagraphWrapper: no
     QuoteTransformer: no
     PreHandler: no
     ListHandler: no
   DOM:
     PWrap: no
     ComputeDSR: no
     WrapSections: no

html2wt:
  DOMDiff: no
  DOMNormalizer: no
  
exts:
  Cite: no
  Poem: no

Replace yes/no with your choice of boolean (true/false, 1/0 .. ) if yes/no doesn't feel right.

Event Timeline

ssastry triaged this task as Medium priority.Mar 23 2019, 2:16 PM
ssastry created this task.

This will require us to adopt a new format for the config file. Here is a possible template for the new format.

Thinking aloud: The format could probably also include another setting for transformers that need offset mapping when we cross JS <-> PHP language boundaries. The easy thing to do would be to do this for everything, but if some code doesn't really care about offsets and substrings, we don't have to wait on T219069: Reconcile byte offsets coming from Tokenizer with unicode char offsets used by rest of ported code for getting this done.

Change 500992 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] Generalize php config yaml layout

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

Change 500992 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Generalize php config yaml layout

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

Change 501342 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/services/parsoid@master] WIP: Add support to splice PHP DOMDiff into parse pipeline

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

Change 501342 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Support splicing more PHP components into the parse pipeline

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