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

Update dependency convex to v1.18.0 #406

Merged
merged 1 commit into from
Jan 15, 2025
Merged

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jan 14, 2025

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
convex (source) 1.17.4 -> 1.18.0 age adoption passing confidence

Release Notes

get-convex/convex-js (convex)

v1.18.0

  • Warn on direct Convex function call. This adds a console.warn whenever a
    Convex Function (mutation, query, action, internalMutation, etc.) is called
    directly

    export const foo = mutation(...);
    
    export const bar = mutation({
      args: v.any(),
      returns: v.any(),
      handler: (ctx, args) => {
        const result = await foo();
      })
    }

    because this pattern causes problems and there are straightforward
    workarounds. The problems here:

    1. Arguments and return values aren't validated despite the presence of
      validators at the function definition site.
    2. Functions called this way unexpectedly lack isolation and atomicity. Convex
      functions may be writting assuming they will run as independent
      transactions, but running these function directly breaks that assumption.
    3. Running Convex functions defined by customFunctions like triggers can cause
      deadlocks and other bad behavior.

    There are two options for how to modify your code to address the warning:

    1. Refactor it out as a helper function, then call that helper function
      directly.
    2. Use ctx.runMutation, ctx.runQuery, or ctx.runAction() instead of
      calling the function directly. This has more overhead (it's slower) but you
      gain isolation and atomicity because it runs as a subtransaction.

    See
    https://docs.convex.dev/production/best-practices/#use-helper-functions-to-write-shared-code
    for more.

    Filter to warnings in the convex dashboard logs to see if you're using this
    pattern.

    For now running functions this way only logs a warning, but this pattern is
    now deprecated and may be deleted in a future version.

  • Support for Next.js 15 and
    Clerk core 2:
    @clerk/nextjs@5 and @clerk/nextjs@6 are now known to work to Convex. Docs,
    quickstarts and templates have not yet been updated. If you're upgrading
    @clerk/nextjs from v4 or v5 be sure to follow the Clerk upgrade guides as
    there are many breaking changes.

  • Improvements to npx convex run:

    • Better argument parsing with JSON5 so { name: "sshader" } parses
    • support for --identity similar to dashboard "acting as user" feature, like
      npx convex run --identity '{ name: "sshader" }'
    • npx convex run api.foo.bar is equivalent to npx convex run foo:bar
    • npx convex run convex/foo.ts:bar is equivalent to npx convex run foo:bar
    • npx convex run convex/foo.ts is equivalent to npx convex run foo:default
  • Allow non-JavaScript/TypeScript files in the convex/ directory. Only .js
    etc. files will be bundled and may define Convex functions points but adding a
    temporary file like convex/foo.tmp will no longer break` the build.

  • Fix type for FieldTypeFromFieldPath with optional objects.

  • Fix types when a handler returns a promise when using return value validators
    with object syntax.


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot force-pushed the renovate/convex-1.x-lockfile branch from 6d1e3be to fbaa87d Compare January 15, 2025 02:02
@renovate renovate bot merged commit 59d6e75 into main Jan 15, 2025
1 check passed
@renovate renovate bot deleted the renovate/convex-1.x-lockfile branch January 15, 2025 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants