1. 24 Aug, 2022 1 commit
  2. 23 Aug, 2022 12 commits
  3. 22 Aug, 2022 19 commits
  4. 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
  5. 20 Aug, 2022 1 commit