Performance: Why Remix forms work without JavaScript
MEDIUM IMPACT
This concept affects page load speed and interaction responsiveness by enabling form submissions without relying on JavaScript.
<form method="post" action="/submit">...</form> using native HTML form submission handled by Remix server
<form onSubmit={handleSubmit}>...</form> with JavaScript handling submission and no fallback| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| JS-dependent form submission | Multiple event listeners and DOM updates | Triggers reflows on validation and dynamic UI changes | Higher paint cost due to JS-driven UI updates | [X] Bad |
| Native HTML form submission (Remix default) | Minimal DOM operations, uses browser default | Single reflow on page navigation | Low paint cost, no JS UI updates needed | [OK] Good |