1. 14 Jun, 2022 3 commits
  2. 13 Jun, 2022 14 commits
  3. 11 Jun, 2022 4 commits
  4. 10 Jun, 2022 8 commits
  5. 09 Jun, 2022 6 commits
    • Shu Ding's avatar
      Revert "Revert "Avoid unnecessary router state changes"" (#37593) · 78cbfa06
      Shu Ding authored
      Reverts vercel/next.js#37572, with a new test case added about `routeChangeComplete`.
      78cbfa06
    • JJ Kasper's avatar
      Ensure check-precompiled exits correctly on failure (#37592) · b4298f95
      JJ Kasper authored
      * Ensure check-precompiled exits correctly on failure
      
      * update compiled
      b4298f95
    • Shu Ding's avatar
      Fix client entry unexpectedly created in app dir (#37561) · c613608b
      Shu Ding authored
      fix client entry unexpectedly created
      c613608b
    • Jiachi Liu's avatar
      Fix react root env missing in NextServer (#37562) · 0bfdf0e0
      Jiachi Liu authored
      * Fix react root env missing in NextServer
      
      * switch to useId instead of using process.env var
      
      * add production test
      
      * extend timeout
      
      * fix test
      
      * fix lint
      
      * use version to detect if enable react root
      0bfdf0e0
    • Gal Schlezinger's avatar
      [middleware] support destructuring for env vars in static analysis (#37556) · 91552018
      Gal Schlezinger authored
      This commit enables the following patterns in Middleware:
      
      ```ts
      // with a dot notation
      const { ENV_VAR, "ENV-VAR": myEnvVar } = process.env;
      
      // or with an object access
      const { ENV_VAR2, "ENV-VAR2": myEnvVar2 } = process["env"];
      ```
      
      ### Related
      
      - @cramforce asked this fixed here: https://github.com/vercel/next.js/pull/37514#discussion_r892437257
      
      
      
      ## Feature
      
      - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [x] Related issues linked using `fixes #number`
      - [x] Integration tests added
      - [ ] Documentation added
      - [ ] Telemetry added. In case of a feature if it's used or not.
      - [ ] Errors have helpful link attached, see `contributing.md`
      91552018
    • Kiko Beats's avatar
      Middleware: remove `req.ua` (#37512) · 76083210
      Kiko Beats authored
      This PR moves the internal logic associated with `req.ua` into an explicit method the user should to call to have the same behavior.
      
      **before**
      
      ```typescript
      // middleware.ts
      import { NextRequest, NextResponse } from 'next/server'
      export function middleware(request: NextRequest) {
        const url = request.nextUrl
        const viewport = request.ua.device.type === 'mobile' ? 'mobile' : 'desktop'
        url.searchParams.set('viewport', viewport)
        return NextResponse.rewrites(url)
      }
      ```
      
      **after**
      
      ```typescript
      // middleware.ts
      import { NextRequest, NextResponse, userAgent } from 'next/server'
      export function middleware(request: NextRequest) {
        const url = request.nextUrl
        const { device } = userAgent(request)
        const viewport = device.type === 'mobile' ? 'mobile' : 'desktop'
        url.searchParams.set('viewport', viewport)
        return NextResponse.rewrites(url)
      }
      ```
      
      This potentially will save the extra 17 kB related to the size of `ua-parser-js`
      76083210
  6. 08 Jun, 2022 5 commits