4371 shaares
tl;dr:
- To stay fast, only load JavaScript needed for the current page. Prioritize what a user will need and lazy-load the rest with code-splitting.
- Embrace performance budgets and learn to live within them. For mobile, aim for a JS budget of < 170KB minified/compressed. Budgets are critical to success, however, they can’t magically fix perf in isolation. Team culture, structure and enforcement matter.
- Learn how to audit and trim your JavaScript bundles. There’s a high chance you’re shipping full-libraries when you only need a fraction
- Every interaction is the start of a new ‘Time-to-Interactive’; consider optimizations in this context. Transmission size is critical for low-end mobile networks and JavaScript parse time for CPU-bound devices.
- If client-side JavaScript isn’t benefiting the user-experience, ask yourself if it’s really necessary