Performance: Webpacker and JavaScript bundling
HIGH IMPACT
This affects how quickly JavaScript files load and execute, impacting page load speed and interactivity.
use Webpacker's code splitting and dynamic imports to load JavaScript on demandimport all scripts in one large bundle without code splitting or lazy loading
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Single large bundle | Minimal DOM impact | 1 reflow after script execution | High paint cost due to delayed rendering | [X] Bad |
| Code splitting with lazy loading | Minimal DOM impact | 1 reflow after critical scripts | Lower paint cost, faster rendering | [OK] Good |