Rules Hub
Coding Rules Library
← Back to all rules
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
frontend ruleP1universalStack: HTML / JavaScript
performancethird-party-scriptsasyncpage-load
Load non-critical third-party scripts asynchronously
Scripts like reCAPTCHA that aren't needed until a later user action should be injected/loaded async rather than render-blocking; check the vendor's loading guide.
PR: hegnar-zephr-components · org-mining-hist-2026-06Created: Jun 19, 2026
Bad example
Old codehtml
| 1 | <script src="https://www.google.com/recaptcha/api.js?render=KEY"></script> <!-- render-blocking --> |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | const ele = document.createElement('script'); |
| 2 | ele.async = true; |
| 3 | ele.src = 'https://www.google.com/recaptcha/api.js?render=KEY'; |
| 4 | document.head.append(ele); |
Explanation (EN)
Objašnjenje (HR)