The summary.
REQUEST PERMISSION AT THE MOMENT THE FEATURE IS USED, WITH CONTEXT
Asking on page load gets refused permanently, and cannot easily be asked again.
Always build a functioning experience without the capability.
NEVER STORE SECRETS OR SENSITIVE DATA IN THE BROWSER
It is visible and editable by the user, and readable by any script on the page.
Assume storage may be absent, cleared or full.
USE THE SIMPLEST REAL-TIME MECHANISM THAT FITS
Server-sent events where only the server needs to send; websockets where both do.
Never assume a connection persists — handle reconnection, duplicates and out-of-order messages.
SERVICE WORKERS MATTER MOST WHERE CONNECTIVITY VARIES AND DATA IS METERED
But a faulty one can make a site unreachable until replaced. Test offline and on a slow connection.
WEB COMPONENTS DO NOT PROVIDE ACCESSIBILITY
Encapsulation isolates styles, not keyboard operability or announcement. Implement those deliberately.
THE NETWORK PANEL REVEALS WHAT NOBODY INTENDED
Failing requests, oversized assets, and requests nobody knew were being made.