Skip to content

Move paced mutation hooks to a shared adapter conformance contract #2178

Open

Description

@KyleAMathews

Problem

Only @tanstack/react-db currently exposes a usePacedMutations framework hook. Its callback freshness rules therefore live in the React adapter, and PR #2170 needs a React-specific oracle for rendered-versus-committed callbacks.

If equivalent hooks are added to Vue, Svelte, Solid, or Angular, duplicating this policy in each package would make callback ownership and pacing behavior drift.

Proposed direction

  • Define a shared paced-mutation adapter contract for callback ownership, stable mutation-function identity, strategy timing, and transaction settlement.
  • Keep framework lifecycle semantics in receiving drivers. React must distinguish rendered from committed callbacks; other frameworks should define their corresponding activation/publication cut.
  • Move the independent active-callback-owner model into the shared conformance suite when there is another framework consumer.
  • Keep core createPacedMutations responsible for pacing, transaction admission, ordering, and settlement rather than framework lifecycle.

Current boundary

Until another framework exposes an equivalent hook, PR #2170 and its executable oracle remain in packages/react-db. The core paced-mutations oracle does not claim framework render scheduling.

Acceptance criteria

  • At least two framework adapters consume one shared contract.
  • Each driver names its lifecycle publication cut and tests abandoned/uncommitted work where applicable.
  • Callback ownership, mutate identity, and immediate versus delayed persistence have shared expected outcomes.
  • The oracle coverage map names the shared owner and each receiving driver without lending one framework evidence to another.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions