eranroz created this task.
eranroz added projects: Documentation, MediaWiki-extensions-WikibaseClient.
Restricted Application added a subscriber: Aklapper.
Restricted Application added a project: Wikidata.

TASK DESCRIPTION
  I would like to have a formal definition for JS API to access Wikibase from 
client which will be documented somewhere 
(https://www.mediawiki.org/wiki/Extension:Wikibase_Client or subpage) and will 
be stable way to acess API.
  
  Below are some valid options, and it's totally fine if we don't want to 
commit to them to define a new dedicated module ("wikibase.api").
  
    // Option 1 (was working few months ago)
    mw.loader.using( [ 'wikibase.api.RepoApi', 
'wikibase.client.getMwApiForRepo' ] ).done(function() {
                        var wikidataApi = new 
wikibase.api.RepoApi(wikibase.client.getMwApiForRepo());
    }
    // Option 2 (works now)
    mw.loader.using( [ 'wikibase.api.RepoApi', 'mw.config.values.wbRepo' ] 
).done(function(){
                        var repoConfig = mw.config.get( 'wbRepo' );
                        var repoApi = new wikibase.api.RepoApi( 
wikibase.api.getLocationAgnosticMwApi(repoConfig.url + repoConfig.scriptPath + 
'/api.php') );

TASK DETAIL
  https://phabricator.wikimedia.org/T235913

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: eranroz
Cc: Aklapper, eranroz, Pavithraes, darthmon_wmde, DannyS712, Nandana, Cpaulf30, 
Lahi, Gq86, GoranSMilovanovic, Ivana_Isadora, Jayprakash12345, QZanden, 
LawExplorer, _jensen, rosalieper, srodlund, Wikidata-bugs, aude, Dinoguy1000, 
Mbch331, Jay8g, Quiddity
_______________________________________________
Wikidata-bugs mailing list
Wikidata-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikidata-bugs

Reply via email to