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 ruleP2universalStack: react
performancelazy-loadingpreload
Preload heavy editor resources only when the user is about to need them
Defer loading of large optional dependencies (e.g. a rich text editor) until interaction is imminent rather than on initial page load.
PR: hegnar-forum-web · org-mining-hist-2026-06Created: Jun 20, 2026
Bad example
Old codetsx
| 1 | // editor bundle eagerly loaded in <head> on every page |
Explanation (EN)
Objašnjenje (HR)
Good example
New codetsx
| 1 | // preload only when the user opens the editor, before they interact |
| 2 | onEditorOpen(() => preloadEditorAssets()); |
Explanation (EN)
Objašnjenje (HR)