Page MenuHomePhabricator

Unified extension registration mechanism for core/VE/Parsoid
Closed, ResolvedPublic0 Estimated Story Points

Description

UPDATE 2020-04-10: The below text was written back in Parsoid/JS days, but the need for a unified registration mechanism is still present in Parsoid/PHP days. For VE, you just add yourself to VisualEditorPluginModules in extension.json; we should be able to autodetect a ParsoidPluginModules section the same way.

There should be a way for extensions to bundle the needed support code for VE and Parsoid in the same directory structure they use for mediawiki core. "Installing" support in VE and Parsoid for a new extension should just be unzipping an extension in a specific directory. For small wikis where Parsoid and VE are on the same host, then you ought to be able to ln -s /var/www/mediawiki/extensions /opt/srv/parsoid/extensions and only unzip the extension once.

Once this is in place, we ought to document and evangelize this mechanism, perhaps with a simple"Hello, World" extension that shows how support for all three pieces is written.

(01:58:57 PM) cscott-free: James_F: is there a convention for how extensions register VE support yet?  that should be easier, it's in a single directory tree still.
(01:59:46 PM) James_F: cscott: Yeah, it's trivial. See the bottom of https://gerrit.wikimedia.org/r/#/c/284681/4/extension.json
(01:59:57 PM) James_F: cscott: Add yourself as a "VisualEditorPluginModules"
(02:00:03 PM) cscott-free: James_F: ok, a good start!

ps. if you use node-php-embed, you can run everything from one install dir and one process group. ;)

Event Timeline

Arlolra triaged this task as Medium priority.Apr 21 2016, 6:24 PM

Change 284738 had a related patch set uploaded (by Cscott):
Add autoload mechanism for user extension code.

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

Jdforrester-WMF renamed this task from Unified extension registration mechanism for core/VE/Parsoid. to Unified extension registration mechanism for core/VE/Parsoid.Apr 25 2016, 7:12 PM
Jdforrester-WMF assigned this task to cscott.
Jdforrester-WMF lowered the priority of this task from Medium to Low.
Jdforrester-WMF set the point value for this task to 0.
Jdforrester-WMF moved this task from To Triage to TR0: Interrupt on the VisualEditor board.

Change 284738 merged by jenkins-bot:
Add autoload mechanism for user extension code.

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

Change 295707 had a related patch set uploaded (by Cscott):
Allow extensions to handle specific contentmodels.

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

Change 295707 merged by jenkins-bot:
Allow extensions to handle specific contentmodels.

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

Change 594210 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/services/parsoid@master] Use wikimedia\object-factory for extension objects; hook up ExtensionRegistry

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

Change 597639 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Add 'ParsoidModules' as a top-level core attribute in extension.json

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

Change 597639 merged by jenkins-bot:
[mediawiki/core@master] Add 'ParsoidModules' as a top-level core attribute in extension.json

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

Change 594210 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Use wikimedia\object-factory for extension objects; hook up ExtensionRegistry

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

Change 601412 had a related patch set uploaded (by C. Scott Ananian; owner: C. Scott Ananian):
[mediawiki/core@master] Fill in the 'name' field in ParsoidModules registration

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

Change 603571 had a related patch set uploaded (by Subramanya Sastry; owner: Subramanya Sastry):
[mediawiki/vendor@master] Bump Parsoid to v0.12.0-a16

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

Change 603571 merged by jenkins-bot:
[mediawiki/vendor@master] Bump Parsoid to v0.12.0-a16

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

Change 601412 merged by jenkins-bot:
[mediawiki/core@master] Fill in the 'name' field in ParsoidModules registration

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

All patches merged; is there more work to do here?

Nope, I'm going to claim this as done.

We haven't yet moved any extension code from Parsoid out into the extension itself, because we're blocked by T254181, but the registration mechanism landed.