Page MenuHomePhabricator

POC - no-js information box
Closed, DeclinedPublic5 Estimated Story Points

Description

as a dev
I want to no recreate the box if its not needed
so that I don't do extra work

a/c

  • poc created
  • a decision is made on how to proceed

Event Timeline

karapayneWMDE set the point value for this task to 5.Apr 5 2022, 9:54 AM

The concept to prove would be:

  • in the submodule:
    • define the information box in Vue.js using Wikit
    • SSR it at build time, emitting a bunch of HTML with placeholders ($1, {{{LEMMA}}}, whatever) for all the dynamic components (lexeme ID, lemma and language code, language label and link, lexical category label and link) into a separate file (plus a companion CSS file)
  • in WikibaseLexeme.git:
    • copy this extra HTML and CSS into WikibaseLexeme.git, just like the current new-lexeme-dist files (not sure if this should also be in new-lexeme-dist or elsewhere)
  • in Special:NewLexeme:
    • load the dynamic content (i.e. the lexeme used, based on an interface message, and the labels of its language and lexical category items)
    • load the HTML from file
    • replace the placeholders with the right dynamic content
    • add that to the output page

Hm, I just realized: either we make the real i18n messages available to the SSR build step, or we also make all the messages placeholders.

Edit: Pretty sure it has to be the placeholder approach. We might (might!) be able to make the WikibaseLexeme.git i18n/ messages available to the build step, but I don’t see how that’s possible for the on-wiki messages (MediaWiki: namespace), and the messages in this box are likely ones that the wiki community will want to be able to override.

Change 778298 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@master] PoC: Use info message static HTML

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

Change 778487 had a related patch set uploaded (by Lucas Werkmeister (WMDE); author: Lucas Werkmeister (WMDE)):

[mediawiki/extensions/WikibaseLexeme@master] PoC: Inject info static HTML into NewLexemeAlpha

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

In a meeting, we evaluated the proof of concept and decided to also implement another approach (T305856). Once that’s ready, we’ll decide whether we’re happier with that version, or want to reconsider this one after all.

Change 778298 abandoned by Lucas Werkmeister (WMDE):

[mediawiki/extensions/WikibaseLexeme@master] PoC: Use info message static HTML

Reason:

in favor of Ica1060074d

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

Change 778487 abandoned by Lucas Werkmeister (WMDE):

[mediawiki/extensions/WikibaseLexeme@master] PoC: Inject info static HTML into NewLexemeAlpha

Reason:

in favor of Ica1060074d

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

We decided to go with the other approach instead (T305856).