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: javascript
bundle-sizedependenciesperformancetradeoffs
Weigh bundle-size cost before adding a heavy dependency
Before pulling in a large library for a small feature, check the size impact and consider a lighter alternative; document the tradeoff.
PR: frontpage-web · org-mining-hist-2026-06Created: Jun 18, 2026
Bad example
Old codejavascript
| 1 | // Adds 118KB to commons.js for a handful of translated strings |
| 2 | import i18next from 'i18next'; |
Explanation (EN)
Objašnjenje (HR)
Good example
New codejavascript
| 1 | // Evaluated lighter options; chose the heavier lib deliberately for danish/dutch + plugin support, SSR + gzip mitigate size |
| 2 | import i18next from 'i18next'; |
Explanation (EN)
Objašnjenje (HR)