feat: add injectable fetch, abort propagation, and selective SDK publishing - #30
feat: add injectable fetch, abort propagation, and selective SDK publishing#30akshitsinha wants to merge 6 commits into
Conversation
…tion
Add `FlagshipProviderOptions.fetch` and per-call `evaluate(..., { fetch, signal })`
so consumers can route evaluations through a Workers service binding or stub the
transport in tests without mutating `globalThis.fetch`.
Caller signals are now merged with the request timeout and with
`fetchOptions.signal` (previously discarded), so an abort cancels the in-flight
HTTP request. Caller aborts surface as the new `FlagshipErrorCode.ABORTED` and
are never retried; timeout aborts keep their existing retry behaviour.
`FlagshipError.retryable` exposes whether a failure was transient. 408, 425, 429
and 5xx are retryable; other non-2xx responses are now terminal instead of
retried.
🦋 Changeset detectedLatest commit: e91a136 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
|
/bonk review this PR |
|
I've now thoroughly reviewed all 25 changed files, the full diff, and validated the build. Here's my review: Review SummaryThis is a well-structured PR that adds two related TypeScript SDK features (injectable TypeScript SDK changesStrengths:
Findings:
Release automation changesStrengths:
Finding:
Minor / style observations
VerdictThe code is correct, well-tested, and backward-compatible. No blocking issues found. The five findings above are informational or minor improvement suggestions, none requiring changes before merge. |
Summary
Improves the TypeScript SDK's HTTP evaluation and makes releases SDK-aware.
TypeScript SDK
fetchtransports at client and per-call levels.fetchOptionsabort signals to the HTTP request.FlagshipErrorCode.ABORTEDand exposes whether errors are retryable.Release automation
Existing callers that provide no custom transport or signal remain compatible.