Lucas_Werkmeister_WMDE added a comment.

  Getting the config into termbox will probably be the trickiest part. We can 
get a value using `mwWindow.mw.config.get()` in `client-entry.ts`, but for that 
we need something to define the new config variable; a new ResourceLoader 
module would be easy (like `mw.config.values.wbSiteDetails` or 
`mw.config.values.wbRepo`), but each new ResourceLoader module carries a cost, 
so ideally we’d like to avoid that.
  
  I think it might be possible to squash this into the same module, with 
something like
  
    'wikibase.termbox' => $wikibaseTermboxPaths + [
        'class' => TermboxModule::class,
        'packageFiles' => [
            'termbox-entry.js',
            [
                'name' => 'config.json',
                'content' => [ ... ], // JSON-encoded by ResourceLoader
            ],
            'dist/wikibase.termbox.main.js',
        ],
        // ...
    ],
  
  where `termbox-entry.js` is something like
  
    mw.config.set( 'wbTermboxConfig', require( './config.json' ) );
    require( 'dist/wikibase.termbox.main.js' );
  
  to move the config from the package file (which the webpack’ed termbox 
probably can’t access directly?) into `mw.config` and then load the real 
entrypoint. But that requires `packageFiles`, and I don’t know if termbox will 
work in that mode (currently it’s a legacy / `"scripts"` module).

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

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

To: Lucas_Werkmeister_WMDE
Cc: Lucas_Werkmeister_WMDE, Aklapper, Invadibot, maantietaja, Akuckartz, 
Iflorez, alaa_wmde, Nandana, Lahi, Gq86, GoranSMilovanovic, QZanden, 
LawExplorer, _jensen, rosalieper, Scott_WUaS, Wikidata-bugs, aude, 
Lydia_Pintscher, Mbch331
_______________________________________________
Wikidata-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to