Conversation
…t and typed mixins
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (typeof globalThis.fetch === 'function') { | ||
| return globalThis.fetch.bind(globalThis) as (input: unknown, init?: unknown) => Promise<any>; | ||
| } | ||
|
|
||
| throw new Error('Fetch API is not available. Provide a global fetch implementation.'); |
There was a problem hiding this comment.
Restore node-fetch fallback for non-
fetch runtimes
The new getFetch implementation throws whenever globalThis.fetch is missing, and fetchWithRetry calls it for every request. In Node <18 or any environment without a global fetch, this makes the client unusable even though the previous version worked by calling the node-fetch import directly. Unless you explicitly want to drop support for those runtimes (and declare it via engines), this is a behavior regression; using the imported node-fetch as a fallback would preserve prior functionality.
Useful? React with 👍 / 👎.
| const out = new PaginatedRecordResponse(await client.request({ | ||
| path, | ||
| skipBasePathPrepend: true | ||
| }) as PaginatedRecordParams<T>); |
There was a problem hiding this comment.
Preserve subclass type in paginated navigation
In _get, the result is now constructed with new PaginatedRecordResponse(...) instead of new this.constructor(...). That means if a consumer subclasses PaginatedRecordResponse to add helpers, calling getNext/getPrev on the subclass will now return the base class and drop those subclass methods. This is a regression from the previous behavior and can break downstream code that relies on subclassing.
Useful? React with 👍 / 👎.
No description provided.