Jump to content

Topic on Talk:Parsoid/PHP

What is Extension:Parsoid?

5
Summary by Cscott

Updated a bunch of docs to try to clarify the relationship between the Parsoid extension and the parsoid library.

Ciencia Al Poder (talkcontribs)

I'm extremely confused by this. I've deleted a reference to Extension:Parsoid which is old, outdated and archived, but the configuration of this page is using:

wfLoadExtension( 'Parsoid', "$PARSOID_INSTALL_DIR/extension.json" );

This page was created on 2019. The Parsoid extension was deprecated long ago. How could it be possible? Either this configuration is utterly outdated (it was already outdated on creation!) or there's some other hidden Parsoid extension that I'm not aware of.

@Cscott, please explain

Skizzerz (talkcontribs)

That line is stating to use the extension.json of the downloaded Parsoid/PHP, presumably because it has been implemented as an extension. See also the note below that: "Note that the business with $PARSOID_INSTALL_DIR and AutoLoader::$psr4Namespaces is only necessary for developers, who want to ensure they are running from the latest git version of Parsoid, not the version included in mediawiki-core as a library."

So, that wfLoadExtension is only necessary for developers who want to use a version of Parsoid other than the one shipped with mediawiki

Ciencia Al Poder (talkcontribs)

If there's an extension.json, it should appear in Special:Version, but it does not: Special:Version

AFAIK, WMF is using RESTBase, but they're not using this extension, and their rest.php api doesn't support the /v3/ URL paths that this "extension" is implementing. However, I'm unable to use VE because I have RESTBase installed for mathoid, and it keeps trying to contact parsoid at /v3/ URLs, which is task T263928

Jdforrester (WMF) (talkcontribs)

Everything about the Parsoid integration into MediaWiki is a hack right now. We're going to normalise it in the next year or so, but yes, there's a fake extension inside Parsoid (in vendor/) which adds the REST routes, for now, because no-one could agree on putting them in core and so encouraging others to use the deprecated system we'd need to use until the new one is built.

Cscott (talkcontribs)

What @Jdforrester (WMF) said. The Parsoid service is loaded as an extension currently to register some routes and remove some circular dependencies between the Parsoid library and core. This is distinct from the old Extension:Parsoid and thanks for removing that erroneous reference.

Incidentally, the configuration information for Parsoid was moved to the main Parsoid page with the release of MW 1.35; I hadn't noticed that there was an old out-of-date copy here as well. I've ported some useful changes made here back to the main configuration description on Parsoid and removed the duplicate here.