1. 09 Feb, 2022 9 commits
  2. 08 Feb, 2022 17 commits
  3. 07 Feb, 2022 9 commits
    • Gerald Monaco's avatar
      Stop exposing internal `render` and `renderError` methods from `next/client` (#34069) · c0dc008f
      Gerald Monaco authored
      These should no longer need to be exposed.
      c0dc008f
    • Gerald Monaco's avatar
      Make `Router` state immutable (#33925) · 81b537c0
      Gerald Monaco authored
      Make the external `Router` state immutable, and make it so there's only one place (`set`) where it is changed and announced. This is to prepare for #33919, which ensures that we only create a new router once per tree.
      81b537c0
    • Tim Neutkens's avatar
      Change SWC minify from beta to release candidate (#34056) · 3be21c4f
      Tim Neutkens authored
      Given we've spent a ton of time testing and fixing minifier bugs the majority of cases should now be covered.
      
      
      
      ## 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`
      3be21c4f
    • 11koukou's avatar
      Fix `lazyRoot` functionality for `next/image` (#33933) · d4b29db8
      11koukou authored
      Fixed lazyRoot functionality (#33290). Changed the unique id for Intersection Observers discrimination since previously they were only identified by the different rootMargins, now each being identified by the rootMargin and the root element as well
      Added more Images to the test with different margins and with/without lazyRoot prop. Browser correctly initially loading two of the four Images according to the props' specifications.
      Co-authored-by: 's avatarSteven <steven@ceriously.com>
      d4b29db8
    • Balázs Orbán's avatar
      chore: do not run lock/stale actions on forks (#34053) · 1ac0fc43
      Balázs Orbán authored
      The lock and stale actions will always fail on fork repos since they are using secrets that are not shared with the fork workflow runs.
      
      This PR addresses that by limiting the lock and stale actions to bail out on fork repo workflow runs.
      
      ## 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`
      1ac0fc43
    • Tim Neutkens's avatar
      Add support for async fn / promise in next.config.js/.mjs (#33662) · c74e4f21
      Tim Neutkens authored
      - Add support for async function / promise export in next.config.js/.mjs
      - Update docs
      
      Adds support for https://twitter.com/timneutkens/status/1486075973204422665
      
      But also the simpler version:
      
      ```js
      module.exports = async () => {
        return {
          basePath: '/docs'
        }
      }
      ```
      
      
      
      ## Bug
      
      - [ ] Related issues linked using `fixes #number`
      - [ ] Integration tests added
      - [ ] Errors have helpful link attached, see `contributing.md`
      
      ## Feature
      
      - [x] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR.
      - [x] Related issues linked using `fixes #number`
      - [x] Integration tests added
      - [x] Documentation added
      
      ## Documentation / Examples
      
      - [ ] Make sure the linting passes by running `yarn lint`
      c74e4f21
    • JJ Kasper's avatar
      v12.0.11-canary.7 · 938eb0e2
      JJ Kasper authored
      938eb0e2
    • Wouter Raateland's avatar
      Allow scroll prevention on hash change (#31921) · b49717f8
      Wouter Raateland authored
      * Allow scroll prevention on hash change
      
      Currently, `scrollToHash` is performed on every hash change, even when this change is caused by `<Link scroll={false} {...props} />`.
      This change prevents scrolling in this case and allows users to specify the desired scrolling behavior in the router's `hashChangeComplete` event.
      
      * Add test case and apply fixes
      Co-authored-by: 's avatarJJ Kasper <jj@jjsweb.site>
      b49717f8
    • Adam Pietrasiak's avatar
      Require component rendered as child of `Link` to pass event to `onClick` handler (#27723) · 41706d6f
      Adam Pietrasiak authored
      
      
      Currently, if you render `next/link` like
      
      ```ts
      <Link>
        <CustomComponent />
      </Link>
      ```
      
      and have 
      
      ```tsx
      interface Props {
        onClick?: () => void; // <— note we're not passing event as an argument
      }
      
      function CustomComponent({ onClick }: Props) {
        return <div onClick={() => onClick?.()}>Hello</div>
      }
      ```
      
      It'll result in error
      
      ```
      link.js?f421:21 Uncaught TypeError: Cannot read property 'defaultPrevented' of undefined
      ```
      
      <!--
      Thanks for opening a PR! Your contribution is much appreciated.
      In order 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 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
      Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
      41706d6f
  4. 06 Feb, 2022 5 commits
    • Glenn Gijsberts's avatar
      Make adjustment to cache config of with-apollo example (#32733) · 91146b23
      Glenn Gijsberts authored
      ## Description
      This year we implemented the new Apollo config using this example. We recently moved to `getServerSideProps` as well, however, this was giving us some cache problems. The issue was that the cache was older than the actual data that was coming from the server side query. 
      
      Because the `merge` of the cache in `apolloClient.js` is merging the existingCache in the initialState it will overwrite the "fresh" initialState with properties that already exists. This means that if you have something in your cache from previous client render, for example `user` with the value `null`, and you go to a new page and do a new query on the server which returns a value for the `user` field, it will still return `null` because of that `merge` function.
      
      Since this was weird in our opinion, we've changed this in our own environment by always overwriting the existing cache with the new initialState, so that the initialState that is coming from a fresh server side query is overwriting. We thought it was a good idea to reflect this also in this example, because we couldn't think of a reason why the existing cache should overwrite fresh queries.
      
      I've added a reproduction that shows what this is exactly about. I hope my description makes sense, let me know what you think!
      
      ## Reproduction of old scenario
      Created a reproduction branch here: https://github.com/glenngijsberts/with-apollo-example. Using a different API than in the example, because of https://github.com/vercel/next.js/issues/32731.
      
      1. checkout the example
      2. yarn
      3. yarn dev
      4. visit http://localhost:3000/client-only
      5. Hit "Update name". This will run a mutation that will update the cache automatically. Because I use a mocked API, the actual value on the API won't be updated, but this is actually the perfect scenario for the problem because in reality data can already change in the meantime when you're doing a new request.
      6. Go to the SSR page
      7. This will display two values: one is coming from the server side request (which is the latest data, because no cache is used in `getServerSideProps`) and the other is using the cache, which is outdated at that point, yet it's still returned because the old way of merging the cache was picking the existing cache over the initialState that was coming from the fresh server side query.
      
      ## Documentation / Examples
      
      - [x] Make sure the linting passes by running `yarn lint`
      91146b23
    • Neeraj Rajpurohit's avatar
      Fixes #31240: Adding a recursive addPackagePath function in webpack-config (#31264) · 6d0bd20f
      Neeraj Rajpurohit authored
      
      
      Fixes: https://github.com/vercel/next.js/issues/31240
      Closes: https://github.com/vercel/next.js/pull/32324
      Adding a try-catch block to handle situations when packages are found at relative path in getPackagePath function. This is likely to occur when using `preact` instead of `react-dom`, as `scheduler` package will not be found wrt `react-dom`
      
      ## Bug
      
      - [x] Related issues linked using `fixes #31240`
      Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
      6d0bd20f
    • Jess Telford's avatar
      [docs] Add env var load order (#32350) · 8eb6ddc3
      Jess Telford authored
      My team & I keep asking the question "What order are env vars _actually_ loaded in?".
      
      This addition surfaces the order in a clear and readable way without having to read and understand the entire "Environment Variables" documentation first.
      
      ## Documentation / Examples
      
      - [x] Make sure the linting passes by running `yarn lint`
      Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
      8eb6ddc3
    • Kumar Deepanshu's avatar
      progressive web app example converted to typescript (#33100) · 9081cf87
      Kumar Deepanshu 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`
      Co-authored-by: 's avatarJJ Kasper <22380829+ijjk@users.noreply.github.com>
      9081cf87
    • Chris Midgley's avatar
      Allow passing nothing as custom jest config. (#32328) · 7b197221
      Chris Midgley authored
      If you don't have any config, currently you need to pass `{}`, which is
      less convenient than being able to pass nothing.
      
      7b197221