1. 12 May, 2022 8 commits
    • JJ Kasper's avatar
      v12.1.7-canary.5 · 1ccf368f
      JJ Kasper authored
      1ccf368f
    • Jiachi Liu's avatar
      Enable html post optimization for react 18 (#36837) · adb56ef2
      Jiachi Liu authored
      Follow up for #35888 to re-enable more test, and re-enable post processors after #36792 has better support for document.gIP with react 18. Apply post-pocessing when the the shell chunk is fully buffered.
      
      re-enabled integration tests for react 18:
      - amphtml
      - amphtml-custom-optimizer
      - app-document
      - font-optimization
      
      Fixes #35835
      
      
      ## Bug
      
      - [x] Related issues linked using `fixes #number`
      - [x] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      adb56ef2
    • Jiachi Liu's avatar
      docs: add more details about nextRuntime in webpack config and runtime in next config (#36862) · b717b6eb
      Jiachi Liu authored
      ## Documentation / Examples
      
      - [x] Make sure the linting passes by running `yarn lint`
      b717b6eb
    • JJ Kasper's avatar
      Add experimental config for basePath testing (#36843) · 03d00e28
      JJ Kasper authored
      This adds an experimental config for testing `basePath` handling on the client. 
      
      x-ref: [slack thread](https://vercel.slack.com/archives/CLDDX2Y0G/p1652221605742559)
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [ ] Related issues linked using `fixes #number`
      - [ ] 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`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `yarn lint`
      03d00e28
    • Robert Keyser's avatar
      scss exects semicolon (#36779) · 66d98e2f
      Robert Keyser authored
      copy/pasting the SCSS example into VSCode results in linter warning. Fixed with semicolon on variable assignment. Added the second semicolon for consistency.
      
      
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `yarn lint`
      Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
      66d98e2f
    • Balázs Orbán's avatar
      chore: upgrade dependencies in Jest examples (#36858) · b596ce9d
      Balázs Orbán authored
      Ref: https://github.com/vercel/next.js/issues/36842, https://github.com/vercel/next.js/pull/36632, https://github.com/vercel/next.js/pull/36787
      
      Upgrading to Jest 28, and aligning Babel example with `with-jest`
      
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [ ] Related issues linked using `fixes #number`
      - [ ] 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`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `yarn lint`
      b596ce9d
    • Rich Haines's avatar
      Updated copy around enabling source maps (#36852) · 6a00a1b4
      Rich Haines authored
      This PR updates the copy in the source maps section of the docs to reflect the improvement made to webpack that generate source maps.
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [ ] Related issues linked using `fixes #number`
      - [ ] 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`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `yarn lint`
      6a00a1b4
    • JJ Kasper's avatar
      Eagerly load swc bindings for wasm fallback for jest (#36784) · 8e401aec
      JJ Kasper authored
      Follow-up to https://github.com/vercel/next.js/pull/36612 this updates to eagerly load the swc bindings unless babel is being used so that we don't wait for the transform calls to initialize swc. Eagerly loading in jest also allows us to fallback to the wasm bindings when previously we couldn't since they needed to wait for the import.  
      8e401aec
  2. 11 May, 2022 7 commits
  3. 10 May, 2022 7 commits
    • JJ Kasper's avatar
      Update moduleNameMapper jest config and remove extra deps (#36787) · e05a95a8
      JJ Kasper authored
      * Update moduleNameMapper jest config and remove extra deps
      
      * move svg mock to its own entry for easier overriding
      
      * remove package script
      e05a95a8
    • Shu Ding's avatar
      Move FlightManifestPlugin to server compilers (#36810) · fdc071c5
      Shu Ding authored
      * move FlightManifestPlugin to server compilers
      
      * revert loader condition
      
      * fix module id
      
      * fix test and refactor
      Co-authored-by: 's avatarkodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
      fdc071c5
    • James Perkins's avatar
      Fixing Tina + Adding a demo URL (#35480) · 22c0b65e
      James Perkins authored
      ## Documentation / Examples
      
      - Updating Tina Demo URL
      - Adding Tina to blog-starter example
      - Adding Tina to Basic features section
      - Updating Tina to actually work again
      22c0b65e
    • Remco Haszing's avatar
      Add final newline to package-lock.json (#36813) · 8f9296c0
      Remco Haszing authored
      This aligns the output with what npm outputs. Without this change,
      Next.js causes unwanted changes in package-lock.json.
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [ ] Related issues linked using `fixes #number`
      - [ ] 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`
      
      ## Documentation / Examples
      
      - [x] Make sure the linting passes by running `yarn lint`
      8f9296c0
    • JJ Kasper's avatar
      Update root component handling (#36781) · 482fe25c
      JJ Kasper authored
      482fe25c
    • Marzouq's avatar
      added example: with-geist-ui (#36525) · 342331e6
      Marzouq authored
      
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [ ] Related issues linked using `fixes #number`
      - [ ] 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`
      
      ## Documentation / Examples
      
      - [x] Make sure the linting passes by running `yarn lint`
      342331e6
    • Erik Brinkman's avatar
      Add experimental flag to force SWC transforms (#36789) · c7b2083f
      Erik Brinkman authored
      fixes #36763
      fixes #36590
      
      ## Feature
      
      - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
         - It hasn't been accepted for implementation, although that process isn't clear, and this is a pretty trivial fix.
      - [x] Related issues linked using `fixes #number`
      - [x] Integration tests added
      - [x] Documentation added
      - [ ] Telemetry added. In case of a feature if it's used or not.
         - This is somewhat inherent in the error log
      - [x] Errors have helpful link attached, see `contributing.md`
      
      ## Documentation / Examples
      
      - [x] Make sure the linting passes by running `yarn lint`
      c7b2083f
  4. 09 May, 2022 4 commits
    • JJ Kasper's avatar
      7d52589b
    • Tim Neutkens's avatar
      db8f161d
    • Balázs Orbán's avatar
      enforce omitting `name` and `version` (#36771) · 6aa9ef19
      Balázs Orbán authored
      We have tests running on the examples repository that will fail if `name` or `version` is found in the `package.json`. We should make it more clear in the documentation to omit these fields.
      
      @ijjk
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [ ] Related issues linked using `fixes #number`
      - [ ] 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`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `yarn lint`
      6aa9ef19
    • Kiko Beats's avatar
      feat: better cookies API for Edge Functions (#36478) · b78c28f7
      Kiko Beats authored
      This PR introduces a more predictable API to manipulate cookies in an Edge Function context.
      
      ```js
      const response = new NextResponse()
      
      // set a cookie
      response.cookies.set('foo, 'bar') // => set-cookie: 'foo=bar; Path=/'`
      
      // set another cookie
      response.cookies.set('fooz, 'barz') // => set-cookie: 'foo=bar; Path=/, fooz=barz; Path=/'`
      
      // delete a cookie means mark it as expired
      response.cookies.delete('foo') // => set-cookie: 'foo=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT, fooz=barz; Path=/'`
      
      // clear all cookies means mark all of them as expired
      response.cookies.clear() // => set-cookie: 'fooz=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT, foo=; Path=/; Expires=Thu, 01 Jan 1970 00:00:00 GMT'`
      ``` 
      
      This new cookies API uses [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) interface, and it's available for `NextRequest` and `NextResponse`.
      
      Additionally, you can pass a specific cookies option as a third argument in `set` method:
      
      ```js
      response.cookies.set('foo', 'bar', {
        path: '/',
        maxAge: 60 * 60 * 24 * 7,
        httpOnly: true,
        sameSite: 'strict',
        domain: 'example.com'
      }
      ```
      
      **Note**: `maxAge` it's in seconds rather than milliseconds.
      
      Any cookie manipulation will be reflected over the `set-cookie` header, transparently.
      
      closes #31719
      b78c28f7
  5. 08 May, 2022 2 commits
    • Tim Neutkens's avatar
      Add flight render starting point (#36760) · 40e98911
      Tim Neutkens authored
      
      
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [ ] Related issues linked using `fixes #number`
      - [ ] 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`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `yarn lint`
      40e98911
    • Sukka's avatar
      replace use-subscription with use-sync-external-store (#36733) · 26459ef0
      Sukka authored
      - [x] Make sure the linting passes by running `yarn lint`
      
      Back in 2019, React released the first version of `use-subscription` (https://github.com/facebook/react/pull/15022). At the time, we only has limited information about concurrent rendering, and #9026 add the initial concurrent mode support.
      
      In 2020, React provides a first-party official API `useMutableSource` (https://github.com/reactjs/rfcs/pull/147, https://github.com/facebook/react/pull/18000):
      
      > ... enables React components to safely and efficiently read from a mutable external source in Concurrent Mode.
      
      React 18 introduces `useMutableSource`'s replacement `useSyncExternalStore` (see details here: https://github.com/reactwg/react-18/discussions/86), and React changes `use-subscription` implementation to use `useSyncExternalStore` directly: https://github.com/facebook/react/pull/24289
      
      > In React 18, `React.useSyncExternalStore` is a built-in replacement for `useSubscription`.
      > 
      > This PR makes `useSubscription` simply use `React.useSyncExternalStore` when available. For pre-18, it uses a `use-sync-external-store` shim which is very similar in `use-subscription` but fixes some flaws with concurrent rendering.
      
      And according to `use-subscription`:
      
      > You may now migrate to [`use-sync-external-store`](https://www.npmjs.com/package/use-sync-external-store) directly instead, which has the same API as `React.useSyncExternalStore`. The `use-subscription` package is now a thin wrapper over `use-sync-external-store` and will not be updated further.
      
      The PR does exactly that:
      
      - Removes the precompiled `use-subscription` introduced in #35746
      - Adds the `use-sync-external-store` to the dependencies.
        - The `use-sync-external-store` package enables compatibility with React 16 and React 17.
        - Do not pre-compile `use-sync-external-store` since it is also the dependency of some popular React state management libraries like `react-redux`, `zustand`, `valtio`, `@xstate/react` and `@apollo/client`, etc. By install
      - Replace `useSubscription` usage with `useSyncExternalStore` 
      
      ---
      
      Ref: #9026, #35746 and #36159
      Co-authored-by: 's avatarJiachi Liu <4800338+huozhi@users.noreply.github.com>
      26459ef0
  6. 07 May, 2022 4 commits
    • Steven Tey's avatar
      Fixed typo (#36753) · 3fd11685
      Steven Tey authored
      
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [ ] Related issues linked using `fixes #number`
      - [ ] 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`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `yarn lint`
      3fd11685
    • Jiachi Liu's avatar
      Use react dom server node api to detect react root is enabled (#36749) · a84672e6
      Jiachi Liu authored
      x-ref: https://github.com/vercel/next.js/pull/36552#issuecomment-1120128946
      x-ref: https://github.com/preactjs/next-plugin-preact/pull/59
      
      `preact/compat` doesn't have `/server.browser` exports, to make it work with latest of next.js: 
      
      * use `react-dom/server` to detect if it could opt-in streaming rendering by checking react 18 `renderToPipeableStream` API in short time fix. In long term `preact/compat`should support `/server.browser` that same with react 17.
      * Also filed a PR to `next-plugin-preact` to skip chunk-prepending to pages in edge compiler
      a84672e6
    • Tim Neutkens's avatar
      Leverage pageExtensions for resolving in loader (#36747) · 51d962d6
      Tim Neutkens authored
      
      
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [ ] Related issues linked using `fixes #number`
      - [ ] 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`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `yarn lint`
      51d962d6
    • Rich Haines's avatar
      Updated the middleware api docs env section to remove dev and prod (#36739) · 49910ea9
      Rich Haines authored
      …rding due to customer confusion
      
      This PR updates the middleware (edge functions) api docs environment section to remove the dev and prod wording due to customer confusion
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [ ] Related issues linked using `fixes #number`
      - [ ] 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`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `yarn lint`
      49910ea9
  7. 06 May, 2022 2 commits
  8. 05 May, 2022 6 commits