Module talk:taxlink
Latest comment: 8 months ago by Theknightwho in topic Using Module:checkparams
Using Module:checkparams
[edit]@JeffDoozan I see you've implemented this with Module:checkparams, but I think this would be a good place to use Module:parameters instead, since this is a direct implementation of a template that takes a frame object. That being said, I may be misunderstanding your reasoning behind using one over the other! Theknightwho (talk) 23:30, 10 March 2024 (UTC)
- @Theknightwho: I'm glad you're double checking this stuff. This actually calls
Module:checkparams.process()
, which is pretty much just a wrapper aroundModule:parameters.process()
that returns a string of wikitext that can be injected into the page instead of generating an Lua error for invalid params. Since{{taxlink}}
has a bunch of existing uses with bad parameters, I want to generate the same warnings and categories thatModule:checkparams.warn()
does for the non-Lua templates like{{es-proper noun}}
and{{rfex}}
. Is there a noticeable overhead to using a wrapper function? JeffDoozan (talk) 00:10, 11 March 2024 (UTC)- @JeffDoozan That makes sense - thanks. There won't be much noticeable overhead on that, no.
- So long as you're not generating anything that can't be garbage collected you should be fine, even if you're generating a lot of objects (which you aren't here anyway, so far as I can tell). Theknightwho (talk) 00:23, 11 March 2024 (UTC)