Rendering
43 bites tagged Rendering — interview questions with model answers, and 60-second explainers.
Universal Rendering: Server-First, Client-Interactive
Universal Rendering sends a pre-built HTML page from the server for a fast load, then adds interactivity on the client. It's the default in frameworks like Nuxt for better SEO, but the footgun is writing code that crashes on the server by assuming a browser.
Vue's Virtual DOM: Efficient UI Updates
Vue keeps a JavaScript copy of the UI (the Virtual DOM) in memory. When data changes, it compares a new virtual tree to the old one and efficiently updates only the changed parts of the real DOM, avoiding costly full re-renders.
React's Two-Step Update: Render and Commit
React updates the screen in two phases. The "render" phase is React calling your components to calculate the UI. The "commit" phase is when it actually updates the DOM. The footgun is thinking rendering always changes the screen; it's just the prep work.
React Render Bailouts: Skipping Unnecessary Work
React's Performance Hooks let you 'bail out' of unnecessary re-renders by caching results. React reuses the cached output unless specific dependencies change, saving computation on expensive components.
React's Concurrent Rendering: Interruptible UI Updates
Concurrent Rendering lets React pause and resume rendering, so a large update won't freeze the UI. It's like a chef pausing a big task to handle a quick order, ensuring the app stays responsive. This is key for features like Suspense.
Partial Prerendering (PPR): Static Speed for Dynamic Pages
Partial Prerendering serves a static page shell instantly, then streams in dynamic parts. It's like getting a pre-built house frame immediately, with custom rooms delivered and slotted in as they're finished.
Dynamic Functions in Next.js
Using functions like `cookies()` or `headers()` forces a Next.js page to be rendered dynamically for each request. This is key for personalized content or pages depending on search params.
Dynamic Rendering: On-Demand Pages in Next.js
Dynamic Rendering in Next.js generates a page's HTML on the server for each user request, ensuring fresh content. It's ideal for personalized dashboards or pages with rapidly changing data.
ISR: Static Speed with Dynamic Freshness
ISR offers the speed of a static site with the freshness of a server-rendered one. It serves a cached page, then regenerates it in the background after a set time, making it ideal for blogs or e-commerce sites.
useLayoutEffect: Synchronous Effects Before Browser Paint
useLayoutEffect is useEffect's synchronous twin, running its code after DOM mutations but before the browser repaints. Use it to read DOM layout and re-render to prevent visual flickers, like positioning a tooltip. Its main footgun: it blocks rendering.
Impeller: Flutter's Jank-Free Rendering Engine
Impeller is Flutter's new rendering engine that pre-compiles shaders to deliver silky-smooth animations. It replaces the Skia engine to eliminate "jank" from on-the-fly shader compilation. The footgun: it only fixes rendering jank, not slow app logic.
RepaintBoundary: Isolate and Optimize Flutter Painting
RepaintBoundary acts like painter's tape for your UI, isolating a widget's paint job from its parent to prevent unnecessary repaints. Use it on complex, static widgets inside an animating view. The footgun is overuse: each boundary adds memory overhead.
Flutter Web Renderers: HTML vs. CanvasKit
Flutter on the web draws your UI using one of two engines: HTML or CanvasKit. The HTML renderer uses standard web elements for compatibility, while CanvasKit uses a high-performance canvas for graphical fidelity.
Canvas Transformations: Moving the Paper, Not the Pen
Think of Flutter's Canvas transformations not as moving your drawing, but as moving the coordinate system itself. This is key for custom painters, like rotating the canvas to draw tick marks on a dial.
CustomPaint: Drawing Your Own Widgets in Flutter
CustomPaint is your blank canvas widget; CustomPainter is the artist that draws on it. Use them for custom charts or unique UI. The footgun: shared canvases can cause blend modes to erase other widgets, so use `saveLayer` sparingly.
Flutter's Three Trees: Widget, Element, and RenderObject
Flutter separates UI into three trees. Widgets are cheap blueprints. Elements are the stateful managers that persist across frames. RenderObjects do the expensive layout and painting. Understanding this separation is key to mastering Flutter's performance.
Tone Mapping: Fitting HDR Light onto LDR Screens
Tone mapping compresses a vast range of light (HDR) to fit on a standard screen (LDR). It's how HDR photos and games look good on your monitor instead of having blown-out whites or crushed blacks. The footgun is creating unnatural, "over-cooked" images.
BRDF: Modeling How Surfaces Reflect Light
A BRDF is a function that describes a surface's appearance by defining how it reflects light from any incoming direction to any viewing direction. It's used in rendering engines to create materials like brushed metal or velvet.
Radiometry: Measuring Light as Physics, Not Perception
Radiometry measures light's physical power, not how humans perceive it. It's for objective energy measurement in computer vision or physics simulations, using watts, not lumens. The footgun is confusing it with photometry, which is weighted for human vision.
Get Rendering bites daily.
Five a day, five minutes, offline. With quizzes so it sticks.
Open testing — you’ll join as an early tester.