Closed Bug 1449297 Opened 7 years ago Closed 5 years ago

Add a way to see information about which macros are run during page load

Categories

(developer.mozilla.org Graveyard :: KumaScript, enhancement, P3)

All
Other
enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: sheppy, Unassigned)

Details

(Keywords: in-triage, Whiteboard: [specification][type:feature][points:6+])

What problem would this feature solve? ====================================== While debugging macros, one often runs into one of these situations: 1. You're working on a macro and need to find a place that uses it -- but because it's a sub-macro that gets called (possibly conditionally) by other macros, you can't just use the All Templates page, or a Github search, to find out what you can reliably load to see that macro in action. 2. You're working on fixing a submacro but because it's used conditionally, you don't know if it's running at all, so you can't be entirely sure your tests are actually ensuring that your changes are working. 3. You're working on content and a macro is acting unexpectedly; being able to follow the macro call hierarchy can help understand why behavior isn't as expected. In all of these cases, being able to know for certain which macros are being run and in what order could make debugging vastly simpler. Who has this problem? ===================== Core contributors to MDN How do you know that the users identified above have this problem? ================================================================== I'm one of them. I've found this frustrating for ages, and have heard mentions of this from other writers on the staff. How are the users identified above solving this problem now? ============================================================ A lot of trial and error every time one of these scenarios come up. Do you have any suggestions for solving the problem? Please explain in detail. ============================================================================== I propose the addition of an option (perhaps available only on local installs) that displays or dumps or whatever a hierarchical listing of the macros that get executed. This shouldn't be too difficult -- the output can be generated from the macros-worker.js script in the KumaScript engine by inserting before "tmpl.execute()" on line 105 conditional code to output the name of the template being executed. When recursion occurs, a number would have to be maintained to track depth for the indentation part, but otherwise should be fairly straightforward, I hope (of course, this is based on a 10-minute review of the code, so...) Is there anything else we should know? ======================================
Keywords: in-triage
Priority: -- → P3
Whiteboard: [specification][type:feature] → [specification][type:feature][points:6+]
MDN Web Docs' bug reporting has now moved to GitHub. From now on, please file content bugs at https://github.com/mdn/sprints/issues/ and platform bugs at https://github.com/mdn/kuma/issues/.
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.