Guidelines:Modules: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
No edit summary
(4 intermediate revisions by 2 users not shown)
Line 2: Line 2:
{{Big|Overview|3}}<br/>
{{Big|Overview|3}}<br/>


'''Modules''' are {{Wp|Lua (programming language)|Lua}} scripts for making [[Help:Templates|templates]] using a full-fledged programming language. You can ask questions about Zelda Wiki modules in the <code>#modules-and-templates</code> [{{Discord}} Discord] channel.
'''Modules''' are {{Wp|Lua (programming language)|Lua}} scripts for making [[Help:Templates|templates]] using a full-fledged programming language. You can ask questions about Zelda Wiki modules in {{Discord|channel= wiki-tech}}.


==Templates==
==Templates==
Line 309: Line 309:
High-usage modules may require additional effort for them to work well at scale. "High usage" can mean one of two things:
High-usage modules may require additional effort for them to work well at scale. "High usage" can mean one of two things:


'''Modules used many times per page'''
'''1. Modules used many times per page'''


Examples: [[Module:Cite|Cite]], [[Module:Color|Color]], [[Module:Term|Term]]. Some pages invoke these modules 300+ times.
Examples: [[Module:Cite|Cite]], [[Module:Color|Color]], [[Module:Term|Term]]. Some pages invoke these modules 300+ times.
Line 320: Line 320:
* Follow https://dev.fandom.com/wiki/Lua_templating/Optimisation
* Follow https://dev.fandom.com/wiki/Lua_templating/Optimisation


'''Modules used on many pages'''
'''2. Modules used on many pages'''


Examples: [[Module:FileInfo|FileInfo]], [[Module:Franchise|Franchise]], [[Module:UtilsArg|UtilsArg]].
Examples: [[Module:FileInfo|FileInfo]], [[Module:Franchise|Franchise]], [[Module:UtilsArg|UtilsArg]].


Every time such a module is updated, every page that uses it (directly or indirectly) must be updated. This can set off a large {{Mediawiki|Manual:Job queue|job queue}}. When there are many active jobs in the queue, any changes to other templates (high-usage or no) may take several hours to propagate to all the pages that use them.
Every time such a module is updated, every page that uses it (directly or indirectly) must be updated. This can set off a large {{Mediawiki|Manual:Job queue|job queue}}. When there are many active jobs in the queue, any changes to other templates (high-usage or no) may take several hours to propagate to all the pages that use them. The same goes for [[Special:ReplaceText]] operations, which are also sent to the back of the job queue.


What you can do:
What you can do:
Line 336: Line 336:


To generate a profiler report, preview a page on the wiki. The report is located at the bottom of the page under the editing area, in the '''Parser profiling data:''' section which may be collapsed by default. It looks something like this:
To generate a profiler report, preview a page on the wiki. The report is located at the bottom of the page under the editing area, in the '''Parser profiling data:''' section which may be collapsed by default. It looks something like this:
The Lua Profile section only appears when total Lua time usage on the page is above 1000ms. <!-- I think. -->


{| class="wikitable"
{| class="wikitable"
Line 370: Line 368:
|[others] || 320 ms || 23.5%
|[others] || 320 ms || 23.5%
|}
|}
The Lua Profile section only appears when total Lua time usage on the page is above 1000ms (1 second). <!-- I think. -->


{{Guidelines Nav}}
{{Guidelines Nav}}

Navigation menu