next.js
e6533fed - docs: clarify Image priority migration and loading choices (#101345)

Commit
26 days ago
docs: clarify Image priority migration and loading choices (#101345) ## Summary Clarify that replacing deprecated `priority` with `preload` preserves image preloading behavior, while `loading="eager"` is sufficient when the goal is to disable lazy loading. - Update the Image API reference, shared by the App and Pages Routers, to explain when a hero/LCP image benefits from discovery before its `<img>` element. Explain eager loading and fetch priority separately, including that `fetchPriority="high"` alone does not disable lazy loading. - Align the streaming guide's LCP recommendation with that selection guidance and link to the Image reference. Avoid promising preloading in the first response chunk when the Image component has not rendered yet. Related finding: https://next-maintainer-agent.vercel.tools/agent-feedback/6689 ## Verification Built a standalone App Router and Pages Router fixture with `next@16.5.0-canary.43` and React/React DOM `19.3.1`, using both Turbopack and webpack production builds. The installed package's source maps for `get-img-props.ts` and `image-component.tsx` match the PR base byte-for-byte. - 60 production HTTP cases checked image loading attributes, fetch priority, preload hints, and streaming output for six prop combinations across both builds. - 24 Chromium cases checked requests and image loading before and after scrolling, across both routers and bundlers. `priority`, `preload`, eager, and eager-plus-high loaded offscreen images before scrolling; default lazy loading and high fetch priority alone waited for scrolling. - 12 Chromium streaming cases checked resource timing and LCP. Preloaded and eager images downloaded before a delayed Suspense boundary revealed them; preloading did not remove the paint delay. - Late-rendered-image cases confirmed that preload hints were emitted after the component's intentional 1.8-second delay, not in the first chunk. - Eager loading also produced React-generated preload hints, so the guidance describes disabling lazy loading without promising that discovery begins only at the `<img>` element. - Dev compilation and runtime diagnostics were clear. Prettier, ESLint, and anchor/shared-source checks passed. These are functional checks in Chromium, not a performance benchmark or a claim that a loading strategy is universally faster. <!-- NEXT_JS_LLM -->
Author
Parents
Loading