| 1 | # notable changes in React Mutation |
| 2 | |
| 3 | ## v3.0.1 |
| 4 | |
| 5 | ### bugfixes |
| 6 | |
| 7 | - resolve an SSR memory leak in `useMutate` |
| 8 | - resolve `isAllowed`/`isDisabled` no longer updating after StrictMode's |
| 9 | simulated remount permanently dropped the subscription |
| 10 | |
| 11 | ## v3 |
| 12 | |
| 13 | ### breaking |
| 14 | |
| 15 | - `id` is now required for all mutations. It must be unique per client; |
| 16 | duplicate registration throws in production and replaces the previous |
| 17 | registration in development (hot reload re-runs `define`). |
| 18 | - `handleUnauthenticated` and `onUnauthenticated` now receive a serializable |
| 19 | `MutationAction` (`{ id, description, args }`) instead of a description string |
| 20 | |
| 21 | ### features |
| 22 | |
| 23 | - authentication integration for mutations (`auth: true`, `userContext`, |
| 24 | `isAllowed`, `handleUnauthenticated`) |
| 25 | - auth scopes for permission gates: declare `authScopes` on the client and |
| 26 | `auth: "<scope>"` on mutations |
| 27 | - `MutationClient.run(action)` re-runs a stored `MutationAction`, enabling |
| 28 | sign-in flows that resume the blocked mutation |
| 29 | - `MutationButton` hides non-allowed mutations that cannot route to the |
| 30 | sign-in flow; opt out with `showNotAllowed` |
| 31 | |
| 32 | ### bugfixes |
| 33 | |
| 34 | - `runAsHeadlessPromise` correctly rethrows the underlying error |
| 35 | - clarify some intent in the readme |
| 36 | |
| 37 | ## v2.1.0 |
| 38 | |
| 39 | ### features |
| 40 | |
| 41 | - tanstack query integration |
| 42 | - arrayUpsert and objArrayUpsert |
| 43 | - mutation buttons |
| 44 | - pass `args={null}` to disable the button UI |
| 45 | |
| 46 | ## v2.0.1 |
| 47 | |
| 48 | ### bugfixes |
| 49 | |
| 50 | - typescript violation not passing client context to optimistic handlers |
| 51 | - `onSuccess` prop split into `onSuccessUi` and `onSuccessData`. but it didn't even work before so this isn't breaking. |
| 52 | |
| 53 | ## v2 |
| 54 | |
| 55 | ### breaking |
| 56 | |
| 57 | - rename `onSuccess` and `onSuccessDataOnly` to `onSuccessUi` and `onSuccessData`. |
| 58 | |
| 59 | ## v1.1 |
| 60 | |
| 61 | - Add `runAsHeadlessPromise`. The function name is intentionally long to avoid using it, please use `runWithOptions` instead. |