Page MenuHomePhabricator

Don't send the whole JS module for static FEN display
Closed, ResolvedPublic


The <fen></fen> tags don't use javascript to display content, and they don't use all of the CSS that <pgn></pgn> tags use. The code currently sends the whole JS and CSS module used by the PGN even when just the FEN position is needed.

  • Modularize the resources modules into
    • CSS for board display
    • CSS for Metadata, game notation, and buttons
    • JS for board animation
  • Modify code to send smallest module component needed to display page content
    • Revise extension.json to list the javascript and css modules from above
    • Edit <fen> rendering to set a trigger different from ChessViewerTrigger used by <pgn>
    • Edit ChessBrowserHooks::onOutputPageParserOutput to determine what modules should be sent based on triggers set and send them

Event Timeline

Change 724510 had a related patch set uploaded (by TheDJ; author: TheDJ):

[mediawiki/extensions/ChessBrowser@master] Only deliver CSS module for FEN

I don't think its needed to split the CSS styles module. Technically yes, they are somewhat separate, but the amount of additional CSS is not insane and more important won't be included on many pages. Compare that to the fact that modules are actually expensive (every module name is shipped to every single page).

We could split the files of course. Just for developer ease...

Change 724510 merged by jenkins-bot:

[mediawiki/extensions/ChessBrowser@master] Only deliver CSS module for FEN

TheDJ moved this task from In Progress to Completed on the ChessBrowser board.