1. 11 Oct, 2022 19 commits
  2. 10 Oct, 2022 6 commits
  3. 09 Oct, 2022 2 commits
    • Shu Ding's avatar
      Load `beforeInteractive` scripts properly without blocking hydration (#41164) · e933e1d2
      Shu Ding authored
      This PR ensures that for the app directory, `beforeInteractive`, `afterInteractive` and `lazyOnload` scripts via `next/script` are properly supported.
      
      For both `beforeInteractive` and `afterInteractive` scripts, a preload link tag needs to be injected by Float. For `beforeInteractive` scripts and Next.js' polyfills, they need to be manually executed in order before starting the Next.js' runtime, without blocking the downloading of HTML and other scripts.
      
      This PR doesn't include the `worker` type of scripts yet.
      
      Note: in this PR I changed the inlined flight data `__next_s` to `__next_f`, and use `__next_s` for scripts data, because I can't find a better name for `next/script` that is also short at the same time.
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have a 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`
      - [x] Integration tests added
      - [ ] Documentation added
      - [ ] Telemetry added. In case of a feature if it's used or not.
      - [ ] Errors have a helpful link attached, see `contributing.md`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `pnpm lint`
      - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
      e933e1d2
    • Tim Neutkens's avatar
  4. 08 Oct, 2022 2 commits
    • Tim Neutkens's avatar
      Handle `as` on next/link with new router (#41285) · f7a7c3fa
      Tim Neutkens authored
      Kudos @dferber90 who found this issue. Added a test and handled it gracefully for now. Keep in mind the behavior can't be 1-1 so it takes the `as` as the `href` value given that masking of parameters in this way is no longer supported, that will be superseded by parallel routes / route interception.
      
      
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have a 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 a helpful link attached, see `contributing.md`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `pnpm lint`
      - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
      f7a7c3fa
    • Tim Neutkens's avatar
      v12.3.2-canary.23 · 52a69e61
      Tim Neutkens authored
      52a69e61
  5. 07 Oct, 2022 8 commits
    • Hannes Bornö's avatar
      Recover from font loader error in dev (#41251) · be7b10de
      Hannes Bornö authored
      Check that the module has assets. This might not always be the case in
      app dev if there was an error. Test added to make sure it recovers
      correctly.
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have a 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 a helpful link attached, see `contributing.md`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `pnpm lint`
      - [ ] The "examples guidelines" are followed from [our contributing
      doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      be7b10de
    • Balázs Orbán's avatar
      fix(ts): relax `AppProps` to not require generic (#41264) · 6eefc9de
      Balázs Orbán authored
      It seems that #38867 made `AppProps` always require the `pageProps`
      object shape to be passed as a generic since the default `{}` will throw
      a TS error if you try accessing any property:
      
      Before:
      
      ![image](https://user-images.githubusercontent.com/18369201/194639573-aa8a97f8-2c6a-413c-96f2-5e99e4a17c66.png)
      
      After:
      
      ![image](https://user-images.githubusercontent.com/18369201/194639630-03d1a669-722f-4822-b0db-3b8dd88b2959.png)
      
      
      Technically, it would be more correct since accessing `pageProps`
      properties would otherwise be unsafe, but this seems to break the
      current behavior.
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have a 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 a helpful link attached, see `contributing.md`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `pnpm lint`
      - [ ] The "examples guidelines" are followed from [our contributing
      doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
      6eefc9de
    • Jackromo34's avatar
      chore(examples): upgrade `date-fns` in `cms-tina` (#41240) · 6b27fbb4
      Jackromo34 authored
      <!--
      Thanks for opening a PR! Your contribution is much appreciated.
      To make sure your PR is handled as smoothly as possible we request that
      you follow the checklist sections below.
      Choose the right checklist for the change that you're making:
      -->
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have a 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 a helpful link attached, see `contributing.md`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `pnpm lint`
      - [ ] The "examples guidelines" are followed from [our contributing
      doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
      Co-authored-by: 's avatarsnyk-bot <snyk-bot@snyk.io>
      Co-authored-by: 's avatarBalázs Orbán <info@balazsorban.com>
      6b27fbb4
    • Tim Neutkens's avatar
      eb629c15
    • Damien Simonin Feugas's avatar
      fix(middleware): 'instanceof Function' is dynamic code false-positive (#41249) · bef709bc
      Damien Simonin Feugas authored
      
      
      ## 🐛 What's in there?
      
      `foo instanceof Function` is wrongly considered as Dynamic code evaluation by our static analyzer.
      This PR fixes it.
      
      - [ ] Related issues linked using `fixes #number`
      - [x] Integration tests added
      - [x] Errors have a helpful link attached, see `contributing.md`
      
      ## 🧪 How to reproduce?
      
      1. Create a simple repro in `examples` folder:
         ```js
         // examples/instance-of-function/pages/index.js
         export default function Home() {
           return <h1>home</h1>
         }
         
         // examples/instance-of-function/middleware.js
         import { NextResponse } from 'next/server'
         
         export default async function handler() {
           console.log('is arrow a function?', (() => {}) instanceof Function)
           return NextResponse.next()
         }
         ```
      1. build with next `pnpm next build examples/instance-of-function`
         > the build fails
      1. rebuild next to include PR's fix `pnpm build`
      1. build with new next `pnpm next build examples/instance-of-function`
         > the build works
      
      ## 📔 Notes to reviewers
      
      `hooks.expression.for(`${prefix}Function`).tap(NAME, handleExpression)` is actually legacy code from the original implementation. It's used when finding `Function` regardless of how it is used. We only want to find `new Function()` or `Function()`, which `hooks.calls` and `hooks.new` are covering.
      
      `eval instanceof Function` is perfectly legit code on the edge, despite its uselessness :lol-think: 
      
      Because we got multiple people asking "how do I relax this error when my code contains unreachable dynamic code evaluation", I've copy-pasted details about `config.unstable_allowDynamic` into the error page. Because users do not always click links :blob_shrug: 
      bef709bc
    • Jiachi Liu's avatar
      refactor dev overlay into hot reloader (#41231) · a415f34a
      Jiachi Liu authored
      Move react-dev-overlay into hot reloader client components, and let it imported by app router. So then we don't need to have hot reloader and react tree as adjacent sibilings but the overlay with error boundary is wrapping the react tree
      Co-authored-by: 's avatarTim Neutkens <6324199+timneutkens@users.noreply.github.com>
      a415f34a
    • Tim Neutkens's avatar
      Enable passing tests (#41241) · ce820e2a
      Tim Neutkens authored
      ce820e2a
    • Hannes Bornö's avatar
      Font loaders next config shape (#41219) · b5590022
      Hannes Bornö authored
      Changes how font loaders are configured in next config, makes more sense since options can be optional. Also adds error for when font loaders are used from within node_modules.
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have a 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 a helpful link attached, see `contributing.md`
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `pnpm lint`
      - [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
      b5590022
  6. 06 Oct, 2022 3 commits