1. 09 Nov, 2021 9 commits
    • Tim Neutkens's avatar
      v12.0.4-canary.2 · bcf25289
      Tim Neutkens authored
      bcf25289
    • Tim Neutkens's avatar
      Add webpack5 types to right files · 1941eedd
      Tim Neutkens authored
      1941eedd
    • Tim Neutkens's avatar
      14aac085
    • Spencer Elliott's avatar
    • Shu Ding's avatar
      Add integration test for Suspense and streaming (#31197) · 57b4134c
      Shu Ding authored
      Adds a test to ensure that `<Suspense>` and streaming are working properly with `concurrentFeatures` enabled.
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [x] 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`
      57b4134c
    • Tim Neutkens's avatar
      v12.0.4-canary.1 · a0a08ae9
      Tim Neutkens authored
      a0a08ae9
    • Donny/강동윤's avatar
      next-swc: Add `displayNameAndId` of `styled-components` (#31189) · 54ca8f41
      Donny/강동윤 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`
      
      
      
      
      Related to: https://github.com/vercel/next.js/issues/30802
      54ca8f41
    • Javi Velasco's avatar
      Fix middleware i18n rewrites (#31174) · 5fc4325a
      Javi Velasco authored
      Fixes #30897
      
      This PR fixes the linked issue where rewrites are not being applied for locale. It adds the corresponding test but also, as it was added in debugging process, it introduces a helper to read/write into the `request` object.
      
      We are currently writing directly into the request by casting to `any` and then using flags like `_nextRewrote`. Instead, this PR puts all of this metadata under a symbol so it is not directly accessible. This also allows to have a single place where all of this metadata is listed so we can add comments describing the purpose of each flag.
      
      In the same way, there is metadata written in the querystring. This is adding some types for it in order to throw some visibility on where is this metadata accessed. In an upcoming PR we can move all of it to the `request` object if possible to simplify the system.
      
      ## Bug
      
      - [x] Related issues linked using `fixes #number`
      - [x] Integration tests added
      - [x] Errors have helpful link attached, see `contributing.md`
      5fc4325a
    • Shu Ding's avatar
      Do not hide body when concurrentFeatures is enabled (#31187) · 91a6e3af
      Shu Ding authored
      When Fizz is enabled, we want to always show the content of body even before it's loaded. Please hide whitespace changes when reviewing this PR.
      
      ## 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`
      91a6e3af
  2. 08 Nov, 2021 18 commits
  3. 07 Nov, 2021 2 commits
    • Jiachi Liu's avatar
      Change .web extension of document page to part of path (#31116) · cfb8cc84
      Jiachi Liu authored
      Fixes: #31104
      
      This effecting users who are using expo with next (`@expo/next-adapter`) since react-native use `.web`, `.ios` and `.android` to identify platform. [Reference](https://docs.expo.dev/guides/using-electron/#%F0%9F%A7%B8-behavior)
      
      Change `document.web.js` to `document-web.js` as fallback page in web runtime
      cfb8cc84
    • Gerald Monaco's avatar
      Add render prop support to `<Main>` (#30156) · ad981783
      Gerald Monaco authored
      Adds support for render props to the `<Main>` component, when using the [functional custom `Document`](https://github.com/vercel/next.js/pull/28515) style. This allows you to write something like this:
      
      ```tsx
      export default function Document() {
        const jsxStyleRegistry = createStyleRegistry()
        return (
          <Html>
            <Head />
            <body>
              <Main>
                {content => (
                  <StyledJsxWrapper registry={jsxStyleRegistry}>
                    {content}
                  </StyledJsxWrapper>
                )}
              </Main>
              <NextScript />
            </body>
          </Html>
        )
      }
      ```
      
      In functional document components, this allows the `<App>` to be wrapped, similar to `enhanceApp` (which is only available via `getInitialProps`, which is not supported by functional document components). The primary use for this is for integrating with 3rd party CSS-in-JS libraries, allowing them to attach an `useFlush` handler to [support React 18](https://github.com/reactwg/react-18/discussions/110):
      
      ```tsx
      import { unstable_useFlush as useFlush } from 'next/document'
      
      export default function StyledJsxWrapper({ children, registry }) {
        useFlush(() => {
          /* ... */
        })
        return (
          <StyleRegistry registry={registry}>
            {children}
          </StyleRegistry>
        )
      }
      ```
      
      Support for `useFlush` will be added in a follow up PR.
      ad981783
  4. 06 Nov, 2021 6 commits
    • Tim Neutkens's avatar
      Change disabled SWC message to Log.info (#31091) · f8e66610
      Tim Neutkens authored
      Based on feedback from @flybayer, this changes the `warn - ` to `info -` for the "Disabled SWC" message.
      
      
      
      ## 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`
      f8e66610
    • Shu Ding's avatar
      Upgrade React alpha and experimental dependencies to latest (#31039) · 5e185fc5
      Shu Ding authored
      Ensuring that our tests are not broken with latest React changes.
      
      ## 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`
      5e185fc5
    • Jiachi Liu's avatar
      Fix custom 404 page when concurrentFeatures is enabled (#31059) · e029ace5
      Jiachi Liu authored
      x-ref: https://github.com/vercel/next.js/issues/30424#issuecomment-955615781
      
      This fix the custom 404 is not rendering properly and can’t be built in web runtime when `concurrentFeatures` is enabled. We force 404 page to be rendered outside of middleware ssr. Then it could be the real fallback 404 page in next-server when any routes is not macthed. 
      Will check 500 related after #31057 is landed.
      
      ## Bug
      
      - [x] Related to #30989
      - [x] Integration tests added
      
      
      e029ace5
    • chemicalkosek's avatar
      Update remark and remark-html dependencies (#31051) · 9e339fdd
      chemicalkosek authored
      That example errors out on 
      ```
      TypeError: (0 , remark__WEBPACK_IMPORTED_MODULE_0__.remark) is not a function
      ```
      Updating those dependencies fixes the problem.
      
      
      
      ## 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`
      9e339fdd
    • Rishabh Poddar's avatar
      Optimise bundle size for with-supertokens example (#31040) · 155aaa31
      Rishabh Poddar authored
      This PR optimises the bundle size sent to the frontend for nextJS apps by lazy loading the SuperTokens backend SDK only when it's needed.
      155aaa31
    • Shu Ding's avatar
  5. 05 Nov, 2021 5 commits
    • JJ Kasper's avatar
      Ensure decode error in minimal mode responds with 400 not 500 (#31037) · fab345d9
      JJ Kasper authored
      This ensures we handle decode failures in minimal mode as a 400 response (bad request) instead of a 500 (server error). 
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [x] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      fab345d9
    • Shu Ding's avatar
      Improve error handling in the SSR middleware (#31057) · b75b2f02
      Shu Ding authored
      This PR improves error handling in the SSR middleware. Previously the response was sent out synchronously, and and errors were silently swallowed. There was no `.catch` for `renderToHTML`. This changes the middleware to be asynchronous, which waits until the initial Document to be rendered correctly and then starts the streaming. 
      
      With this change we can also send correct status code when there're immediate errors before Fizz.
      
      ## 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`
      b75b2f02
    • Shu Ding's avatar
      Optimize the SSR middleware runtime size (#30906) · 0307ba0d
      Shu Ding authored
      By conditionally importing `react-dom/server` under the web runtime and reusing `renderToReadableStream` instead of `renderToStaticMarkup`, we can get rid of the legacy browser React DOM server from the runtime. ~Furthermore we can make the build target `es6` for the SSR middleware, and make some code paths tree-shakable (done in another PR).~
      
      Together this makes the runtime ~32kb smaller.
      
      ## 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`
      0307ba0d
    • Javi Velasco's avatar
      Update middleware eval checks (#30883) · 6e081e17
      Javi Velasco authored
      Co-authored-by: 's avatarTobias Koppers <sokra@users.noreply.github.com>
      
      With this PR we are updating the way we check the usage of `eval` and other dynamic code evaluation (like `new Function`) for middleware. Now instead of simply showing a warning it will behave differently depending on if we are building or in development.
      
      - Development: we replace the dynamic code with a wrapper so that we print a warning only when the code is used. We don't fail in this scenario as it is possible that once the application is built the code that uses `eval` is left out.
      - Build: we detect with tree shaking if the code that will be bundled into the middleware includes any dynamic code and in such scenario we make the build fail as don't want to allow it for the production environment.
      
      Closes #30674
      
      ## 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`
      6e081e17
    • Tim Neutkens's avatar
      v12.0.3 · e2506411
      Tim Neutkens authored
      e2506411