1. 21 Aug, 2024 2 commits
    • vercel-release-bot's avatar
      v14.2.6 · 427c01de
      vercel-release-bot authored
      427c01de
    • JJ Kasper's avatar
      Ensure fetch cache TTL is updated properly (#69164) · d4ca0b9e
      JJ Kasper authored
      To reduce the number of set requests we were sending upstream we added
      an optimization to skip sending the set request if the cached data
      didn't change after a revalidation. The problem with this optimization
      is the upstream service relies on this set request to know to update the
      cache entries TTL and consider it up to date. This causes unexpected
      revalidations while the cache value hasn't changed and the TTL is kept
      stale.
      
      x-ref: NEXT-3693
      # Conflicts:
      #	packages/next/src/server/lib/incremental-cache/fetch-cache.ts
      #	test/turbopack-build-tests-manifest.json
      d4ca0b9e
  2. 05 Aug, 2024 2 commits
  3. 02 Aug, 2024 1 commit
  4. 10 Jul, 2024 1 commit
  5. 09 Jul, 2024 13 commits
  6. 02 Jul, 2024 1 commit
  7. 11 Jun, 2024 7 commits
    • vercel-release-bot's avatar
      v14.2.4 · 30784418
      vercel-release-bot authored
      30784418
    • Janka Uryga's avatar
      [not a backport] fix lint errors · 0538a0dc
      Janka Uryga authored
      0538a0dc
    • Janka Uryga's avatar
      fix: app-router prefetch crash when an invalid URL is passed to Link (#66755) · 2807fb48
      Janka Uryga authored
      Closes [#66650](https://github.com/vercel/next.js/issues/66650)
      Closes NEXT-3520
      
      - Make Link not throw during prefetch if it received an invalid `href`
      (see [#66650](https://github.com/vercel/next.js/issues/66650))
      - Throw in dev mode if an invalid link was passed to `router.prefetch`
      -- this matches current prod behavior
      - (previously, we'd immediately exit out of `router.prefetch`, so the
      user would see no indication that this'd fail in prod)
      
      If an invalid URL was passed to `<Link>`, the whole app would crash and
      show "A client-side exception occurred". A failed prefetch should not
      bring down the whole app.
      
      Note that This preserves the current behavior of explicit
      `router.prefetch(url)` throwing an error if `url` is invalid. We may
      want to adjust this in the future, but that could be considered a
      breaking change, so I'm leaving it out for now. This only affects
      `Link`, which was intended to catch any errors thrown from
      `router.prefetch`, but that bit was accidentally broken.
      2807fb48
    • JJ Kasper's avatar
      Add timeout/retry handling for fetch cache (#66652) · efb476e2
      JJ Kasper authored
      As discussed this adds handling to timeout at a max of 500ms for fetch
      cache request and retries a max of 3 times due to network instability.
      This also adds cache service tests and fixes a case we've been trying to
      track down where we were seeing `undefined` cache URL values which made
      debugging fetches tricky.
      # Conflicts:
      #	packages/next/src/server/base-server.ts
      #	packages/next/src/server/lib/incremental-cache/fetch-cache.ts
      #	packages/next/src/server/web/spec-extension/unstable-cache.ts
      efb476e2
    • Jiachi Liu's avatar
      Use addDependency to track metadata route file changes (#66714) · c16a3f99
      Jiachi Liu authored
      Use `addDependency` to track the file path passed to
      `next-metadata-route-loader`
      
      NOTE: We cannot apply the `next-metadata-route-loader` directly to the
      metatda convention source files, since the json file could be processed
      by json loader (Related previous fix #62615)
      
      Previously when we passed down the file path as argument to the loader,
      which sort of breaking the caching of webpack as the actual resource
      path is string, it's not tracked as a dependency. This change fixed the
      bad caching issue of static metadata routes. Based on the above reason
      we use `addDependency` here to track the dependency change
      
      Closes NEXT-3521
      Closes #65755
      c16a3f99
    • JJ Kasper's avatar
      Fix inconsistency with 404 getStaticProps cache-control (#66674) · 942e45a7
      JJ Kasper authored
      While investigating unexpected stale responses when leveraging
      `getStaticProps` on the 404 page noticed we have an inconsistency
      between local and deployed due to `Cache-Control` being set to
      `no-store, must-revalidate` even though a revalidate period is provided.
      The inconsistency also differs between the HTML response and the data
      response `_next/data` which causes even more unexpected behavior. To
      avoid this behavior, this replaces the handling to ensure we honor the
      originally provided revalidate period during `notFound: true` for the
      `Cache-Control` header.
      
      Validated against provided reproduction here
      https://github.com/fusdev0/next-notfound-revalidate
      Deployment:
      https://vercel.live/link/next-notfound-revalidate-govzskknf-vtest314-ijjk-testing.vercel.app/fallback-blocking/fasdf
      
      Prior PR for prior context that introduced this
      https://github.com/vercel/next.js/pull/19165
      
      x-ref: [slack
      thread](https://vercel.slack.com/archives/C0676QZBWKS/p1717492459342109)
      # Conflicts:
      #	packages/next/src/server/base-server.ts
      942e45a7
    • Karim Shehadeh's avatar
      Prevent append of trailing slash in cases where path ends with a file extension (#66636) · 9728a35d
      Karim Shehadeh authored
      ### What
      
      Skip adding trailing slash for file pattern like same origin urls
      
      ### Why
      
      Fixes #66635
      
      Next.js will not append trailing slash for file like pattern urls when
      `trailingSlash` is enabled. This PR aligns the behavior of the metadata
      trailing slash appending with next-server route handling.
      
      ---------
      Co-authored-by: 's avatarJiachi Liu <inbox@huozhi.im>
      9728a35d
  8. 10 Jun, 2024 2 commits
  9. 06 Jun, 2024 4 commits
  10. 05 Jun, 2024 3 commits
  11. 04 Jun, 2024 2 commits
    • Zack Tanner's avatar
      lock CNA tests to 14.2.3 · 564b620d
      Zack Tanner authored
      564b620d
    • Zack Tanner's avatar
      fix: ensure route handlers properly track dynamic access (#66446) · 85bb8728
      Zack Tanner authored
      In #60645, dynamic access tracking was refactored but we erroneously
      stopped tracking dynamic access in route handlers. Request proxying, as
      well as tracking segment level configs (such as `export const dynamic =
      'force-dynamic'`), were only enabled during static generation. This was
      an unintended breaking change that consequently caused dynamic access to
      not properly bail from data cache in various circumstances.
      
      This adds some more rigorous testing for route handlers, as this seems
      to be a fairly large gap in our fetch cache testing currently.
      
      This PR is easiest to review with [whitespace
      disabled](https://github.com/vercel/next.js/pull/66446/files?w=1).
      85bb8728
  12. 24 Apr, 2024 1 commit
  13. 23 Apr, 2024 1 commit
    • JJ Kasper's avatar
      Clean-up fetch metrics tracking (#64746) · a230be48
      JJ Kasper authored
      This ensures we only track fetch metrics in development mode as that's
      the only time we report them currently, this also adds an upper limit on
      how many metrics we store per-request as previously this was unbounded,
      on top of that this ensures we don't keep tracking fetch metrics after
      the request has ended as we only report on request end, and finally this
      adds a clean-up to the reference we attach to the request object
      containing the fetch metrics once we have used them.
      
      Closes: https://github.com/vercel/next.js/issues/64212
      
      Closes NEXT-3159
      a230be48