bhavyasaggi.github.io
Sitemap

Frontend

How Browsers Work

  1. DNS LookupTCP ConnectionHTTP Request
  2. HTML ParsingDOM Construction
  3. CSS ParsingCSSOM Construction
  4. Render TreeLayoutPaintComposite
flowchart LR
    HTML --> DOM[DOM Tree]
    CSS --> CSSOM
    DOM --> RT[Render Tree]
    CSSOM --> RT
    RT --> Layout
    Layout --> Paint
    Paint --> Composite

Minimize critical path length by optimizing the order in which critical resources are loaded.

<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="dns-prefetch" href="https://api.example.com" />
<link rel="preload" href="critical.css" as="style" />
<link rel="prefetch" href="next-page.html" />

WAI-ARIA

"Web Accessibility Initiative - Accessible Rich Internet Applications" allows a set of additional HTML attributes to provide semantics and accessibility, wherever it is lacking. These are broadly categorized into:

<!-- Semantic HTML first -->
<button aria-label="Close dialog" aria-expanded="false">
  <span aria-hidden="true">&times;</span>
</button>

<!-- Live regions -->
<div aria-live="polite" id="status"></div>
<div aria-live="assertive" id="errors"></div>

<!-- Landmarks -->
<nav aria-label="Main navigation">
  <main aria-labelledby="main-heading">
    <aside aria-label="Related links"></aside>
  </main>
</nav>

Web Security

CORS

A bane of all web-devs, a boon to all web-surfers. Read more: https://jakearchibald.com/2021/cors/

Web Data Sharing

Browsers can store up to 5 MiB of local storage, and 5 MiB of session storage per origin.

Web Vitals

Popular metrics measuring many of the various aspects of performance relevant to users:

Each Core Web Vitals metric has associated thresholds, which categorize performance as either "good", "needs improvement", or "poor":

Good Poor Percentile
Largest Contentful Paint <2500ms >4000ms 75
Interaction to Next Paint <200ms >500ms 75
Cumulative Layout Shift <0.1 >0.25 75

UI Loading Patterns

How and when content is loaded is important. The approaches can broadly classified under

A few advanced paradigms could be adopted to provided further breakdown on resource timeline.

UI Architecture Patterns

Browser DevTools Tips

Must know libraries

Essential Links