The Wayback Machine - https://web.archive.org/web/20220430132238/https://github.com/vercel/next.js/commits/canary
Skip to content
Permalink
canary
Switch branches/tags

Commits on Apr 30, 2022

  1. Refactor Page Paths utils and Middleware Plugin (#36576)

    This PR brings some significant refactoring in preparation for upcoming middleware changes. Each commit can be reviewed independently, here is a summary of what each one does and the reasoning behind it:
    - [Move pagesDir to next-dev-server](javivelasco@f2fe154) simply moves the `pagesDir` property to the dev server which is the only place where it is needed. Having it for every server is misleading.
    - [Move (de)normalize page path utils to a file page-path-utils.ts](javivelasco@27cedf0) Moves the functions to normalize and denormalize page paths to a single file that is intended to hold every utility function that transforms page paths. Since those are complementary it makes sense to have them together. I also added explanatory comments on why they are not idempotent and examples for input -> output that I find very useful.
    - [Extract removePagePathTail](javivelasco@6b12133) This extracts a function to remove the tail on a page path (absolute or relative). I'm sure there will be other contexts where we can use it.
    - [Extract getPagePaths and refactor findPageFile](javivelasco@cf2c7b8) This extracts a function `getPagePaths` that is used to generate an array of paths to inspect when looking for a page file from `findPageFile`. Then it refactors such function to use it parallelizing lookups. This will allow us to print every path we look at when looking for a file which can be useful for debugging. It also adds a `flatten` helper. 
    - [Refactor onDemandEntryHandler](javivelasco@4be685c) I've found this one quite difficult to understand so it is refactored to use some of the previously mentioned functions and make it easier to read.
    - [Extract absolutePagePath util](javivelasco@3bc0783) Extracts yet another util from the `next-dev-server` that transforms an absolute path into a page name. Of course it adds comments, parameters and examples.
    - [Refactor MiddlewarePlugin](javivelasco@c595a2c) This is the most significant change. The logic here was very hard to understand so it is totally redistributed with comments. This also removes a global variable `ssrEntries` that was deprecated in favour of module metadata added to Webpack from loaders keeping less dependencies. It also adds types and makes a clear distinction between phases where we statically analyze the code, find metadata and generate the manifest file cc @shuding @huozhi 
    
    EDIT: 
    - [Split page path utils](158fb00) After seeing one of the utils was being used by the client while it was defined originally in the server, with this PR we are splitting the util into multiple files and moving it to `shared/lib` in order to make explicit that those can be also imported from client.
    javivelasco committed Apr 30, 2022

Commits on Apr 29, 2022

  1. v12.1.6-canary.15

    ijjk committed Apr 29, 2022
  2. Adds inline script functionality to next/script for worker and `b…

    …eforeInteractive` strategies (#36364)
    
    Adds inline script functionality to `next/script` for `worker` and `beforeInteractive` strategies. 
    
    - fixes #36318 
    - fixes #26343
    - fixes #26591
    - fixes #26343
    - fixes #26240
    
    
    Co-authored-by: Janicklas Ralph <6142074+janicklas-ralph@users.noreply.github.com>
    housseindjirdeh and janicklas-ralph committed Apr 29, 2022
  3. chore: clarify CLI network errors (#36567)

    Makes it easier to detect why a network error occurred with the CLI or `next info`, based on #36344
    
    ## 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`
    balazsorban44 committed Apr 29, 2022
  4. Add note about running next without a sub-command (#36560)

    This should be made explicitly clear because other code may just call `next` instead of `next dev` (e.g. https://github.com/netlify/framework-info/blob/main/src/frameworks/next.json).
    
    Being in the ninth circle of debug hell right now I could not take it for granted that the two were the same till I saw some kind of confirmation, either from the docs or from the source.  Source is great, but calling it out in the docs would saved me some time.
    
    
    
    ## 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`
    refactorized committed Apr 29, 2022

Commits on Apr 28, 2022

  1. bump styled-jsx to latest (#36554)

    x-ref: coryetzkorn/twitter-algorithm#2
    
    * Bump styled-jsx to latest version (5.0.2), so that it could get dedup when user installs the styled-jsx manually
    * Remove the legacy `@types/styled-jsx`
    huozhi committed Apr 28, 2022
  2. Hoist the desired ReactDOM import expression (#36552)

    * hoist `react-dom/server` imports to reduce module load time in nodejs
    * simplify `reactRoot` detection condition by checking the streaming rendering API we're using. (if it doesn't existed, like react 17, then we won't enable `reactRoot`)
    * Merge `__NEXT_CONCURRENT_FEATURES` into `__NEXT_REACT_ROOT` env var since they're identical now
    huozhi committed Apr 28, 2022
  3. v12.1.6-canary.14

    ijjk committed Apr 28, 2022
  4. unlock eslint-config-next dependencies (#35781)

    Fixes #35753
    
    ## 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: JJ Kasper <22380829+ijjk@users.noreply.github.com>
    balazsorban44 and ijjk committed Apr 28, 2022
  5. Tweak lockfile patching to be eager (#36549)

    This is a follow-up to #36527 to make sure we eagerly patch the lockfile as the correct swc dependency will be present if the platform matches so the load failure isn't hit which is where we were previously patching the lockfile. This is done in the background so does not block compilation. This also removes some extra logs that aren't necessary. 
    
    <details>
    
    <summary>before lockfile patch</summary>
    
    ![before](https://user-images.githubusercontent.com/22380829/165780507-09e5aee6-3253-483f-9e3f-e24bea6df377.png)
    
    </details>
    
    
    <details>
    
    <summary>after lockfile patch</summary>
    
    ![after](https://user-images.githubusercontent.com/22380829/165780545-829665aa-05ec-431d-aa2f-42c4ce3badd7.png)
    
    </details>
    
    This also fixes a case I noticed where we weren't flushing events before exiting when builds fail
    ijjk committed Apr 28, 2022
  6. Refactor base server to get rid of the __server_context hack (#36550)

    This PR makes the `Options` type of base server configurable as well as assigning to `this.serverOptions`, so the web server can access it during `constructor()`. This gets rid of the dirty `__server_context` hack.
    
    ## 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`
    shuding committed Apr 28, 2022
  7. docs(examples): Updated Chakra UI examples (#36333)

    ## Overview
    
    This PR updates both Chakra UI examples by updating the Chakra UI packages to the latest versions, and added better examples for Semantic Tokens (new feature in Chakra UI), and pseudo props.
    
    ## Documentation / Examples
    
    - [x] Make sure the linting passes by running `yarn lint`
    
    
    Co-authored-by: Balázs Orbán <18369201+balazsorban44@users.noreply.github.com>
    nikolovlazar and balazsorban44 committed Apr 28, 2022
  8. Update swc (#36535)

    This PR updates swc to swc-project/swc@a72f436
    
    
    This PR applies
    
     - swc-project/swc#4452
       - Fixes `yield*` of async generators in async generators.
       - Fixes name mangling of injected helpers.
         - Note: This only applies to tiny files which enables lots of helpers.
     - swc-project/swc#4468
       - Fixes newer version of react.
    kdy1 committed Apr 28, 2022
  9. v12.1.6-canary.13

    timneutkens committed Apr 28, 2022
  10. Bump react dev dep to 18.1 (#36491)

    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    huozhi and kodiakhq[bot] committed Apr 28, 2022
  11. Align behavior of SWC transform & transformSync (#36500)

    fixes #35661
    
    
    
    ## Bug
    
    - [x] 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.
    - [x] 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`
    Brooooooklyn committed Apr 28, 2022
  12. Adds <link rel="preconnect" ... /> to example optimized font output (

    …#36529)
    
    This makes it clear that the font optimization adds these for you.
    This avoids duplicate `<link rel="preconnect" />` in the HTML output if the developer is unaware that it is being added automatically.
    
    
    
    ## Documentation / Examples
    
    - [x] Make sure the linting passes by running `yarn lint`
    sa3dany committed Apr 28, 2022

Commits on Apr 27, 2022

  1. Add docs on self-hosted ISR persisting across pods. (#36520)

    ISR works self-hosted, but there's some more guidance needed when hosting with container-based setups (e.g. Kubernetes) and how the files are shared between different pods. This was based on community feedback. Please let me know if you'd like to see any additions here! 🙏
    leerob committed Apr 27, 2022
  2. Always add height and width prop to image with layout="raw" (#36523)

    This PR makes the following changes:
    * Always add the `height` and `width` prop to image with `raw` layout (previously only added to images without `sizes`)
    * Add a warning if a raw layout image is getting stretched (which can be caused by interaction of height and width prop with styles)
    * Remove automatic aspect-ratio style from `raw` images. This is no longer necessary if all `raw` images have height and width props.
    * Update tests and docs accordingly
    atcastle committed Apr 27, 2022
  3. v12.1.6-canary.12

    ijjk committed Apr 27, 2022
  4. Ensure optional params are normalized correctly in minimal mode (#36513)

    Follow-up for #36463 this fixes an issue with optional catch-all params not being normalized correctly which was caught by the runtimes tests. 
    
    ## Bug
    
    - [x] Related issues linked using `fixes #number`
    - [x] Integration tests added
    - [ ] Errors have helpful link attached, see `contributing.md`
    ijjk committed Apr 27, 2022
  5. polish isomorphic path module (#36521)

    List all exports for internal path module to avoid import destruction is breaking with typescript.
    
    #### Prev
    ```js
    import pathMod from '../isomorphic/path'
    
    const { join, resolve } = pathMod
    ```
    
    #### Now
    ```js
    import { join, resolve } from '../isomorphic/path'
    ```
    huozhi committed Apr 27, 2022
  6. Update rewrite destination for flakey rewrite tests (#36519)

    * Update rewrite destination for flakey rewrite tests
    
    * update other test
    ijjk committed Apr 27, 2022
  7. Add with-edgedb example (#35929)

    ## Documentation / Examples
     
    - [X] Make sure the linting passes by running `yarn lint`
    colinhacks committed Apr 27, 2022
  8. v12.1.6-canary.11

    timneutkens committed Apr 27, 2022
  9. v12.1.6-canary.10

    timneutkens committed Apr 27, 2022
Older