You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(hooks): route widened async params to the deprecated overloads
Replace the non-deprecated catch-all overloads with plain deprecated
overloads (no async?: false pin): a params object whose async widened
to boolean — or a value of the exported *Params types — now resolves
to the deprecated overload instead of a warning-free catch-all. Since
async is a member of the params types, such calls compile (no
weak-type failure) and behave per the runtime value; the deprecation
message tells the caller the fix: re-pin with { ...params, async:
true }. This makes deprecation coverage total — any call not provably
async: true is flagged — at the cost of a nudge for already-migrated
callers who kept a widened object, which the message resolves.
The type-compat tests keep pinning that these calls compile and run
async at runtime, now with intentional no-deprecated disables.
constparams={async: true};// widens to { async: boolean }
378
380
const{ result }=renderHook(()=>
381
+
// eslint-disable-next-line @typescript-eslint/no-deprecated -- widened async resolves to the deprecated overload by design; runtime still honors the value
// eslint-disable-next-line @typescript-eslint/no-deprecated -- exported param types carry async?: boolean and resolve to the deprecated overload by design
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. */
321
+
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. If your params object's `async` widened to `boolean`, re-pin it at the call site: `{ ...params, async: true }`. */
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. */
326
+
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. If your params object's `async` widened to `boolean`, re-pin it at the call site: `{ ...params, async: true }`. */
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. */
341
+
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. If your params object's `async` widened to `boolean`, re-pin it at the call site: `{ ...params, async: true }`. */
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. */
346
+
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. If your params object's `async` widened to `boolean`, re-pin it at the call site: `{ ...params, async: true }`. */
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. */
361
+
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. If your params object's `async` widened to `boolean`, re-pin it at the call site: `{ ...params, async: true }`. */
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. */
// Widened-`async` catch-alls: a params object built separately (or typed
376
-
// with the exported *Params types) carries `async?: boolean` and matches no
377
-
// literal overload above — without these the compiler rejects the call and
378
-
// blames the *source* argument. The flag still must stay constant for the
379
-
// component's lifetime. Literal `async` values resolve to the more specific
380
-
// overloads first, keeping the deprecation warnings and `required` narrowing.
381
-
exportfunctionuseViewModelInstance(
382
-
source: RiveFile|null|undefined,
383
-
params?: UseViewModelInstanceFileParams
384
-
): UseViewModelInstanceResult;
385
-
exportfunctionuseViewModelInstance(
386
-
source: ViewModel|null|undefined,
387
-
params?: UseViewModelInstanceViewModelParams
388
-
): UseViewModelInstanceResult;
366
+
/** @deprecated Pass `async: true` — without it the instance is created synchronously via deprecated runtime APIs that block the JS thread. `async: true` becomes the default in the next major. If your params object's `async` widened to `boolean`, re-pin it at the call site: `{ ...params, async: true }`. */
0 commit comments