Skip to content

TypeScript Typings + integration improvements#92

Merged
MattCCC merged 10 commits intov4from
typings
Jul 14, 2025
Merged

TypeScript Typings + integration improvements#92
MattCCC merged 10 commits intov4from
typings

Conversation

@MattCCC
Copy link
Owner

@MattCCC MattCCC commented Jul 14, 2025

This pull request updates the README.md file and adds several example files to improve documentation for the fetchff library. The changes focus on clarifying usage, enhancing type safety explanations, and providing practical examples for developers. Below are the most important changes grouped by theme:

Documentation Enhancements:

  • Updated the description of fetchf() (now also referred to as fetchff()) to highlight its simplicity and independence from createApiFetcher().
  • Added a new section for getDefaultConfig() to explain how to retrieve and inspect global configurations.
  • Improved type descriptions, replacing outdated generics like EndpointsMethods with EndpointTypes for better clarity and consistency. [1] [2]

TypeScript Typings:

  • New TypeScript Typings usage (check Readme; breaking change)
  • Enhanced the FetchResponse interface by reordering generic parameters for better readability.
  • Introduced a new shorthand for request typings (Req<ResponseData, RequestBody, QueryParams, UrlPathParams>) and clarified its compatibility with older versions.

Example Files:

  • Added multiple example files (docs/examples/) demonstrating practical use cases, including basic usage, custom headers, error-handling strategies (e.g., defaultResponse, reject, silent, softFail), and request chaining. [1] [2] [3] [4] [5] [6] [7]

React Integration:

  • Highlighted official support for useFetcher(url, config) and provided guidance on integrating with React Query and SWR. [1] [2]

Minor Updates:

  • Adjusted file references and fixed minor typos in examples for better readability and accuracy. [1] [2] [3]

@MattCCC MattCCC self-assigned this Jul 14, 2025
@github-actions
Copy link

github-actions bot commented Jul 14, 2025

size-limit report 📦

Path Size
dist/browser/index.mjs 5.28 KB (-0.06% 🔽)
dist/browser/index.global.js 5.44 KB (-0.08% 🔽)
dist/node/index.js 5.35 KB (+0.13% 🔺)
dist/react/index.mjs 8.32 KB (+0.1% 🔺)
dist/react/index.js 9.03 KB (+0.2% 🔺)

@MattCCC MattCCC merged commit b4f39ab into v4 Jul 14, 2025
10 checks passed
@MattCCC MattCCC deleted the typings branch July 14, 2025 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants