Shipping JS: bundle size, linting, testing, security headers, and observability.
Checklist
- ESLint + Prettier in CI
- Unit tests (Vitest/Jest) for pure logic
- Minify and tree-shake production bundles
- Content-Security-Policy and no secrets in client bundles
- Error monitoring (Sentry, etc.)
- Performance: lazy routes, image optimization
Security tie-in
Review OWASP intro for XSS, CSRF, and broken access control in apps you build.
Important interview questions and answers
- Q: Why CSP?
A: Restricts script sources—mitigates XSS impact. - Q: Secrets in front-end?
A: Never—API keys in bundles are public.
Self-check
- Name two tools for quality.
- Why lazy-load routes?
Tip: Pair with /cybersecurity/intro for secure shipping habits.
Interview prep
- CSP?
Content-Security-Policy restricts resource loading.