👨🏼‍💻

khriztianmoreno's Blog

Home Tags About |

Posts with tag devtools

The Web Stack You Cannot Ignore in 2026

2025-12-26
web-performanceidentitypwaaidevtoolsprogrammingweb-developmentdiscuss

After going through roadmaps, specs, Chrome Dev Summit talks, and real signals from production, my prediction is simple:Web development in 2026 moves toward more native capabilities, less unnecessary JavaScript, and performance you can measure in the real world.This isn’t a “cool tools” list. These are the areas that become non-optional.1. Performance (Core Web Vitals + Soft Navigation)If you only fix one thing, fix this. Performance is the priority. No debate.Why it will be vital in 2026Google is doubling down on real user experience, not synthetic benchmarks. Soft Navigation also changes how modern SPAs (and “MPA-like” apps) are evaluated.In 2026:If you don’t improve INP and LCP, you don’t just “lose SEO” — you lose conversions.If you don’t measure soft navigations correctly, you’ll ship “faster” routes with fake metrics.What changesCLS stops being “cosmetic”.INP fully replaces the old “FID mindset”.SPA performance gets judged like an MPA.What you should masterweb-vitals in productionLong tasks (and what creates them)Soft navigation heuristicsRUM > LighthouseResourcesWeb VitalsSoft NavigationCrUX2. Identity: Passkeys + FedCMTraditional login is dying. It just doesn’t know it yet.Why it will be vital in 2026Passwords are both a technical and legal liability. Passkeys reduce friction and fraud. FedCM is the browser’s real answer to identity in a world without third‑party cookies.In 2026:A product without passkeys will be perceived as outdated.“Classic OAuth” without FedCM will degrade (or break) flows users care about.What changesPasswordless becomes normal.Browser-native login UI becomes the expectation.Less JS. More platform.What you should masterWebAuthnPasskeys UX patternsFedCM flowsPrivacy-preserving identityResourcesFedCMPasskeysWebAuthn3. Fugu / PWA APIsThe web talks to hardware now. The debate is over — what’s left is execution.Why it will be vital in 2026Web apps compete directly with native when the capability gap is small. Browsers keep shipping standards-based APIs, which means fewer dependencies and less glue code.In 2026:WebUSB, File System Access, and Badging stop being “rare”.PWAs feel more and more like first-class apps when the use case fits.What changesReal offline capabilitiesDeeper OS integrationFaster UX without native wrappersWhat you should masterFile System Access APIBackground SyncBadging APIPWA install heuristicsResourcesWeb capabilitiesProgressive Web Apps4. AI for Web Developers (Built-in AI APIs)AI stops being “just a SaaS”. It becomes part of the browser.Why it will be vital in 2026Lower latency. More privacy (because local is the new default). And better UX without forcing every product to build an expensive AI backend.This is not “embed ChatGPT”. This is native AI, progressively enhanced.In 2026:On-device AI becomes the default when available.AI-driven UX becomes a real differentiator.What changesSmaller, faster models running locallyFewer external callsUI patterns that adapt in contextWhat you should masterOn-device inference constraints (and fallbacks)AI UX patterns (assistive, not intrusive)Privacy-first AIProgressive enhancement with AIResourcesAI in Chrome5. DevTools & Browser AutomationTraditional debugging doesn’t scale.Why it will be vital in 2026Apps get more complex. Performance issues get more subtle. And manual testing simply isn’t viable if you want speed and quality.In 2026:Observability from DevTools becomes a daily habit.Automation becomes part of the workflow, not a “QA phase”.What changesSmarter DevToolsMore integrated testingDebugging centered on real UXWhat you should masterAdvanced Performance panel workflowsLighthouse CIPuppeteer / PlaywrightTracing and deep profilingResourcesChrome DevToolsLighthouseMy final prediction (no marketing)If I had to bet on only one foundation:Performance + Identity will be the base. Everything else sits on top of that.The web in 2026 will be:More nativeFasterMore privateLess dependent on “framework magic”The rest is noise.I hope this has been helpful and/or taught you something new!Profile@khriztianmorenoUntil next time

Mastering Chrome DevTools for Web Performance Optimization

2025-11-17
performancedevtoolschromechrome-devtools

Turn Chrome DevTools from a viewer into a performance debugging weapon.Most teams open DevTools too late. Or they look at the wrong panels, drowning in noise while missing the signals that actually affect user experience.If you are a senior frontend engineer or performance owner, you know that "it feels slow" isn't a bug report—it's a symptom. This guide is for those who need to diagnose that symptom, understand the root cause, and verify the fix.We are focusing on Chrome DevTools features that directly map to Core Web Vitals. No fluff, just the workflows you need to fix Interaction to Next Paint (INP), Largest Contentful Paint (LCP), and Cumulative Layout Shift (CLS).1. Mental model: from symptom to root causeBefore clicking anything, you need the right mental model. Metrics tell you what is wrong. DevTools explains why.Performance isn't about magic numbers; it's about the Main Thread. The browser's main thread is where JavaScript runs, HTML is parsed, and styles are calculated. It is a single-lane highway. If a heavy truck (a long task) is blocking the lane, fast cars (user clicks, animations) are stuck in traffic.Key Rule: If the main thread is blocked, UX is broken.2. Performance panel: the center of truthThe Performance panel allows you to record exactly what the browser is doing over a period of time. It records:Main thread activity: JS execution, parsing, GC.Rendering pipeline: Style calc, Layout, Paint, Compositing.Network timing: When resources are requested and received relative to execution.User input handling: How long the browser took to respond to a click.Recording a useful traceIdle traces are useless. You need interaction traces.Open DevTools (Cmd+Option+I / Ctrl+Shift+I) and go to the Performance tab.Check Screenshots and Web Vitals in the capture settings. Memory is usually optional unless you suspect a leak.Click the Record button (circle icon).Interact with the page (click the button, scroll the list, open the modal).Click Stop.3. Reading the Performance timelineThe resulting trace can be intimidating. Ignore 90% of it initially. Focus on these sections: FPS & CPU: High-level health check. Solid blocks of color in CPU mean the main thread is busy.Network: Thin lines showing resource loading order.Main: The flame chart of call stacks. This is where you spend most of your time. Frames: Screenshots of what the user saw at that millisecond.The Experience TrackThis is your best friend. It explicitly marks:LCP: Where the Largest Contentful Paint occurred.Layout Shifts: Red diamonds indicating CLS.Long Tasks: Tasks taking >50ms (red triangles).Spotting Long TasksA "Long Task" is any task that keeps the main thread busy for more than 50ms. In the Main section, look for gray bars with red triangles at the top corner. These are the tasks blocking the browser from responding to user input (INP).4. Debugging LCP with DevToolsLCP measures loading performance. To fix it, you need to know what the element is and why it was late.Identify the LCP element: In the Timings or Experience track, find the LCP marker.Inspect the element: Hovering over the LCP marker often highlights the actual DOM node.Analyze the delay:Resource Load Delay: Was the image discovery late? (e.g., lazy-loaded hero image).Resource Load Duration: Was the network slow or the image too large?Render Delay: Was the image loaded but waiting for a main-thread task to finish before painting?Typical LCP root causes:Late discovery: The <img> tag is generated by JavaScript or has loading="lazy".Render blocking: Huge CSS bundles or synchronous JS in the <head> pausing the parser.Server TTFB: The backend took too long to send the initial HTML.<!-- ❌ Bad: Lazy loading the LCP element (e.g. Hero image) --> <img src="hero.jpg" loading="lazy" alt="Hero Image" /> <!-- ✅ Good: Eager loading + fetchpriority --> <img src="hero.jpg" loading="eager" fetchpriority="high" alt="Hero Image" />Reference: Optimize Largest Contentful Paint5. Debugging INP with DevToolsINP is the metric that kills single-page applications (SPAs). It measures the latency of user interactions.Use the Interactions track: Look for the specific interaction (click, keypress) you recorded.Expand the Interaction: You will see it broken down into three phases:Input Delay: Time waiting for the main thread to become free.Processing Time: Time running your event handlers.Presentation Delay: Time waiting for the browser to paint the next frame.Visually correlate with the Main Thread: Click the interaction bar. Look directly below it in the Main track.If you see a massive yellow block of JavaScript under the interaction, your event handler is too slow (Processing Time).If you see a massive block of JS before the interaction starts, the main thread was busy doing something else (Input Delay).Common offenders:JSON parsing large payloads.React/Vue reconciliation (rendering too many components).Synchronous loops or expensive calculations.// ❌ Bad: Blocking the main thread with heavy work button.addEventListener("click", () => { const result = heavyCalculation(); // Blocks for 200ms updateUI(result); }); // ✅ Good: Yielding to main thread button.addEventListener("click", async () => { showSpinner(); // Yield to main thread so browser can paint the spinner await new Promise((resolve) => setTimeout(resolve, 0)); const result = heavyCalculation(); updateUI(result); });Fix workflow: Identify the function in the flame chart → Optimize or defer it → Record again → Verify the block is smaller.Reference: Interaction to Next Paint (INP)6. Debugging CLS with DevToolsLayout shifts are annoying and confusing. DevTools visualizes them clearly.Open the Command Menu (Cmd+Shift+P / Ctrl+Shift+P) and type "Rendering".Enable "Layout Shift Regions".As you interact with the page, shifted elements will flash blue.In the Performance Trace: Look at the Experience track for red diamonds. Click one. The Summary tab at the bottom will list exactly which nodes moved and their previous/current coordinates.Common CLS patterns:Font swaps (FOUT/FOIT): Text renders, then the web font loads, changing the size.Image resize: Images without width and height attributes.Late injected UI: Banners or ads inserting themselves at the top of the content./* ❌ Bad: No space reserved for image */ img.hero { width: 100%; height: auto; } /* ✅ Good: Reserve space with aspect-ratio */ img.hero { width: 100%; height: auto; aspect-ratio: 16 / 9; }Reference: Optimize Cumulative Layout Shift7. Live Metrics screenThe Live Metrics view (in the Performance panel sidebar or landing page) provides real-time feedback without a full trace.Why it matters:Instant feedback: See LCP and CLS values update as you resize the window or navigate.Field-aligned: It uses the same implementation as the Web Vitals extension.Use cases:Testing hover states and small interactions.Validating SPA route transitions.Quick sanity checks before committing code.Note: This is still "Lab Data" running on your machine, not real user data (CrUX).8. Insights panelThe Performance Insights panel is an experimental but powerful automated analysis layer. It uses the trace data to highlight risks automatically.Key features:Layout Shift Culprits: It points directly to the animation or DOM update that caused a shift.Render blocking requests: identifies CSS/JS that delayed the First Contentful Paint.Long main-thread tasks: suggestions on how to break them up.Use Insights as a hint, not a verdict. It points you to the right place in the flame chart, but you still need to interpret the code.9. CPU and Network throttling (Mandatory)Developing on a MacBook Pro with fiber internet is a lie. Your users are on mid-tier Android devices with spotty 4G.CPU Throttling:set to 4x slowdown. This roughly simulates a mid-range Android device. It exposes "death by a thousand cuts"—small scripts that feel instant on desktop but freeze a phone for 300ms.Network Throttling: Fast 4G or Slow 4G. Critical for debugging LCP (image load times) and font loading behavior.Fast Wi-Fi hides bad engineering. Always throttle when testing performance.10. Putting it all together: a repeatable workflowDetect: Use PageSpeed Insights or CrUX to identify which metric is failing.Reproduce: Open DevTools, enable Throttling (CPU 4x, Network 4G).Record: Start tracing, perform the user action, stop tracing.Inspect: Find the red/yellow markers in the Experience/Main tracks.Fix: Apply the code change (defer JS, optimize images, reduce DOM depth).Verify: Re-record and compare the trace. Did the long task disappear? Did the LCP marker move left?ConclusionDevTools is not optional. Performance is observable. Every Core Web Vitals issue leaves a trace; you just need to know where to look.If you cannot explain a performance problem in DevTools, you do not understand it yet.Resources:Chrome DevTools Documentationweb.dev Performance GuidesGoogle Search Central CWV DocsI hope this has been helpful and/or taught you something new!Profile@khriztianmorenoUntil next time

Demystifying Core Web Vitals - A Developer's Guide to LCP, INP, and CLS

2025-10-19
web-performancecore-web-vitalslighthouseweb-developmentcruxchromeperformancedevtoolschrome-devtools

Core Web Vitals are ranking signals, but most teams still optimize them like lab-only scorecards. This guide turns CWV into actionable engineering work: how to measure (field + lab), how to debug root causes in DevTools, and which fixes actually move the 75th percentile.

Introducing Chrome DevTools MCP

2025-09-30
javascriptchromedevtoolsaimcpdebuggingperformancechrome-devtools

I participated in the Chrome DevTools MCP Early Access Program and put the feature through its paces on real projects. I focused on four scenarios: fixing a styling issue, running performance traces and extracting insights, debugging a failing network request, and validating optimal caching headers for assets. This post shares that hands-on experience—what worked, where it shines, and how I’d use it day-to-day.Chrome DevTools MCP gives AI coding assistants actual visibility into a live Chrome browser so they can inspect, test, measure, and fix issues based on real signals—not guesses. In practice, this means your agent can open pages, click, read the DOM, collect performance traces, analyze network requests, and iterate on fixes in a closed loop.