Build, test, observe, secure
35 readings on build, test, observe, secure, each with our note on why it matters.The articles are the originals — read them there.
Build tooling, bundlers & monorepo
How Turbopack chunks your JavaScript
Your Next.js bundle ships too many requests or too much per-page JS — 16.3 turns Turbopack's chunking guesses into config (firstPageLoadPriority, priorityRoutes, clusters) plus generateComponentChunks, CJS tree-shaking and a shared runtime.
The chunking-strategy explainer plus the Next.js 16.3 knobs that come out of it — the first thing to read when a Next app's problem is 'too many requests' or 'too much JS per page'. The framing is a three-way tradeoff with no free answer: one chunk for everything caches perfectly but over-ships; one chunk per page never over-ships but duplicates shared code into every page; one chunk per module never duplicates but explodes the request count. Turbopack's default sits in between by MERGING chunks at build time, weighting a single-page visit at 2/3. Measured on nextjs.org itself, that default cut requests by more than half versus no merging while shipping slightly less code, whereas maximum merging cut requests further but shipped ~10% more overall — better for a visitor who lands once, worse for one who navigates. The 16.3 features address the two structural limits (merging happens before anyone visits, and the algorithm has to guess how people browse): experimental.turbopackChunking.generateComponentChunks emits un-merged chunks alongside merged ones so the RUNTIME picks whichever is cheaper given what the browser already has; firstPageLoadPriority (default 0.67, bounce rate is a sensible starting value), priorityRoutes and clusters let you replace the guesses with your own analytics; and three ship-less-code flags — experimental.turbopackCjsTreeShaking (CJS tree-shaking was previously ESM-only), experimental.turbopackSharedRuntime (one runtime chunk instead of per-page: one fewer blocking request and ~10 KB per navigation), and a default runtime that no longer ships WebAssembly/Web Worker code unless detected. All experimental in 16.3; the CJS and shared-runtime flags are stated as future defaults.
How Teamworks Cut Mobile Release Time to 10 Minutes
You ship Re.Pack — the Teamworks case is the reference architecture: mini-apps on Module Federation behind a shell app with separate host/mini-app CI lanes took change lead time from days to ~10 minutes.
The production receipt for the Re.Pack/Module-Federation lane: Teamworks' seven mini-apps moved off Metro onto Re.Pack + Module Federation with a shell app and two CI/CD lanes (host vs mini-app), cutting change lead time from 1-2 days to ~10 minutes with multiple staging deploys per day. Vendor case study (Callstack builds Re.Pack) — but the numbers are client receipts, and it grounds this entry's own when-clause: module federation is worth the complexity when independent teams need independent release cadences in one app.
Working With the React Native Super App Showcase Repository
You build a Re.Pack/Module-Federation super app — hold the showcase's two invariants: native modules only in the host shell (double registration hard-crashes), and singleton shared deps pinned via one catalog for version AND requiredVersion.
The HOW behind the Teamworks receipt above: Callstack's open-source Super App Showcase (Re.Pack + Module Federation V2, monorepo) explained role by role — a Host Shell that is the ONLY package with native binaries (owns root nav, boot, auth gates, remote origins), federated mini-apps each exposing one navigator/context as a remote bundle, and a singleton Shared SDK for anything that must exist exactly once (streaming connections, shared state, design tokens). Two non-negotiable rules carry the architecture: native code lives only in the host shell (a doubly-registered native module crashes outright, no soft warning), and every shared dep reads version AND requiredVersion from one dependency catalog because Module Federation does not enforce strict equality itself. (Fetched via browser-UA curl; callstack.com 403s WebFetch.)
Things I Learned While Building Expo
The philosophical background behind this entry's Expo-vs-bare row, from the person who built much of it: dogfooding as the design tool, users articulating symptoms not solutions ('a runtime that was theirs, not ours' → dynamic runtime generation / prebuild), trust compounding through the expo-eject criticism years, and telemetry settling architecture debates.
Durable platform-building judgment, found by the 2026-07-16 back-audit of TWiR #284.
The first-principles explainer for WHY the JS toolchain is going Rust — memory safety, no GC, real parallelism, the redundant-parsing problem — mapping the whole landscape (esbuild, SWC, Oxc/Biome, Rspack, Rolldown).
Durable cross-cutting context, not a single release.
You ship Vite — v8 unifies dev and prod on Rolldown (one Rust bundler, 10-30x faster) instead of the unsustainable esbuild+Rollup pair, with Oxc semantic analysis driving better tree-shaking.
Why maintaining two pipelines (esbuild + Rollup) was unsustainable and how Rolldown unifies dev/prod on one Rust bundler (10-30x faster), with Oxc semantic analysis driving better tree-shaking. The primary source for the Vite+Rolldown+Oxc consolidation.
Exploring Inlined Requires: how they really work
You bundle with Metro — inlineRequires mechanics: why React/RN stay hoisted, why default imports aren't inlined, and how rnx-kit's esbuild path differs (real tree-shaking vs startup-only).
Exactly what Metro's inlineRequires Babel transform does, why React/RN stay hoisted, why default imports aren't inlined, and how rnx-kit's esbuild path differs (real tree-shaking vs startup-only). The canonical Metro startup-mechanics reference.
The Complete Guide to React Native Build Optimization
Why RN Android builds are slow (conservative Gradle/Metro/C++ defaults) and how parallel Gradle, dynamic Metro workers, ccache, and single-architecture builds cut times from 20+ min to 2-5 min, with benchmarks.
The RN-CI build-perf dimension the other readings here don't cover.
Testing strategy & tooling
Making React Testing Library Tests 43% Faster
Your RTL suite is slow — before rewriting tests or switching runners, upgrade jsdom: the 43% win (label-index, selector fast path, event dispatch) shipped upstream and applies to unchanged test code.
A 43% suite-time win with ZERO test-code changes — the whole gain landed upstream in jsdom, which reframes slow-RTL complaints as a dependency-version problem: a label-to-control index so getByRole stops rescanning the DOM per input (60.5ms → 0.67ms label reads), an un-tripped selector fast path fixed (getByRole queries ~42% faster), and event dispatch recording its target during path construction (12-36% by tree depth). Method note worth copying: AI-found bottlenecks, but every change had to survive Sentry's real codebase, not microbenchmarks, and had to land upstream where it stays maintained.
How we raised mobile end-to-end test stability to 98%
You run native E2E and fight flakiness — most of it lives in the API, not the tests: force an assertion on every step, find elements visually instead of by test ID, name escape hatches UNSAFE_, and gate new tests on repeated runs (Shopify: 50% → 98%).
The production evidence behind 'flaky native E2E is a framework problem, not a test problem'. Shopify's largest mobile app ran Appium via WebdriverIO with React Native test IDs since 2023 and had to pull the suite OUT of blocking CI; the rebuild put it back at 98% stability (individual test successes / total runs, up from 50%). Two changes did it. First, a builder-style API that makes flaky tests hard to write: every step carries an assertion (validated both ways — false before the action, true after), reusable named step sequences, and escape hatches deliberately named UNSAFE_ (UNSAFE_timeoutInSeconds, UNSAFE_testID) so they show up in review. Second, elements are found the way a user finds them — each step screenshots and matches visually, PaddleOCR for text and OpenCV for icons (grayscale, color-inverted variants, multiple sizes, adjacency rules to disambiguate duplicates) against Polaris design-system SVGs — which also removes the inspector round-trip from authoring and is why agents write correct tests on the first try. Plus a pre-promotion flakiness gate: a new test runs many times and is rejected above a failure threshold. Residual failures are network flakes and simulators failing to boot.
You ship Testing Library — query by role/label, not data-testid: accessible queries are both the stronger test and a free a11y audit; testid queries silently hide inaccessible markup.
The bridge between this entry and RB-E-A11Y: querying by data-testid silently hides inaccessible markup, while role/label queries fail exactly when a real assistive-tech user would — so accessible queries are both the better test AND a free a11y audit. Sharpens the Testing-Library philosophy the two Dodds pieces establish.
You Own the Outcome: Product Engineering in the Age of AI
You review AI-generated code — verify by outcome (automated tests/checks that you trust), not by reading every diff line; spend your judgment on the problem definition and irreversible decisions, not on typing.
Reframes what 'ownership' means when an agent writes the code: agents produce output, you own the outcome. Practical shifts — align on the problem/success-criteria/constraints BEFORE asking for implementation; ask the agent for multiple options with tradeoffs, weighted by reversibility (one-way doors like a public API name vs two-way doors); and verify by outcome (tests, checks, does it actually work) rather than by reading every line of the diff, which only works if verification is automated and trustworthy.
Write tests. Not too many. Mostly integration.
You have a test runner — spend it on integration tests over mock-heavy unit suites: confidence per effort is the metric, not coverage.
The foundational testing-strategy essay: maximize confidence per effort by favoring integration tests over mock-heavy unit suites and coverage-chasing. The origin of the Testing-Trophy mindset.
Testing Implementation Details
Why tests coupled to internals are brittle (false failures on refactor, false passes on breakage) and why to test behavior the way users use it.
The mental model behind Testing Library.
Developer experience — CI, lint/format, hooks, monorepo, onboarding
Dead Code Shouldn't Exist: How We Removed 28k Lines of Code, One Knip at a Time
Slides and transcript of a conference talk (given at React Paris, JSHeroes, JSNation and others): removing ~28k lines of unused files, exports and dependencies with Knip.
The only dead-code-detection reading in DX — unused exports and dependencies are a lint lane the ESLint/Oxlint options don't cover.
Best CI/CD for mobile apps in 2026: a practical comparison
The only structured selection matrix for mobile CI platforms (EAS Workflows vs Bitrise vs Codemagic vs GitHub Actions): fingerprint-based repack turning 10–15min builds into ~2min JS-only builds, and GHA macOS runners measured ~2.4x slower than Codemagic M4s.
READ AS A VENDOR DOC — Expo wins its own comparison; the evaluation axes (runner hardware, cache strategy, fingerprint/repack) are the durable part.
Expo without EAS: scaling the React Native DX of an app with 90M+ users
You ship Expo at scale — Doctolib's blueprint runs the bare workflow without EAS: fingerprint caching + JS patching halved CI builds while contributors grew 9→105.
Large-scale case study adopting Expo's bare workflow (not EAS) with fingerprint caching + JS patching to halve CI builds and grow contributors 9→105. A durable enterprise RN build/CI-DX blueprint.
Crash reporting, monitoring & observability
Experimental soft navigation metrics now available in CrUX
Your web app routes client-side — CrUX now reports experimental soft-navigation LCP/INP/CLS per destination URL; check your routes there before trusting landing-page-only Core Web Vitals.
After the Soft Navigations API shipped in Chrome 151, CrUX publishes EXPERIMENTAL versions of all three Core Web Vitals that blend soft (client-side route) navigations with hard loads — experimental_largest_contentful_paint_with_softnavs, …interaction_to_next_paint…, …cumulative_layout_shift…. Each in-app view change that updates content and URL is measured as its own navigation and reported under the destination URL, instead of every SPA interaction and layout shift being charged to the landing page. Stable CWV scores are unchanged while these are evaluated. Only SPAs with heavy follow-up navigation move (about 70% of origins have under 5% soft navs, but 35–42% of the top 1,000 sites exceed 50%); for them LCP typically improves and INP/CLS become attributable per route. CrUX Vis has an 'Include soft navigations' toggle.
How to find a Next.js memory leak in production
Your Node/Next server's memory climbs — match the growth signature to a variable, then read heap-snapshot retainer chains; on Next 15.5–16.2, upgrade to 16.3.0 first (three framework leaks live there).
Production heap-diagnosis methodology on a real case: three Next.js framework leaks between 15.5 and 16.2 (router LRU cache ignoring URL-key size — hundreds of MB proportional to unique routes; RSC streams retained on client disconnect, worst on Node 22/24; middleware timeout IDs never released), all fixed by 16.3.0. The durable half is the method — chart process.memoryUsage() against candidate variables (unique URLs, traffic, middleware) to match the growth SIGNATURE before assigning blame, then diff heap snapshots and read retainer chains (LRUNode / reactServerStream / TimeoutsManager name the culprits). Also: raising heap limits is a band-aid against a monotonic slope, and on serverless memory problems surface as latency, so profile that instead.
Bringing Lighthouse to the App: Core Web Vitals for React Native
You run RN in production — crash reporting alone isn't performance observability: Indeed's blueprint adapts Core Web Vitals (TTFF/TTI/FID) into an RN perf hook with composite scoring.
Adapts web Core Web Vitals (TTFF/TTI/FID) into a React Native performance hook with composite scoring, from a real ViewJob rollout. A durable blueprint for measuring (not just crash-reporting) RN performance in production.
The Hidden Cost of Hydration Mismatches
You server-render — one hydration mismatch makes React recreate the DOM and re-trigger LCP at hydration time; mismatches are a measurable LCP tax, not a cosmetic console warning.
Web-side production-perf diagnosis from real consulting: a single hydration mismatch makes React recreate the DOM, and because LCP only tracks NEW elements, the remounted (font-swapped, larger) text re-triggers LCP at hydration time — green→red with no obvious cause. Durable lessons: keep server/client renders identical, scope unavoidable mismatches with Suspense, and know how the metric itself measures (the metric mechanics are the observability half — the rendering-strategy background lives in RB-E-META-FRAMEWORKS's readings). The web counterpart to the Indeed RN piece above.
App security — device trust, secrets, dependency risk
How we found 24 Android vulnerabilities using our open source AI security agent
You're evaluating an AI security scanner (DeepSec or similar): platform-specific taskflows beat generic prompting at finding real bugs, but every finding is a candidate — LLMs misjudge severity and false-positive, so a platform-literate human reviews each one.
Real-world evidence for the DeepSec-style pattern of this entry: GitHub's open-source Taskflow Agent combines AI prompts with structured, PLATFORM-SPECIFIC workflows (not generic prompting) to find real bugs — 24 Android vulnerabilities across shipped apps, including a location-tracking injection in OsmAnd and a deeplink-based account takeover in Wikipedia's Android app. The caveat that matters: the authors state LLMs struggle to estimate severity and produce false positives, so every finding still needs review by a researcher who knows the mobile platform — automation finds candidates, it doesn't replace the review.
React2STEAL: what it is and what to check
You run React Server Components or Next.js on the internet — React2Shell and the middleware bypass are being mass-exploited via GitHub Actions; an unpatched server means rotate every secret it could reach.
The operator checklist for the REACT2STEAL note (Chainguard's CISO, 2026-11-18): an automated campaign using GitHub-hosted runners on hijacked accounts to scan for and exploit the already-patched React2Shell RCE (CVE-2025-55182) and the Next.js middleware bypass (CVE-2025-29927), then dump env vars, .env/config files, cloud credentials and AI keys into public repos — at least 1,281 victim hostnames at publication. Explicitly NOT a supply-chain attack: no npm package, Action or maintainer account was tampered with. Checks: confirm a fixed version, search request logs for the three listed indicators, rotate every secret a matching server could reach, and (GitHub account owners) look for repos, branches and workflow runs you did not create.
An RCE postmortem on CVE-2025-55182 in React's Flight protocol (thenable abuse, prototype-chain exploitation), with durable lessons on runtime-vs-build-time type safety and lenient-parsing attack surface.
Canonical RSC security case study.
The Flight Protocol Made Your DoS My Problem
A DoS deep-dive (CVE-2026-23870) in the RSC Flight deserializer, with the generalizable lesson that dissolving a network boundary into developer ergonomics still owes a threat model (applies to tRPC/GraphQL/WebSockets too).
Shai-Hulud Postmortem (npm supply-chain worm)
You run a production pipeline — supply-chain is the real React-ecosystem risk: disable npm install scripts, use OIDC publishing, and layer defenses (the Shai-Hulud mitigations apply to every delivery pipeline).
A first-party postmortem of the Shai-Hulud worm (preinstall-script credential exfiltration) with concrete mitigations — disable npm install scripts, pnpm 10, OIDC publishing. The supply-chain reading this entry's own note calls for; applies to any React/RN delivery pipeline.
Postmortem: TanStack npm supply-chain compromise
First-party postmortem of the incident this entry's note cites: 84 versions across 42 @tanstack/* packages, via a pull_request_target 'Pwn Request' → pnpm store-cache poisoning → OIDC token extraction from the runner.
The CI/CD-side attack chain — a different door than the install-script family covered by the Shai-Hulud and NodeSource readings.
RSC Server Functions Are Not An API Boundary
You ship an RSC framework — server functions are reachable via direct POST regardless of UI: auth/authz must live INSIDE every server function, and deploy skew breaks old clients.
The architectural half of this entry's RSC stance: compiler-generated server references are reachable via direct POST, so auth/authz must live INSIDE every server function — plus the rolling-deploy skew failure mode (generated function IDs drift across deploys and break old clients). Treat stable server functions as formal API boundaries. (Site is a JS shell; content verified via its RSS feed.)
Weaponizing and Defending the React Flight Protocol: Deserialization Sinks in RSCs
You ship RSC — the Flight payload is a deserialization sink, not inert data: validate everything crossing the boundary with a strict schema and harden CSRF on server functions.
The DEFENSE half of this entry's Flight-protocol readings, which are otherwise all attack postmortems. Walks the protocol as an attack surface — a line-delimited format with its own type system, its own reference resolution, and its own rules for reconstructing executable behavior on the client — then works through the CVSS 10.0 React2Shell mechanics (CVE-2025-55182) to a RANKED set of defenses, from strict schema validation of everything crossing the boundary to CSRF hardening. Read when you ship RSC and need practice, not just incident history.
Disrupting supply chain attacks on npm and GitHub Actions
You run a production pipeline — GitHub's 2026 platform defaults (staged publishing, install-script blocking, Dependabot cooldown, account lockdown) now cover several supply-chain layers; know which mitigations remain yours (egress control, non-npm registries).
The first-party umbrella over this entry's whole supply-chain thread: GitHub's 2026 program in one post — npm staged publishing, install-script restrictions (npm v12), 72-hour read-only account lock after email/2FA-recovery changes, Actions hardening (checkout defaults, workflow-execution policies, read-only cache), an outbound-network-firewall technical preview, and a 3-day default Dependabot cooldown. The platform-side complement to the Shai-Hulud and TanStack postmortems' local mitigations.
Blocking Install Scripts Is Not a Silver Bullet
The nuance behind this entry's supply-chain note: npm v12's default block on preinstall/install/postinstall closes the INSTALL-TIME door but leaves the EXECUTION-TIME door open.
Attackers already moved the payload into the module body as a top-level side effect (runs on first require), or ship a binding.gyp so npm's implicit node-gyp rebuild fires anyway (the June-2026 Miasma campaign). Removing a trigger isn't removing the capability — so layer defenses: Node's --permission model (--allow-net / --allow-child-process / --allow-fs-write to cap what running code may DO), CI egress allow-listing (Harden-Runner), and container/seccomp isolation. Install-script blocking raises the floor; it is not the ceiling.
Over-the-air (OTA) JS updates & release channels (React Native)
Inside SWSH's automated mobile release pipeline with Expo
You ship OTA updates — gate each push behind an E2E run against the UPDATED bundle on the native build it is landing on, not just pre-merge CI; new JS onto an already-shipped binary is a pairing nothing else tests.
Fills the gap this entry's staged-rollout guidance leaves open — how to validate the update ITSELF before it ships. SWSH gates every EAS Update behind Meridian, an in-house end-to-end framework built on Appium and WebDriverIO and driven by Vitest, running critical flows against the updated bundle on iOS/App Clip/Android simulators in CI. The reasoning generalizes even though Meridian does not: an OTA update drops new JS onto a native binary already on users' devices, and ordinary pre-merge CI never exercises that pairing, so nothing confirms compatibility before real users do. Context for the scale claim: one React Native codebase covering iOS, an iOS App Clip, Android and web, ~300 builds a month on the team's own hardware, native releases about weekly.
The production playbook for OTA updates
You ship OTA updates — run them like releases: staged percentage rollouts, a monitored bake period, and know abort vs republish-rollback as distinct mitigations before you need one.
The operational canon for this entry: staged percentage rollouts as exposure control, what to monitor while an update bakes, and aborts vs republish-rollbacks as distinct mitigations — 'sometimes it helps to go a little slower.' Vendor-authored but the staged-rollout discipline is platform-agnostic. (Body verified via the page's embedded content JSON — the blog is a JS shell.)
Relaunching TeamReach: how OTA updates saved a 5,000,000-user cutover
You rely on OTA rollback — it is unsafe once a bad update wrote persistent state older code cannot read, a fix reaches users only as they relaunch (~24h here), and expo-updates recovers only pre-first-render crashes; plan to fix forward.
A production cutover where OTA was the plan, not the safety net: a 3-month Expo rewrite of two native apps cut over every user overnight, then shipped twelve OTA updates in three days (about $4,000 on MAU billing, where repeated updates to the same audience cost little more than one). Most breakage came from a decade of untyped legacy data (fields that were tinyint, then JSON, then HTML), fixed in the client. Three caveats this entry's rollback framing lacked: they FIXED FORWARD because rolling back is not safe once a bad update has written persistent state the older code cannot read; publishing is not delivering (expo-updates applies a fix on the launch that downloads it in time, otherwise on the next one, so a fix took ~24h to reach the fleet); and expo-updates' automatic recovery only catches a fatal JS error early in launch, before first render, falling back to the last working update. Vendor-hosted and business-authored, with the technical detail relayed from the lead developer.
EAS Update introduction (docs)
The reference for the hosted-default choice: how updates map to channels, phased rollouts to a percentage of users, and rollback-by-republish ('much like a new commit').
Read before designing a release-channel scheme.