1. 26 Aug, 2025 1 commit
  2. 25 Aug, 2025 10 commits
  3. 20 Aug, 2025 1 commit
  4. 19 Aug, 2025 26 commits
    • Ben Gubler's avatar
    • nextjs-bot's avatar
      v15.4.2-canary.56 · 8f6d345d
      nextjs-bot authored
      8f6d345d
    • Joseph's avatar
      docs: Route props helpers, typegen and next lint deprecation (#82784) · 533bcd14
      Joseph authored
      As this lands and people learn about the new Route Props helpers, I
      think we will have this period where the TypeScript snippets show the
      manual typing, but in key places we introduce the helpers usage. We can
      then follow up updating all TypeScript snippets showing a page, layout
      or route, to use these.
      
      ---------
      Co-authored-by: 's avatarBen Gubler <nebrelbug@gmail.com>
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      533bcd14
    • Madhur Mittal's avatar
      docs: fix TS error in Node.js runtime local assets example (#82672) · e6718d69
      Madhur Mittal authored
      ## What?  
      Updated the documentation for `opengraph-image` / `twitter-image` to fix
      the **Node.js runtime with local assets** example.
      
      ## Why?  
      The existing snippet did not type-check cleanly with Next.js 15+ and
      could confuse developers.
      This update improves developer experience by ensuring the snippet is
      immediately usable and accurate.
      
      ## How?  
      - Reproduced the example in a fresh Next.js 15+ project.  
      - Updated the docs example to:  
        - Use `readFile` + Base64 encoding instead of invalid file URLs.  
        - Clarify that assets should be placed relative to the project root.  
      - Added an entry to **Version History** noting the update in v15.x.  
      
      ## Checklist  
      - [x] Ran `pnpm prettier-fix`  
      - [x] Verified formatting & linting (`pnpm build && pnpm lint`)  
      - [x] Documentation guidelines followed  
      - [x] Example verified in a real Next.js 15 project  
      
      Fixes #75583 & #75625 (if considered same class of issue)
      
      ---------
      Co-authored-by: 's avatarJoseph <sephxd1234@gmail.com>
      Co-authored-by: 's avatarJoseph <joseph.chamochumbi@vercel.com>
      e6718d69
    • Ben Gubler's avatar
      91da0033
    • nextjs-bot's avatar
      v15.4.2-canary.55 · e3e21977
      nextjs-bot authored
      e3e21977
    • Ben Gubler's avatar
      fix: possible null access (#82799) · 408920c5
      Ben Gubler authored
      <!-- Thanks for opening a PR! Your contribution is much appreciated.
      To make sure your PR is handled as smoothly as possible we request that
      you follow the checklist sections below.
      Choose the right checklist for the change(s) that you're making:
      
      ## For Contributors
      
      ### Improving Documentation
      
      - Run `pnpm prettier-fix` to fix formatting issues before opening the
      PR.
      - Read the Docs Contribution Guide to ensure your contribution follows
      the docs guidelines:
      https://nextjs.org/docs/community/contribution-guide
      
      ### Adding or Updating Examples
      
      - The "examples guidelines" are followed from our contributing doc
      https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
      - Make sure the linting passes by running `pnpm build && pnpm lint`. See
      https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md
      
      ### Fixing a bug
      
      - Related issues linked using `fixes #number`
      - Tests added. See:
      https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
      - Errors have a helpful link attached, see
      https://github.com/vercel/next.js/blob/canary/contributing.md
      
      ### Adding a feature
      
      - Implements an existing feature request or RFC. Make sure the feature
      request has been accepted for implementation before opening a PR. (A
      discussion must be opened, see
      https://github.com/vercel/next.js/discussions/new?category=ideas)
      - Related issues/discussions are linked using `fixes #number`
      - e2e tests added
      (https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
      - Documentation added
      - Telemetry added. In case of a feature if it's used or not.
      - Errors have a helpful link attached, see
      https://github.com/vercel/next.js/blob/canary/contributing.md
      
      
      ## For Maintainers
      
      - Minimal description (aim for explaining to someone not on the team to
      understand the PR)
      - When linking to a Slack thread, you might want to share details of the
      conclusion
      - Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
      - Add review comments if necessary to explain to the reviewer the logic
      behind a change
      
      ### What?
      
      ### Why?
      
      ### How?
      
      Closes NEXT-
      Fixes #
      
      -->
      408920c5
    • Ben Gubler's avatar
      fix: don't fail with amp config in JS (#82798) · 4e9cc189
      Ben Gubler authored
      Because tsc doesn't infer string literal types in JS files
      
      ---------
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      4e9cc189
    • Ben Gubler's avatar
      feat: add a codemod to migrate from the deprecated "next lint" command (#82685) · c57fe256
      Ben Gubler authored
      ## Add codemod to migrate from `next lint` to ESLint CLI
      
      This PR introduces a new codemod `next-lint-to-eslint-cli` that helps
      users migrate away from the deprecated `next lint` command to using
      ESLint directly, in preparation for Next.js 16 where `next lint` will be
      removed.
      
      ### What it does
      
      The codemod automates the migration process by:
      
      1. **Updating package.json scripts** - Replaces all `next lint` commands
      with `eslint` equivalents
      - Maps Next.js-specific flags (`--strict` → `--max-warnings 0`,
      `--dir`/`--file` → paths)
         - Preserves other ESLint-compatible flags
      - Handles complex scripts with pipes, redirects, and multiple commands
      
      2. **Managing ESLint configuration**
         - Creates a new flat config (`eslint.config.mjs`) if none exists
         - Updates existing flat configs to include Next.js rules
         - Provides guidance for legacy configs that need manual migration
      
      3. **Installing dependencies automatically**
      - Adds required packages: `eslint`, `eslint-config-next`,
      `@eslint/eslintrc`
         - Detects and uses the project's package manager (npm/yarn/pnpm/bun)
         - Falls back to manual instructions if installation fails
      
      ### Usage
      
      ```bash
      npx @next/codemod@latest next-lint-to-eslint-cli .
      ```
      
      ### Example transformations
      
      ```json
      // Before
      {
        "scripts": {
          "lint": "next lint",
          "lint:fix": "next lint --fix",
          "lint:strict": "next lint --strict --dir src"
        }
      }
      
      // After
      {
        "scripts": {
          "lint": "eslint .",
          "lint:fix": "eslint --fix .",
          "lint:strict": "eslint --max-warnings 0 src"
        }
      }
      ```
      
      ### Why this change?
      
      - `next lint` is being deprecated and will be removed in Next.js 16
      - ESLint v9+ flat config is becoming the standard
      - Direct ESLint usage provides more flexibility and better ecosystem
      compatibility
      - Reduces Next.js maintenance burden of wrapping ESLint functionality
      
      The codemod ensures a smooth transition path for existing Next.js
      projects while following ESLint best practices.
      c57fe256
    • Benjamin Woodruff's avatar
      Turbopack: Remove beta warning (#82797) · ad48b8f4
      Benjamin Woodruff authored
      Feedback from @feedthejim:
      
      - It's scarier than it needs to be, beta builds should be fine for most users.
      - This is opt-in, so users probably aren't going to use it by accident.
      - We don't tend to do this level of warning for other feature flags.
      ad48b8f4
    • Benjamin Woodruff's avatar
      Turbopack: Define built-in webpack conditions using an enum and typescript union (#82765) · ff756b2c
      Benjamin Woodruff authored
      ## Context
      
      We have some publicly documented syntax for configuring webpack loaders here: https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopack#configuring-webpack-loaders
      
      However, we also have some undocumented features. Specifically, we have two different "condition" concepts, both of which are shown here: https://github.com/vercel/next.js/blob/1766a1aba6a7c92a03c08073114652d61da1a388/packages/next/src/build/swc/index.ts#L836-L860
      
      1. The `conditions` field in the `turbopack` object of the config can be used to specify predicates (defined by file name glob, regex, or content of file) that can be referenced by rules.
      2. There are special built-in internal "conditions" that can be matched by passing an object to a `rule` that does not contain a `loader` field. These special conditions allow us to match on some things we couldn't otherwise declare conditions for.
      
      This is about improving the current state of #2, which I'm calling here to "webpack loader built-in conditions".
      
      Confusingly, there are also very similar conditions used by the resolver context. I'm not changing those, but I've done a tiny bit of work in this PR to better clarify the difference with naming and types.
      
      ## This PR
      
      - Instead of using an `RcStr`, for these conditions, use an enum. Theoretically that gives us less flexibility, but it makes it way easier to discover, document, and keep track of what built-in conditions we support. I feel that it's very important that we do this because this enum is effectively a public API, and I'd like to document some version of this API in a subsequent PR.
      - Use the exact union of supported fields in the zod schema and typescript definitions.
      - Represent the collection of conditions as a set instead of a vec. In reality, this doesn't have much impact because the set is small and always constructed in the same order, but the intent is clearer. Implemented `TaskInput` for `BTreeSet`.
      - Some minor consistency cleanup between `next_server` and `next_client`.
      - Get rid of some extra type conversions using the `rcstr!()` macro.
      ff756b2c
    • Janka Uryga's avatar
      [Cache Components] Faster partial hydration in PPR resumes (#82742) · 523ae09b
      Janka Uryga authored
      This PR fixes some HTML/RSC stream interleaving logic that, under some
      circumstances, resulted in hydration of a resumed page being delayed
      unnecessarily.
      
      Fixes NAR-284
      
      ---
      
      When SSRing a page, we're mixing two streams -- the HTML stream, and the
      RSC stream (containing scripts with RSC data, used for hydration). In a
      regular (non-PPR) render, we need to wait for react to flush the first
      HTML chunk (containing `<html><body>...`) before we can send the first
      RSC script. This was implemented in `createMergedTransformStream`.
      
      The problem was that `createMergedTransformStream` was also re-used when
      rendering a PPR `resume()`. In that case, we're only outputting the
      dynamic portion of HTML, and the shell is sent separately (either by the
      next server, outside of `app-render`, or by infrastructure), meaning
      that is _not_ part of the stream that `createMergedTransformStream`
      receives. But the "wait for the first html chunk" logic was still there,
      and thus, we were accidentally delaying sending any RSC scripts until
      the first piece of dynamic HTML was rendered even if they had no
      connection to each other. In particular, this also prevented us from
      sending hydration data for the static shell.
      
      There's one edge case here -- if we didn't produce a static shell (e.g.
      for suspense-above-body), we should still apply the html-waiting logic,
      otherwise we'd end up sending scripts before the body is rendered. But
      if we have a shell, we shouldn't wait for the HTML at all.
      
      This is now solved as follows:
      1. During the prerender, we track whether or not a shell (aka "prelude")
      was produced, and store that information in the postponed state object
      2. When resuming, we check whether the prerender had a shell, and if it
      does, we don't wait for HTML (under the assumption that it was already
      sent separately, outside the dynamic render)
      
      To test this, I've had to extend our testing setup a bit -- with the
      default settings, playwright would wait until `load` is fired, which
      seems to fire after all the HTML finished streaming and thus doesn't let
      us inspect whether partial hydration is working correctly. We're also
      waiting for `load` in `elementByCss` (apparently, for compatibility with
      tests written before playwright) so i've had to work around that as
      well.
      523ae09b
    • Ben Gubler's avatar
      feat: stabilize experimental.typedRoutes flag (#82762) · c970d951
      Ben Gubler authored
      - Rename `experimental.typedRoutes` to `typedRoutes` 
      - Remove old references to `typedRoutes` not working with Turbopack
      - Remove unnecessary encoding of `typedRoutes` for bundlers
      c970d951
    • nextjs-bot's avatar
    • Vercel Release Bot's avatar
      Update Rspack production test manifest (#82771) · 4a4c872e
      Vercel Release Bot authored
      This auto-generated PR updates the production integration test manifest used when testing Rspack.
      4a4c872e
    • Ben Gubler's avatar
      feat: deprecate 'next lint', add Biome support (#82266) · 9c1a97bf
      Ben Gubler authored
      # Transition from `next lint` to explicit ESLint configs and add Biome support
      
      ## What?
      This PR makes two major changes to Next.js linting:
      
      1. **Transitions away from `next lint`**: `create-next-app` now generates explicit ESLint configurations instead of relying on the `next lint` command
      2. **Adds Biome as a linter option**: Users can now choose between ESLint, Biome, or no linter during project setup
      
      ## Why?
      
      **ESLint Transition**: Provides transparency (users see exact rules), better IDE integration, easier customization, and follows industry standards for explicit configuration.
      
      **Biome Support**: Offers a faster, unified linting/formatting tool and gives users more choice in their developer experience.
      
      ## How?
      
      ### ESLint Configuration Generation
      - Generates `eslint.config.mjs` files that extend `eslint-config-next` packages
      - Includes proper ignores for build artifacts (`next-env.d.ts`, `.next/`, etc.)
      - Package.json scripts call `eslint .` directly instead of `next lint`
      - Maintains complete feature parity with current `next lint` behavior
      
      ### Biome Integration
      - Added `--biome` flag and interactive prompt selection
      - Generated `biome.json` configurations with Next.js and React domain rules
      - Includes both `lint` and `format` scripts for Biome projects
      
      ### Linter Selection
      Interactive prompt offers: **ESLint** (comprehensive rules), **Biome** (fast with fewer rules), **None** (skip linter)
      
      ### Deprecation
      Added deprecation warning to `next lint` command (removed in Next.js 16)
      
      ## Testing
      Added comprehensive test suites for both ESLint and Biome configuration generation across all template variants.
      
      This change modernizes Next.js linting while providing users with more choice and transparency.
      9c1a97bf
    • Hendrik Liebau's avatar
      Avoid duplicate WebSocket connection for global error pages (#82788) · 64b69ff0
      Hendrik Liebau authored
      When we're rendering a global error page (something with `<html
      id="__next_error__">`), we are wrapping the root element in a component
      that renders a top-level dev overlay to show the global error. The
      function that's wrapping this element was previously creating an
      unnecessary second WebSocket connection to handle the case where the
      error is removed by editing a server component, and the page is
      subsequently reloaded. However, this can be handled by the first
      WebSocket connection that's created in the root element just fine, we
      just need to ensure that the reload is also triggered when
      `document.documentElement.id` is `'__next_error__'`, which is the same
      [condition we use for rendering the
      wrapper](https://github.com/vercel/next.js/blob/a0b7a725a1b424473940fe3111842ae92d918a25/packages/next/src/client/app-index.tsx#L275).
      
      This change is covered by existing tests, e.g.
      `test/development/app-dir/missing-required-html-tags/index.test.ts`.
      64b69ff0
    • nextjs-bot's avatar
    • Hendrik Liebau's avatar
      [Cache Components] Fix HMR for nested pages (#82776) · 71f323d0
      Hendrik Liebau authored
      To bypass existing caches when editing server components, we store an
      HMR hash in a session cookie. The cookie is sent to the server when
      refetching the RSC, and included in the cache key of all `'use cache'`
      functions (see #75474).
      
      Before this fix, we weren't setting the cookie path properly, which led
      to multiple cookies for different paths being written and sent to the
      server. This caused stale values to be used for nested pages, which
      resulted in stale components being displayed after edits.
      
      Now, we set the cookie path to `/`, ensuring that the same cookie is
      used for all nested pages.
      
      closes NAR-204
      resolves #81538
      71f323d0
    • nextjs-bot's avatar
      v15.4.2-canary.54 · a745826b
      nextjs-bot authored
      a745826b
    • Niklas Mischkulnig's avatar
      Turbopack: don't look into fallback import map twice (#82786) · 73fadcac
      Niklas Mischkulnig authored
      Fixes a panic where we tried to lookup a `Pattern::Alternatives` in a `fallback_import_map.lookup()` (but the API is that the caller is in charge of unwrapping the alternative and calling lookup multiple times). We can completely skip this in this case, because the individual requests inside the `Request::Alternatives` already looked at the `fallback_import_map`, so no need to check again for the whole alternative as well.
      
      This was a somewhat recent regression:
      - https://github.com/vercel/next.js/pull/77954 made sure that `var` variables always have a `<dynamic>` variant added, due to their weird scope rules (or lack thereof).
      - https://github.com/vercel/next.js/pull/81541 then added a `fallback_import_map`
      73fadcac
    • Jiachi Liu's avatar
      [test] separate metadata font tests (#82746) · bccdb3fd
      Jiachi Liu authored
      bccdb3fd
    • Jiachi Liu's avatar
      13f413bb
    • Sebastian "Sebbie" Silbermann's avatar
    • Abhishek Ghimire's avatar
    • Josh Story's avatar
      [Cache Components] Defer Request Data API resolution to another task in dev when… · 929d6fa3
      Josh Story authored
      [Cache Components] Defer Request Data API resolution to another task in dev when it would suspend when prerendering (#82386)
      
      Stacked on #82381
      
      When resolving these Request Data APIs in dev we now do so in a new
      Task. This allows the environment tracking to properly move stuff that
      was previously in the Prerender environment to the Server environment
      when a Request Data API is used before them. This also has the nice side
      effect of causing these functions to appear as IO in the new
      suspended-by features of React Devtools.
      
      In Prod we don't need to do any additional delaying because the all of
      the features this is designed to interact with are dev only.
      929d6fa3
  5. 18 Aug, 2025 2 commits