1. 19 Nov, 2025 16 commits
  2. 18 Nov, 2025 11 commits
    • Andrew Clark's avatar
      [Segment Cache] Re-implement refresh reducer (#84426) · 954354f2
      Andrew Clark authored
      This re-implements the refresh reducer to use the Segment Cache-style
      flow, similar to how the navigate reducer already works.
      
      Most of the logic can be reused from what was already implemented for
      navigations. The bulk of the changes are related to the case where a
      "default" parallel route slot is not present on the current page, and so
      needs to be refreshed from an older page's URL.
      
      Theoretically, this should be the last remaining case where we rely on
      the lazy fetching logic in LayoutRouter. I think there may still be some
      error cases where we still rely on that, though. Once these are all
      addressed, we can remove the lazy-fetching mechanism entirely.
      954354f2
    • nextjs-bot's avatar
      v16.0.2-canary.24 · 83ae64fe
      nextjs-bot authored
      83ae64fe
    • Tobias Koppers's avatar
      Turbopack: use batch insert to make dependencies outdated (#85625) · 72a32c34
      Tobias Koppers authored
      ### What?
      
      Refactor making dependencies outdated and use batch add
      72a32c34
    • Wyatt Johnson's avatar
      Fix prerendering of interception routes with generateStaticParams (#85835) · d7608f7e
      Wyatt Johnson authored
      ## What
      
      Fixes a bug where interception routes in parallel slots could not be
      prerendered using `generateStaticParams`, causing 404 responses when
      these routes were accessed directly.
      
      ## Why
      
      **The Problem:**
      
      Interception routes like `app/@modal/(.)photo/[id]/page.tsx` could not
      be prerendered even when they exported `generateStaticParams`. This was
      because the static path generation code only examined "children"
      segments in the loader tree, completely missing segments from parallel
      routes (like `@modal`) that actually contribute to the pathname.
      
      **Root Cause:**
      
      The previous implementation used `childrenRouteParamSegments` which only
      traversed the `children` branch of the loader tree:
      
      ```typescript
      // OLD: Only looked at children
      const childrenRouteParamSegments = [...segments from children only...]
      
      // This missed parallel routes like @modal that have dynamic segments
      ```
      
      For a route structure like:
      ```
      app/
        [username]/
          page.tsx
        @modal/
          (.)[username]/
            [id]/
              page.tsx  // ← This route's segments were MISSED
      ```
      
      The build system couldn't discover the `[id]` parameter in the parallel
      route because it never traversed that branch of the tree.
      
      ## How
      
      **Solution:**
      
      Introduces `extractPathnameSegments()` which properly traverses the
      ENTIRE loader tree (not just children) to find ALL segments that
      contribute to the pathname:
      
      1. **BFS Traversal**: Explores both `children` AND all parallel route
      slots (e.g., `@modal`, `@sidebar`)
      
      2. **Depth Tracking**: Correctly tracks URL depth by:
         - Skipping route groups `(marketing)` - not in URL
         - Skipping parallel markers `@modal` - not in URL
         - Including interception markers `(.)photo` - ARE in URL
      
      3. **Prefix Validation**: Ensures static segments match the target
      pathname before including dynamic segments
      
      4. **Complete Parameter Discovery**: Returns all segments that
      contribute to pathname construction, regardless of which tree branch
      they're in
      
      **Example:**
      
      For `app/@modal/(.)photo/[id]/page.tsx`:
      - Old: Missed the `[id]` parameter entirely
      - New: Discovers `[id]` and enables prerendering with
      `generateStaticParams`
      
      ## Changes
      
      **New Module**: `extract-pathname-segments.ts` (192 lines)
      - Core algorithm for traversing loader tree and extracting pathname
      segments
      - Handles complex cases: parallel routes, interception routes, route
      groups
      - Well-documented with examples and algorithm explanation
      
      **Comprehensive Tests**: `extract-pathname-segments.test.ts` (897 lines)
      - Tests for simple cases, nested structures, parallel routes
      - Interception route handling in various configurations
      - Route group behavior and edge cases
      - Depth tracking validation
      
      **Integration**: `static-paths/app.ts`
      - Replaced `childrenRouteParamSegments` with `extractPathnameSegments()`
      - Updated pathname construction to use segments from parallel routes
      - Maintained backward compatibility
      
      **E2E Test**: Added test validating prerendering works for intercepted
      routes
      
      ## Test Plan
      
      The new E2E test verifies:
      ```typescript
      it('should prerender a dynamic intercepted route', async () => {
        // Verifies build output contains the prerendered interception route
        expect(next.cliOutput).toContain('/(.)john/1')
        // Verifies it doesn't generate the non-intercepted path
        expect(next.cliOutput).not.toContain('/john/1')
      })
      ```
      
      ## Impact
      
      **Before**: Interception routes with dynamic segments returned 404 when
      accessed directly, even with `generateStaticParams`
      
      **After**: These routes are properly prerendered at build time and
      return correct responses
      d7608f7e
    • Joseph's avatar
      docs: follow up to getting started CC and use-cache API ref (#85582) · fedee7d7
      Joseph authored
      Expanding on the Getting started for CC and also extending `use cache`
      
      ---------
      Co-authored-by: 's avatarDelba de Oliveira <32464864+delbaoliveira@users.noreply.github.com>
      fedee7d7
    • Jonathan Ho's avatar
      docs: cacheHandlers use object instead of class (#86022) · d174698c
      Jonathan Ho 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
      
      ### 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 #
      
      -->
      
      This PR fixes the docs' example where it used class (like cacheHandler
      (no s)), but cacheHandlers expect an object.
      
      ---------
      Co-authored-by: 's avatarJoseph <joseph.chamochumbi@vercel.com>
      d174698c
    • Sebastian "Sebbie" Silbermann's avatar
    • Joseph's avatar
      chore: remove empty docs folder (#86216) · a63f1596
      Joseph authored
      a63f1596
    • Jon Meyers's avatar
      Chore: Update with-supabase example to Next.js 16 (#86105) · fc4f062b
      Jon Meyers authored
      ### What?
      
      Upgrade with-supabase example to be compatible with Next.js 16
      
      ### Why?
      
      1. Users get console warnings about middleware vs proxy
      2. Enabling Cache Components config results in build errors for async
      behaviour outside Suspense boundary
      3. Turbopack flag is default and therefore, no longer necessary on `npm
      run dev`
      
      ### How?
      
      1. Renamed all instances of `middleware` to `proxy`
      2. Wraped async behaviour in Suspense boundaries
      3. Removed --turbopack flag from `npm run dev`
      
      ---------
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      fc4f062b
    • Sebastian "Sebbie" Silbermann's avatar
    • Will Binns-Smith's avatar
      next analyze: annotate polyfill modules in UI (#86062) · 3e5b96a1
      Will Binns-Smith authored
      For small routes, it can appear like the polyfill chunk takes up a sizable amount of data, but `polyfill-nomodule.js` is only sent to legacy browsers. This makes it clearer.
      
      This PR enhances the bundle analyzer by adding visual indicators for polyfill chunks, and noting they're conditionally sent to modern or legacy browsers. The changes include:
      
      - Adds a source map to polyfill chunks (for the large pre-bundled input only)
      - Visually distinguished polyfill chunks in the treemap by lightening their color
      - Added a "Polyfill" badge (other badges coming soon!) with text when viewing polyfill chunk details
      
      <img width="388" height="227" alt="image" src="https://github.com/user-attachments/assets/bcebfba6-1e10-459a-9364-b6b8197cd3df" />
      
      Fixes PACK-5826
      3e5b96a1
  3. 17 Nov, 2025 13 commits