Module talk:Items

State of this project
The main goal is for this module to integrate with Module:Categories so that on each item page, the item navs are generated with tabs for each game. At this point the biggest hurdle is handling the loading time. On average, each game nav adds 1 second to the initial page load. This cost is difficult to justify given that the navs are non-essential.

Initially I thought the image maps were the problem but from some quick ad-hoc tests it seems like the "rows" are more costly (from loading each image individually?). We need to figure out how to cut down the loading time, or at least work around it. Maybe if there was some way to load the nav and inject it after the initial document load, perhaps using parse API? Just a theory.

This is not a priority for me right now so I'm letting it go, in the hopes that someone else (or a future version of myself) can eventually pick it up.

An easier shorter term goal would be to add each game nav to its respective item listings. PhantomCaleb (talk) 13:09, 13 October 2020 (UTC)


 * I was able to make progress on this and cut down the average nav loading time to ~200-300ms. Fandom recently enabled LuaSandbox on Gamepedia wikis which times the most expensive Lua functions.
 * There's still some optimization and testing to do, but we're at the point where it may be reasonable to show a handful of these per page. PhantomCaleb (talk) 13:00, 23 October 2020 (UTC)

Why all games still get their own template
Since all the item navigation templates are now generated from this module, folks may wonder why I bothered keeping templates for each game. It would've been just as easy to make one master template that gives you a game's item nav by typing.

The reason was to prevent lock-in. I wanted folks to be able to create item nav templates the old fashioned way using  tags and not have to use this module at all. This covers potential future scenarios where the module doesn't do everything we need it to and there's no one left with the skills to change it. PhantomCaleb (talk) 13:08, 23 October 2020 (UTC)