Frontend
- Islands Architecture - encourages small, focused chunks of interactivity within server-rendered web pages
async vs defer Link to heading
- Tweet
- Both
- Doesn’t block page loading and rendering.
- async
- Runs immediately after download.
- No guaranteed execution order (might differ from the order in the HTML)
- Beneficial for stand-alone scripts, not affecting initial DOM.
- defer
- Waits for HTML parsing to finish.
- Maintains script order in the document (beneficial for scripts that rely on each other)
- Beneficial for scripts that are not necessary until the page content has been loaded.
Frameworks Link to heading
- Alpine.js - Your new, lightweight, JavaScript framework.
- htmx - high power tools for HTML
- htmz
- hyperscript - An easy & approachable language for modern web front-ends
Math Notation Link to heading
Storages Link to heading
Type | Capacity | Supported Types | Lifetime | Access | |
---|---|---|---|---|---|
Cookies | 4KB | Strings | until expiration date or manually deleted by user or webapp | Shared between tabs and windows and with the server | |
Session Storage | 5MB | Strings | until tab is closed | Not shared between tabs or windows | |
Local Storage | 5MB | Strings | until manually deleted by the user or webapp | Shared between tabs and windows | |
IndexedDB | >50MB | Keys (Strings) and Values (objects, arrays, binary, etc.) | until manually deleted by the user or webapp | Shared between tabs and windows |
- Please Stop Using Local Storage - string only; synchronous; can’t be used by web workers; Any JavaScript code on your page can access;
- OWASP - HTML5 Security Cheat Sheet # Local Storage
- HTML Standard - Web Storage
References: