Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emit build error for unknown cache kinds #72832

Open
wants to merge 11 commits into
base: canary
Choose a base branch
from

Commits on Nov 15, 2024

  1. Configuration menu
    Copy the full SHA
    c247d3b View commit details
    Browse the repository at this point in the history
  2. Rename "cache type" to "cache kind"

    This is now aligned with what the cache wrapper implementation calls it.
    unstubbable committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    2cec412 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    74d9000 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    22b8dc4 View commit details
    Browse the repository at this point in the history
  5. Emit build error for unknown cache kinds

    When a `"use cache"` directive with a custom cache kind is used, e.g.
    `"use cache: custom"`, a cache handler with the same name must be
    specified in the Next.js config:
    
    ```js
    /**
     * @type {import('next').NextConfig}
     */
    const nextConfig = {
      experimental: {
        dynamicIO: true,
        cacheHandlers: {
          custom: require.resolve('path/to/custom/cache/handler'),
        },
      },
    }
    
    module.exports = nextConfig
    ```
    
    If this is not the case, we emit a build error with an error message
    that explains this requirement.
    
    When we'll get a docs page for this experimental config, we will add
    the usual "Read more: ..." hint as well.
    unstubbable committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    dddf0ca View commit details
    Browse the repository at this point in the history
  6. Suggested changes

    bgw authored and unstubbable committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    6d80148 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    b86a957 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    f0517ec View commit details
    Browse the repository at this point in the history
  9. Use "experimental.cacheHandlers" in error message

    Co-authored-by: Janka Uryga <[email protected]>
    unstubbable and lubieowoce committed Nov 15, 2024
    Configuration menu
    Copy the full SHA
    633d34f View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f2052a4 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    acdafab View commit details
    Browse the repository at this point in the history