Subjects·13 topics·271 terms
Frontend & browser
Rendering, CSS, the main thread, bundling, Core Web Vitals, browser security and accessibility.
Start with these 53, in order
The browser's vocabulary, from the cascade to the render loop to the numbers a review will hold you to.
Read in order · tick what you already know
- 01
you keep raising the number in one file and lowering it in another until the overlay is on top.
z-index
- 02
your new rule does nothing until you nest it one level deeper, and now it wins.
Specificity
- 03
you set the width to 300 pixels and the element takes up 340, because of padding you forgot to count.
Box model
- 04
you went to click the button, an ad loaded above it, and you clicked something else entirely.
Cumulative layout shift
- 05
you delete the second row and the text you had typed into the third row is suddenly in the second.
List key
- 06
the interval you set up on mount kept logging the count as zero no matter how many times you clicked.
Stale closure
- 07
you set `z-index: 9999` and the element still sits behind the header.
Stacking context
- 08
two rules both apply to the element and the browser follows a fixed set of tie-breaks to pick one.
The cascade
- 09
you laid the row out along one axis and let the items decide how to share the leftover space.
Flexbox
- 10
you defined the columns once on the container and the children fell into place without any width of their own.
CSS grid
- 11
you open the elements panel and the tree you see is not the HTML you wrote, because scripts changed it.
Document Object Model
- 12
you trace every step between the HTML arriving and the first pixel appearing, looking for the one that waits.
Critical rendering path
- 13
the page stayed blank until a stylesheet in the head finished downloading from a third-party domain.
Render-blocking resource
- 14
you changed one element's width and the browser had to recompute the position of half the page.
Reflow
- 15
you changed a colour and nothing moved, but the browser still had to redraw those pixels.
Repaint
- 16
your loop over ten thousand rows froze the whole tab, including the scroll and the spinner.
Main thread
- 17
one function held the main thread for 300 milliseconds and every click during it queued up behind it.
Long task
- 18
the scroll is smooth and then jumps, because a frame took too long and got skipped.
Jank
- 19
the component function runs again from the top, even though nothing on screen ended up changing.
Re-render
- 20
the component's state survived the re-render because the framework decided it was the same element as before.
Reconciliation
- 21
the object had exactly the same contents as last render and the component re-rendered anyway.
Referential equality
- 22
you wrapped the component so it skips re-rendering when its props are shallowly the same.
Component memoisation
- 23
you needed to reach outside the component — to the DOM, a socket, a timer — after the render finished.
Effect
- 24
you left a value out of the array to stop the loop and the effect started using an old copy of it.
Dependency array
- 25
two sibling components needed the same value, so you moved it into the parent they share.
Lifting state up
- 26
you threaded the same value through four components that do not use it, just to reach the fifth.
Prop drilling
- 27
the value only exists because this screen is open, and nobody else in the world needs to know about it.
Client state
- 28
the data on screen is a copy of something you do not own, and it went out of date while you were looking at it.
Server state
- 29
the second request could not start until the first finished, because the component that made it had not rendered yet.
Request waterfall
- 30
you view source and there is nothing in the body but an empty div and a script tag.
Client-side rendering
- 31
the HTML arrives with the content already in it, and the page is readable before any script runs.
Server-side rendering
- 32
the page looks finished but clicking a button does nothing for another two seconds.
Hydration
- 33
the address bar changes and the content swaps, but the browser never loads a new document.
Single-page application
- 34
you intercepted the link click, pushed a new URL and rendered a different component in place.
Client-side routing
- 35
you point one tool at an entry file and it follows every import and writes out a handful of files.
Bundler
- 36
the settings screen's code is not downloaded until someone actually opens the settings screen.
Code splitting
- 37
you import one function from a library and the other two hundred never reach the bundle.
Tree shaking
- 38
you deployed a fix and users kept getting the old file until you changed its name.
Cache busting
- 39
you were handed three numbers and told the page fails on one of them, at the 75th percentile.
Core Web Vitals
- 40
the big hero image finally rendered, four seconds after the header was already on screen.
Largest contentful paint
- 41
you clicked the checkbox and it took most of a second before the tick appeared.
Interaction to next paint
- 42
you listed several image widths and let the browser pick one based on the screen and the layout.
Responsive images
- 43
you replaced the div with a button and got keyboard support, focus and the right announcement for free.
Semantic HTML
- 44
the icon button was announced as just 'button' because there was no text and no label anywhere.
Accessible name
- 45
you put the mouse away and tried to complete the whole flow with Tab, Enter, Space and the arrow keys.
Keyboard operability
- 46
you opened the dialog and moved focus into it, then put focus back on the button when it closed.
Focus management
- 47
the grey-on-white caption looked fine on your monitor and failed the check at 3.1 to 1.
Contrast ratio
- 48
you turned one on and heard your interface read out as a flat sequence with no structure at all.
Screen reader
- 49
the script could send the request but was not allowed to read what came back.
Same-origin policy
- 50
the request worked in curl and failed in the browser with a message about an Access-Control header.
CORS
- 51
someone put a script tag in their display name and it ran in everyone else's browser.
Cross-site scripting
- 52
an injected script was blocked because the browser refused to run anything from an origin not on the list.
Content Security Policy
- 53
you drove a real browser through the whole signup flow against a running server.
End-to-end test
All of frontend & browser
Every term in this subject, 271 of them, grouped into 13 topics. Each topic is a track of its own.
Rendering and the browser pipeline
01 · 25 termsEverything between the bytes arriving and a pixel changing on screen. Most frontend performance arguments are really arguments about which stage of this pipeline a change lands in, which is why naming the stages is worth more than any single trick.
- Critical rendering path
- Document Object Model
- CSSOM
- Render tree
- Reflow
- Repaint
- Rasterisation
- Compositing
- Layer promotion
- Client-side rendering
- Server-side rendering
- Static site generation
- Incremental static regeneration
- Streaming SSR
- Hydration
- Hydration mismatch
- Islands architecture
- Resumability
- Progressive enhancement
- Virtual DOM
- Reconciliation
- List key
- Re-render
- Flash of unstyled content
- DOMContentLoaded
Layout, CSS and the cascade
02 · 28 termsThe half of the job people claim is easy and then spend an afternoon on. Almost every mysterious CSS bug is one of six ideas here — a context you did not know you created, or a rule that won for a reason you did not check.
- The cascade
- Specificity
- Source order
- !important
- Cascade layers
- Inheritance
- Custom property
- Box model
- box-sizing
- Margin collapsing
- Block formatting context
- Stacking context
- z-index
- Containing block
- Absolute positioning
- Sticky positioning
- Scroll container
- Flexbox
- CSS grid
- Subgrid
- Media query
- Container query
- Logical properties
- display: none
- visibility: hidden
- Scoped styles
- CSS-in-JS
- Utility-first CSS
JavaScript in the browser
03 · 29 termsOne thread does the layout, the paint and your code, and it can only do one of them at a time. These are the words for what that thread is doing, in what order, and why the interface stopped responding while it did it.
- Main thread
- Call stack
- Task
- Microtask
- requestAnimationFrame
- requestIdleCallback
- Web worker
- Event bubbling
- Event capturing
- Event delegation
- preventDefault
- stopPropagation
- Passive event listener
- Debounce
- Throttle
- Closure
- Stale closure
- this binding
- Hoisting
- Temporal dead zone
- Prototype chain
- Referential equality
- Shallow equality
- Deep equality
- Structured clone
- Garbage collection
- Detached DOM node
- AbortController
- Unhandled rejection
State, data and re-rendering
04 · 28 termsWhere the data lives, who owns it, and what happens on screen when it changes. Most component bugs are ownership bugs wearing a costume, and most of the fixes have names that make the argument short.
- Client state
- Server state
- Single source of truth
- Derived state
- Effect
- Lifting state up
- Prop drilling
- Context provider
- Controlled input
- Uncontrolled input
- Dirty state
- Query key
- Revalidation
- Optimistic UI
- Request waterfall
- Out-of-order response
- Suspense boundary
- Skeleton screen
- Error boundary
- Immutable update
- Reducer
- External store
- Selector
- Normalised state
- Dependency array
- Component memoisation
- List virtualisation
- Infinite scroll
Modules, bundling and the build
05 · 29 termsThe pipeline that turns a few hundred source files into the handful of files a browser downloads. Everything here is about shipping less code, or about shipping the same code in a way the browser can keep.
- ES module
- CommonJS
- Bundler
- Module graph
- Entry point
- Chunk
- Tree shaking
- Dead code elimination
- Side-effect-free module
- Barrel file
- Code splitting
- Dynamic import
- Lazy component
- Vendor chunk
- Duplicate dependency
- Content hash
- Cache busting
- Immutable caching
- Minification
- Source map
- Transpilation
- Polyfill
- Ponyfill
- Build target
- Hot module replacement
- Bundle analysis
- Module federation
- Micro-frontend
- Import map
Loading, assets and the critical path
06 · 15 termsByte order matters as much as byte count: the same page can feel instant or broken depending on what the browser was told to fetch first. This is the vocabulary of that ordering, and of the assets that most often get it wrong.
Performance and Core Web Vitals
07 · 18 termsThe metrics are not the point; they exist because 'the page feels slow' is not actionable and 'the largest element paints at 4.2 seconds' is. Learn which number moves when you fix which thing.
- Core Web Vitals
- Time to first byte
- First contentful paint
- Largest contentful paint
- Cumulative layout shift
- Interaction to next paint
- Total blocking time
- Time to interactive
- Long task
- Jank
- Frame budget
- Layout thrashing
- Forced synchronous layout
- content-visibility
- Lab data
- Field data
- Lighthouse score
- Perceived performance
The network from the browser
08 · 15 termsThe browser is not a HTTP client you control. It has its own rules about what you may request, what you may read back and what it will quietly cache, and those rules are the source of most requests that work in curl and fail in the tab.
Browser security
09 · 19 termsYour code runs on someone else's machine, next to someone else's script, holding someone else's session. These are the attacks that follow from that and the browser features that exist to blunt them.
Accessibility and semantics
10 · 22 termsThe interface as it reaches someone not using a mouse and a pair of eyes. Nearly all of it comes down to two questions the browser is already asking your markup: what is this thing, and what is it called.
Routing and navigation
11 · 14 termsThe moment an application takes the address bar away from the browser, it inherits everything the browser was doing for free. This is the list of what it inherited, most of which gets rediscovered as a bug report.
Storage and platform APIs
12 · 15 termsThe browser's own standard library: four ways to keep data on the device and a set of observers that answer questions a scroll handler used to answer badly. Picking the right one is usually a question about lifetime.
Testing a user interface
13 · 14 termsThe pyramid arguments are stale but the vocabulary is not, because the words decide what a failing test actually tells you. The recurring theme is testing what the user does, not how the component does it.