1. 23 Aug, 2022 4 commits
  2. 22 Aug, 2022 19 commits
  3. 21 Aug, 2022 7 commits
    • Chase Adams's avatar
      fix meaninglessFileNames type in compiler options schema (#39698) · b7c2bd10
      Chase Adams authored
      # Bug 
      
      I would assume that this should be generated from TypeScript, but based on the [original PR](https://github.com/vercel/next.js/pull/38498/files) it wasn't clear that there was a way to generate these automatically.
      
      Fixes the type of `styledComponents. topLevelImportPaths` and `styledComponents.meaninglessFileNames` so that it matches the [TypeScript type](https://github.com/vercel/next.js/blob/canary/packages/next/server/config-shared.ts#L457).
      
      This was causing a warning here:
      
      ```
      warn  - Invalid next.config.js options detected: 
        - The value at .compiler.styledComponents must be a boolean but it was an object.
        - The value at .compiler.styledComponents.meaninglessFileNames must be a boolean but it was an array.
        - The value at .compiler.styledComponents must match exactly one schema in oneOf.
       ```
      
      ## Documentation / Examples
      
      - [x] Make sure the linting passes by running `pnpm lint`
      Co-authored-by: 's avatarchaseadamsio <103162876+chaseadamsio@users.noreply.github.com>
      b7c2bd10
    • Kasper Aamodt's avatar
      Convert with-goober example to TS (#39761) · bc4d98af
      Kasper Aamodt authored
      ## Documentation / Examples
      
      - [x] Make sure the linting passes by running `pnpm lint`
      - [x] The examples guidelines are followed from [our contributing doc]
      Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
      bc4d98af
    • Henrik Wenz's avatar
      [Docs] Update mongodb example (#39658) · 74fb7ba0
      Henrik Wenz authored
      
      
      ## Changelog
      
      - Updated deps
      - Migrated to typescript
      
      ## Documentation / Examples
      
      - [x] Make sure the linting passes by running `pnpm lint`
      - [x] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples)
      74fb7ba0
    • greeble's avatar
      Update next.js.configs line number (#39802) · 1ebd6a1d
      greeble authored
      1ebd6a1d
    • Gal Schlezinger's avatar
      allow Edge Functions to stream a compressed `fetch` response (#39608) · 41d4aa04
      Gal Schlezinger authored
      When a user tried to have the following Edge Function:
      
      ```ts
      export default () => fetch("https://example.vercel.sh");
      ```
      
      The Edge Function were failing.
      
      Why is that?
      
      When `fetch` was called, an implicit `Accept-Encoding` header was added
      to allow the origin to return a compressed response. Then, the origin
      will set the `Content-Encoding` header in the response, to let the
      client know that the body needs to be decompressed in order to be read.
      
      That creates an issue though: `response.body` will be a
      `ReadableStream<Uint8Array>`, or, a stream that contains binary data
      that decodes into _the uncompressed data_ (or, plain text!).
      
      What it means, is that `response.body` is uncompressed data, while
      `response.headers.get('content-encoding')` is marking the response body
      as compressed payload. This confuses the HTTP clients and makes them fail.
      
      This commit removes the `content-encoding`, `transfer-encoding` and
      `content-length` headers from the response, as the Next.js server _always_
      streams Edge Function responses.
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [x] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      41d4aa04
    • Sukka's avatar
      refactor(use-intersection): remove useRef usage (#39791) · bf82a473
      Sukka authored
      The PR neither fixes a bug nor introduces a new feature. It just makes the current code be more clearer.
      
      We track the `unobserve` method (to clear the side-effect) in a ref before this PR which is not required anymore:
      
      - The `unobserve` method can only be created during the `useEffect`
      - The `unobserve` method will be called during `useEffect` cleans up.
      
      In short, the "life cycle" of the `unobserve` method now only lives inside the `useEffect`. So we can remove the usage of `useRef`.
      bf82a473
    • Sukka's avatar
      refactor(portal): remove useRef from portal component (#39792) · 05b621aa
      Sukka authored
      The PR is similar to #39791.
      
      Currently, `<Portal />` saves the container in a ref (with initial value as `null`). The update of the ref happens during the `useEffect`, after creating the corresponding HTMLElement. However, `<Portal />` has to use `forceUpdate` since mutating a ref will not cause the component to update.
      The PR fixes that by saving the container of the `Portal` in a state, so no more `forceUpdate`.
      05b621aa
  4. 20 Aug, 2022 4 commits
  5. 19 Aug, 2022 1 commit
    • Alex Cole's avatar
      Tweak Convex example (#39739) · aacc0ce9
      Alex Cole authored
      This is a followup to #39562 because I realized I made a few mistakes.
      
      Remove convex.json file. Developers using the example should generate this on their own by running npx convex init.
      Switch prettier to a dev dependency.
      Ignore formatting in Convex generated code while running lint-staged and revert them back to the default generated form (I previously was only ignoring generated code in the main .prettierignore)
      Change a let to a const
      
      cc @thomasballinger
      Documentation / Examples
      
       Make sure the linting passes by running pnpm lint
       The examples guidelines are followed from our contributing doc
      aacc0ce9
  6. 18 Aug, 2022 5 commits
    • Sukka's avatar
      fix(#39706): add avif support for node serve static (#39733) · 3466862d
      Sukka authored
      
      
      The PR fixes #39706 by adding `avif` mime type directly to `send`. The PR also removes the previous avif workaround for image optimizer.
      
      Note: The PR is still a workaround for now. I will submit a PR to `pillarjs/send` to help them update `mime` to fix the issue once and for all. But now `send.mime.define` just works.
      
      ## Bug
      
      - [x] Related issues linked using `fixes #number`
      - [x] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      3466862d
    • JJ Kasper's avatar
      Use realpath when emitting traced package.json (#39683) · f7eed079
      JJ Kasper authored
      This ensures we emit the real path when emitting traced package.json files so that we don't conflict with symlinked package paths.
      x-ref: slack thread
      Bug
      
       Related issues linked using fixes #number
       Integration tests added
       Errors have helpful link attached, see contributing.md
      f7eed079
    • Delba de Oliveira's avatar
    • Sukka's avatar
      fix(#39609): warns about suspense and ssr (#39676) · 53604404
      Sukka authored
      Currently, `next/dynamic` will opt-in to `React.lazy` if `{ suspense: true }` is used. And React 18 will always resolve the `Suspense` boundary on the server-side, effectively ignoring the `ssr` option.
      
      The PR fixes #39609 by showing a warning message when `{ suspense: true, ssr: false }` is detected. The error documentation and the corresponding test case has also been updated.
      
      In the future, Next.js could implement a custom version of `React.lazy` that could suspense without executing the lazy-loaded component on the server-side.
      
      cc @huozhi 
      
      ## Bug
      
      - [x] Related issues linked using `fixes #number`
      - [x] Integration tests added
      - [x] Errors have helpful link attached, see `contributing.md`
      53604404
    • magic-akari's avatar
      fix(swc/emotion): Correct the `SPACE_AROUND_COLON` regex (#39710) · 78aefee1
      magic-akari authored
      
      
      ## Bug
      
      - [x] fixes #39672 
      - [x] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      78aefee1