1. 05 Feb, 2025 31 commits
  2. 04 Feb, 2025 9 commits
    • Donny/강동윤's avatar
      perf: Make server action pass use `Atom` instead of `String` (#75594) · 49b93c6d
      Donny/강동윤 authored
      ### What?
      
      Use `swc_atoms::Atom` instead of `String` in `next-swc`. 
      
      ### Why?
      
      `Atom` does not allocate if another instance has the same value, meaning that `clone()` is a single atomic operation. But `String` allocates regardless of any other occurrence.
      49b93c6d
    • Donny/강동윤's avatar
      perf: Make RSC pass use `Atom` instead of `String` (#75593) · 361d4cf0
      Donny/강동윤 authored
      ### What?
      
      Use `swc_atoms::Atom` instead of `String` in `next-swc`. 
      
      ### Why?
      
      `Atom` does not allocate if another instance has the same value, meaning that `clone()` is a single atomic operation. But `String` allocates regardless of any other occurrence.
      361d4cf0
    • Donny/강동윤's avatar
      perf: Make barrel optimizer use `Atom` instead of `String` (#75592) · c1d9a048
      Donny/강동윤 authored
      ### What?
      
      Use `swc_atoms::Atom` instead of `String` in `next-swc`. 
      
      ### Why?
      
      `Atom` does not allocate if another instance has the same value, meaning that `clone()` is a single atomic operation. But `String` allocates regardless of any other occurrence.
      c1d9a048
    • vercel-release-bot's avatar
      v15.2.0-canary.40 · f998bdb4
      vercel-release-bot authored
      f998bdb4
    • Wyatt Johnson's avatar
      feat: added support for prefetch segments when deployed (#75202) · 06eb067a
      Wyatt Johnson authored
      Designed to enable the client prefetch segments feature when deployed on
      Vercel, this adds additional fields and data to the manifests to allow
      the CLI to create the rewrite rules needed to serve the prefetch
      segments. The fallback routes also now emit their RSC data to disk even
      though only their filenames are used.
      
      We emit the routes for the prefetches using backreferences. For example,
      for the route:
      
      ```
      /blog/[...slug].segments/$c$slug$[...slug]/__PAGE__.segment.rsc
      ```
      
      We create the following Regular Expression:
      
      ```ts
      /^\/blog\/(?<nxtPslug>.+?)\.segments\/\$c\$slug\$\k<nxtPslug>\/__PAGE__\.segment\.rsc$/
      ```
      
      Which enforces that the named capture group `nxtPslug` is the same for
      both the `[...slug].segments` and the `$c$slug$[...slug]`:
      
      ```
      Matching:
      /blog/my-post.segments/$c$slug$my-post/__PAGE__.segment.rsc
      /blog/hello-world.segments/$c$slug$hello-world/__PAGE__.segment.rsc
      /blog/2024-01.segments/$c$slug$2024-01/__PAGE__.segment.rsc
      
      Not Matching
      /blog/post-1.segments/$c$slug$post-2/__PAGE__.segment.rsc
      ```
      
      This also fixed a bug where the client segment prefetch keys included
      double `//`.
      
      <!-- 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 #
      
      -->
      
      ---------
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      06eb067a
    • Jiachi Liu's avatar
      polish hydration errors (#75632) · fbe971c1
      Jiachi Liu authored
      fbe971c1
    • Niklas Mischkulnig's avatar
      Turbopack: don't cell CodeGen-s (#75513) · 477eaf0e
      Niklas Mischkulnig authored
      No need to cell them, they are module-specific anyway.
      
      ```
      testing against 0293c96cf32
      
      canary dd676ccb:
      14,7 GB
      TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD=  533.84s user 84.44s system 834% cpu 1:14.10 total
      TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD=  526.68s user 86.15s system 834% cpu 1:13.48 total
      
      plus fewer cells b5ce9afeb5:
      14,3 GB
      TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD=  517.74s user 85.77s system 831% cpu 1:12.54 total
      TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD=  516.06s user 85.35s system 836% cpu 1:11.89 total
      
      plus no self reads b3370a59ca:
      13,8 GB
      TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD=  516.65s user 84.11s system 834% cpu 1:12.01 total
      TURBO_ENGINE_READ_ONLY=1 NEXT_TURBOPACK_TRACING= TURBOPACK=1 TURBOPACK_BUILD=  518.01s user 87.55s system 839% cpu 1:12.15 total
      ```
      
      <details>
      <summary>Old</summary>
      
      ```
      canary 82026906:
      15,3gb
      492.59s user 103.43s system 736% cpu 1:20.90 total
      495.16s user 96.50s system 739% cpu 1:20.01 total
      
      code-gen bd58ad63a7:
      14,95gb
      489.30s user 102.66s system 745% cpu 1:19.36 total
      501.91s user 105.99s system 743% cpu 1:21.80 total
      ```
      
      </details>
      477eaf0e
    • Tobias Koppers's avatar
      [Turbopack] correctly apply defines (#75643) · 0cff3757
      Tobias Koppers authored
      ### What?
      
      Defines like `process.env.NODE_ENV` were not correctly applied to turbopack-cli. This fixes it.
      0cff3757
    • JJ Kasper's avatar
      Add nodejs runtime support for middleware (#75624) · c84be735
      JJ Kasper authored
      This allows setting `runtime: 'nodejs'` in middleware, which removes the
      constraint of only using edge runtime APIs for middleware. This doesn't
      change the signature of middleware and it still receives `(req:
      NextRequest, event: NextFetchEvent) => Response`.
      
      x-ref: https://github.com/vercel/next.js/discussions/71727
      x-ref: https://github.com/vercel/next.js/discussions/46722
      c84be735