Page MenuHomePhabricator

[Task] Move JS and PHP view code to separate repo
Closed, ResolvedPublic

Description

This should include templates, everything using wfTemplate and all jquery.wikibase widgets from lib/.

Content

Messages

  • wikibase-add
  • wikibase-add-badges
  • wikibase-addqualifier
  • wikibase-addreference
  • wikibase-alias-edit-placeholder
  • wikibase-aliases-empty
  • wikibase-aliases-input-help-message
  • wikibase-aliases-label
  • wikibase-badgeselector-badge-placeholder-title
  • wikibase-cancel
  • wikibase-claimview-snak-new-tooltip
  • wikibase-claimview-snak-tooltip
  • wikibase-description-edit-placeholder-language-aware (used in WikibaseRepo)
  • wikibase-description-empty
  • wikibase-description-input-help-message
  • wikibase-edit
  • wikibase-entityselector-more
  • wikibase-fingerprintgroupview-input-help-message
  • wikibase-fingerprintview-input-help-message
  • wikibase-label-edit-placeholder-language-aware (used in WikibaseRepo)
  • wikibase-label-empty
  • wikibase-label-input-help-message
  • wikibase-move-*
  • wikibase-property-footer
  • wikibase-propertypage-datatype
  • wikibase-remove
  • wikibase-remove-inprogress
  • wikibase-save (used in WikibaseRepo)
  • wikibase-save-inprogress
  • wikibase-sitelink-page-edit-placeholder
  • wikibase-sitelink-site-edit-placeholder
  • wikibase-sitelinkgroupview-input-help-message
  • wikibase-sitelinks-*
  • wikibase-sitelinks-input-help-message
  • wikibase-snakformat-invalid-value (used in WikibaseRepo)
  • wikibase-snakformat-propertynotfound
  • wikibase-snakview-choosesnaktype
  • wikibase-snakview-property-input-placeholder
  • wikibase-snakview-variation-datavaluetypemismatch
  • wikibase-snakview-variation-datavaluetypemismatch-details
  • wikibase-snakview-variation-nonewvaluefordeletedproperty
  • wikibase-snakview-variations-novalue-label
  • wikibase-snakview-variations-somevalue-label
  • wikibase-statements
  • wikibase-statementview-rank-deprecated
  • wikibase-statementview-rank-normal
  • wikibase-statementview-rank-preferred
  • wikibase-statementview-referencesheading-pendingcountersubject
  • wikibase-terms
  • wikibase-ui-pendingquantitycounter-nonpending
  • wikibase-ui-pendingquantitycounter-pending
  • wikibase-ui-pendingquantitycounter-pending-pendingsubpart

Dependencies

Messages

  • pagetitle (in core)
  • parentheses (in core, used in WikibaseClient as well)
  • toc (in core)
  • wikibase-deletedentity- (in WikibaseLib)
  • wikibase-sitelinks-sitename-* (not wikibase-sitelinks-sitename-columnheading, that's used in WikibaseClient) (in WikibaseLib)
  • wikibase-snakview-snaktypeselector-* (in WikibaseLib)
  • word-separator

Details

Reference
bz73020

Related Objects

StatusAssignedTask
ResolvedAddshore
ResolvedAddshore
InvalidNone
DeclinedNone
ResolvedTobi_WMDE_SW
ResolvedAddshore
OpenNone
OpenNone
ResolvedJeroenDeDauw
ResolvedJeroenDeDauw
ResolvedAddshore
DeclinedTobi_WMDE_SW
Resolvedadrianheine
Resolvedadrianheine
Resolvedadrianheine
Duplicateadrianheine
Resolvedadrianheine
Resolvedadrianheine
ResolvedLydia_Pintscher
OpenNone
OpenNone
OpenNone
OpenNone
Resolvedadrianheine
OpenNone
InvalidNone
OpenNone
DeclinedNone
Resolvedthiemowmde
ResolvedAddshore
ResolvedJanZerebecki
ResolvedJeroenDeDauw
ResolvedAddshore
DeclinedNone
OpenNone

Event Timeline

bzimport raised the priority of this task from to Normal.Nov 22 2014, 3:49 AM
bzimport set Reference to bz73020.
bzimport added a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).
Lydia_Pintscher removed a subscriber: Unknown Object (MLST).

After all my pending changes are merged in, the PHP part of the (potential) repository looks like this:

Content:

  • Wikibase\Repo\View\*
  • wfTemplate
  • repo/tests/phpunit/includes/View/*

Dependencies:

  • wikibase/data-model
    • Wikibase\DataModel\*
  • data-values/data-types
    • DataTypes\DataType (PropertyView)
  • data-values/data-values
    • DataValues\StringValue
  • data-values/interfaces
    • ValueFormatters\FormatterOptions (EntityViewFactory)
    • ValueFormatters\FormattingException (SnakHtmlGenerator)
    • ValueFormatters\ValueFormatter (EntityViewFactory)
  • »WikibaseLibInterfaces«
    • Wikibase\Lib\EntityIdFormatter
    • Wikibase\Lib\EntityIdFormatterFactory
    • Wikibase\Lib\SnakFormatter (EntityViewFactory, SnakHtmlGenerator)
    • Wikibase\Lib\Store\EntityLookup (EntityViewFactory, SiteLinksView)
    • Wikibase\Lib\Store\EntityRevisionLookup (EntityViewPlaceholderExpander)
    • Wikibase\Lib\Store\LabelLookup
    • Wikibase\Lib\Store\StorageException (EntityViewPlaceholderExpander)
  • Bogus
    • Wikibase\EntityRevision (EntityView, PropertyView, ItemView)
    • Wikibase\LanguageFallbackChain (EntityViewFactory)
    • Wikibase\Lib\OutputFormatSnakFormatterFactory (EntityViewFactory)
    • Wikibase\Lib\Serializers\ClaimSerializer (ClaimHtmlGenerator)
    • Wikibase\UserLanguageLookup (EntityViewPlaceholderExpander)
    • Wikibase\Utils (SiteLinksView, TermBoxView)
  • mediawiki/core
    • Html (EntityView)
    • Message (SectionEditLinkGenerator, SiteLinksView, TermBoxView)
    • MessageCache
    • Language (EntityViewFactory, EntityView, TermBoxView, EntityViewPlaceholderExpander)
    • MediaWikiLangTestCase
    • MediaWikiSite
    • MediaWikiTestCase
    • MWException (EntityViewPlaceholderExpander)
    • Sanitizer (SiteLinksView)
    • Site (SiteLinksView)
    • SiteList (SiteLinksView)
    • SpecialPageFactory (SectionEditLinkGenerator)
    • Title (TermBoxView, EntityViewPlaceholderExpander)
    • User (EntityViewPlaceholderExpander)
    • wfMessage
    • wfProfileIn
    • wfProfileOut
    • wfWarn
    • wfUrlencode
    • wfRandom

I forgot Wikibase\Template and Wikibase\TemplateRegistry. Also, Wikibase\Lib\EntityIdFormatter is probably bogus, since it's not an interface.

https://gerrit.wikimedia.org/r/#/c/180431/ makes EntityIdFormatter an interface, so it's not bogus anymore.

https://gerrit.wikimedia.org/r/180450 extracts UserLanguageLookup interface. With that, View does not depend on Repo anymore.

@adrianheine what are the outstanding pending changes to move forward here and can you link them please?

https://gerrit.wikimedia.org/r/#/c/180431/ and https://gerrit.wikimedia.org/r/#/c/180450/. After that, Wikibase\Repo\View should not depend on WikibaseRepo anymore.

There are still some bad dependencies to WikibaseLib (definitely: Wikibase\Lib\OutputFormatSnakFormatterFactory, Wikibase\Lib\Serializers\ClaimSerializer, maybe: Wikibase\EntityRevision, Wikibase\LanguageFallbackChain, Wikibase\Utils), though.

I'll probably need to create subtasks for the following (unless they are trivial):

  • Move Wikibase\Repo\View to Wikibase\View
  • Identify contents
    • Identify JS files that will belong to WikibaseView
    • Identify PHP files that will belong to WikibaseView
    • Identify messages
  • Create base files
    • composer.json
    • WikibaseView.php
  • Put files in new repository
  • Add CI jobs
  • Remove files from Wikibase.git and add dependency

Additional subtask I need to create (and do): Move messages between lib and repo (messages used in lib need to be moved to lib, messages used in repo need to be moved to WikibaseView)

@JeroenDeDauw pointed out several things:

  • It's quite suspicious to depend on factories (OutputFormatSnakFormatterFactory, EntityIdFormatterFactory); it's better to use own (formatting) interfaces WikibaseRepo can then implement based on its factories
  • EntityIdFormatter could probably move to datamodel
adrianheine updated the task description. (Show Details)Jan 29 2015, 8:23 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 6 2015, 5:05 AM
JanZerebecki renamed this task from Move JS and PHP view code to separate repo to [Task] Move JS and PHP view code to separate repo.Sep 10 2015, 3:32 PM

The project is named MediaWiki-extensions-WikibaseView, but it should become a component that does not depend on Mediawiki, right?

Then we should rename the project.

Even if some component does not depend on MediaWiki, I'd still consider it a MediaWiki extension if it optionally provides MediaWiki integration. Currently, all our resource loading happens through ResourceLoader, and that won't change soon.

Bene added a subscriber: Bene.Feb 23 2016, 10:17 AM
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptApr 19 2016, 9:12 PM
Danny_B renamed this task from [Task] Move JS and PHP view code to separate repo to [Task] Move JS and PHP view code to separate repo (tracking).May 27 2016, 5:59 PM
adrianheine renamed this task from [Task] Move JS and PHP view code to separate repo (tracking) to [Task] Move JS and PHP view code to separate repo.May 30 2016, 7:49 AM

There is nothing tracking about this task. It's just a big task, but it's a clearly defined one which requires to do one thing and one thing only to be finished. It just has a lot of prerequisites.

Restricted Application added a subscriber: PokestarFan. · View Herald TranscriptJul 26 2017, 11:42 PM
Addshore closed this task as Resolved.Jul 12 2018, 3:19 PM
Addshore claimed this task.
Addshore added a subscriber: Addshore.

The code is now all split up in different git repos included as submodules, and can also be found as npm packages.
https://github.com/wikimedia/mediawiki-extensions-Wikibase/tree/2454496a7210a34b57bf06679efcffc957808a34/view/lib

Restricted Application added a project: User-Addshore. · View Herald TranscriptJul 12 2018, 3:19 PM