User talk:Bfdifan2006/Template:Movehead

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search

Hi, these look really great. First off, thank you for making these, I like the way you went about it, the parameters are very clear. Can I ask why they don't work with the "display: none" feature? I am not being confrontational, I still 100% trust your judgment, I'm just curious as to what exactly causes the incompatibility between the two. I see that the columns can be hidden in the egg move header, so maybe if we just had "gen(n)=no" options, that could work? I could be saying something dumb here, of course. Oneofthosedf (talk) (contribs) 22:15, 28 March 2022 (UTC)

They would work with the display: none property, but I'm trying to make a template that doesn't use this because everything with display: none is still technically visible to the MediaWiki parser. My solution that uses parser functions wrapped around the whole cell will be more beneficial for the total template include size. Possibly when Pokémon Scarlet and Violet release, we would have our first worries about the include size for most-learned moves, such as Tackle. --Bfdifan2006 (T/C) 05:53, 29 March 2022 (UTC)
Why exactly is that beneficial? Also, there shouldn't be any worries about new games, because we could easily get 3 different games in three different generations again in the next 3 years. You also might as well add Gen IX to these templates to test it. Oneofthosedf (talk) (contribs) 13:45, 29 March 2022 (UTC)
It reduces the total template include size, which could reduce the time a page needs to load. Compare the current {{Movehead/Level}} template and my movehead template. If you compare the bytesizes of the resulting strings (assuming inputs of ice and 8 in both cases, in that order, and, for my version, also level), then the first one has a bytesize of 1,937 bytes. My version has just 1,408 bytes. I know, I don't currently know how to hide the bottom row with just using a parser function, but if I knew how to, then I would have 1,314 bytes in total. Because I accidentally duplicated the line-height, color and background properties in some cases, and some semicolons at the end, if I fixed these, then it's just 1,178 bytes. And if the {{roundy}} template (and its subtemplates) are edited so there are no properties with vendor prefixes, and there are no spaces between properties and values in it, it would become even less: a neat 825 bytes.
Another advantage to using my version is that we won't need separate versions for level-up and breeding learnlists. --Bfdifan2006 (T/C) 19:48, 29 March 2022 (UTC)
If you're curious how I took the exact fully expanded wikicode for these, then I used Special:ExpandTemplates. --Bfdifan2006 (T/C) 20:14, 29 March 2022 (UTC)
Alright, keep up the good work, I'm sure you'll figure out. That loading reduction is massive. I don't have to worry about it now, but I sure would have appreciated it when I was younger with a worse setup. I've seen you code some pretty impressive stuff, and you seemed to have figured out all of those as well. I wish I could help with this, but I can only give you encouragement. Again, very thankful for the help. Oneofthosedf (talk) (contribs) 20:28, 29 March 2022 (UTC)