Jump to content

Module talk:taxlink

Page contents not supported in other languages.
Add topic
From Wiktionary, the free dictionary
Latest comment: 9 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)Reply

@Theknightwho: I'm glad you're double checking this stuff. This actually calls Module:checkparams.process(), which is pretty much just a wrapper around Module: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 that Module: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)Reply
@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)Reply