From 754b31aa6f8ff3d2f5675fd158ddc04d0f53388a Mon Sep 17 00:00:00 2001 From: Drew Powers Date: Wed, 14 Aug 2024 09:11:04 -0500 Subject: [PATCH] Update min size (#1851) --- docs/openapi-fetch/index.md | 6 +++--- docs/zh/openapi-fetch/index.md | 15 ++++++++------- packages/openapi-fetch/README.md | 6 +++--- packages/openapi-fetch/package.json | 2 +- 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/openapi-fetch/index.md b/docs/openapi-fetch/index.md index 994637598..0298aa08c 100644 --- a/docs/openapi-fetch/index.md +++ b/docs/openapi-fetch/index.md @@ -4,7 +4,7 @@ title: openapi-fetch openapi-fetch -openapi-fetch is a type-safe fetch client that pulls in your OpenAPI schema. Weighs **5 kb** and has virtually zero runtime. Works with React, Vue, Svelte, or vanilla JS. +openapi-fetch is a type-safe fetch client that pulls in your OpenAPI schema. Weighs **6 kb** and has virtually zero runtime. Works with React, Vue, Svelte, or vanilla JS. | Library | Size (min) | “GET” request\* | | :------------------------- | ---------: | :------------------------- | @@ -17,7 +17,7 @@ openapi-fetch is a type-safe fetch client that pulls in your OpenAPI schema. Wei _\* [Benchmarks are approximate](https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-fetch/test/index.bench.js) to just show rough baseline and will differ among machines and browsers. The relative performance between libraries is more reliable._ -The syntax is inspired by popular libraries like react-query or Apollo client, but without all the bells and whistles and in a 5 kb package. +The syntax is inspired by popular libraries like react-query or Apollo client, but without all the bells and whistles and in a 6 kb package. ::: code-group @@ -56,7 +56,7 @@ Notice there are no generics, and no manual typing. Your endpoint’s request an - ✅ No manual typing of your API - ✅ Eliminates `any` types that hide bugs - ✅ Also eliminates `as` type overrides that can also hide bugs -- ✅ All of this in a **5 kb** client package 🎉 +- ✅ All of this in a **6 kb** client package 🎉 ## Setup diff --git a/docs/zh/openapi-fetch/index.md b/docs/zh/openapi-fetch/index.md index 15bb7641b..79bbd1e2f 100644 --- a/docs/zh/openapi-fetch/index.md +++ b/docs/zh/openapi-fetch/index.md @@ -4,15 +4,16 @@ title: openapi-fetch openapi-fetch -`openapi-fetch`是一个类型安全的`fetch`客户端,用于拉取您的OpenAPI模式。大小为**5 kb**,几乎没有运行时。适用于React、Vue、Svelte或纯JS。 +`openapi-fetch`是一个类型安全的`fetch`客户端,用于拉取您的OpenAPI模式。大小为**6 kb**,几乎没有运行时。适用于React、Vue、Svelte或纯JS。 | 库 | 大小(最小) | “GET” 请求 | | :------------------------- | -----------: | :-------------------------- | -| openapi-fetch | `5 kB` | `278k` 操作/秒(最快) | -| openapi-typescript-fetch | `4 kB` | `130k` 操作/秒(2.1× 较慢) | -| axios | `32 kB` | `217k` 操作/秒(1.3× 较慢) | -| superagent | `55 kB` | `63k` 操作/秒(4.4× 较慢) | -| openapi-typescript-codegen | `367 kB` | `106k` 操作/秒(2.6× 较慢) | +| openapi-fetch | `6 kB` | `300k` 操作/秒(最快) | +| openapi-typescript-fetch | `3 kB` | `300k` 操作/秒(最快) | +| feature-fetch | `15 kB` | `300k` ops/s (fastest) | +| axios | `32 kB` | `225k` 操作/秒(1.3× 较慢) | +| superagent | `55 kB` | `50k` 操作/秒(6× 较慢) | +| openapi-typescript-codegen | `367 kB` | `100k` 操作/秒(3× 较慢) | 语法灵感来自流行的库,如`react-query`或`Apollo client`,但没有所有这些功能,并且包大小仅为5 kb。 @@ -53,7 +54,7 @@ await client.PUT("/blogposts", { - ✅ 无需手动输入API - ✅ 消除隐藏错误的 `any` 类型 - ✅ 还消除了可能隐藏错误的 `as` 类型覆盖 -- ✅ 所有这些都在一个 **5 kb** 的客户端包中 🎉 +- ✅ 所有这些都在一个 **6 kb** 的客户端包中 🎉 ## 安装 diff --git a/packages/openapi-fetch/README.md b/packages/openapi-fetch/README.md index 2ba2b4996..255edf976 100644 --- a/packages/openapi-fetch/README.md +++ b/packages/openapi-fetch/README.md @@ -1,6 +1,6 @@ openapi-fetch -openapi-fetch is a type-safe fetch client that pulls in your OpenAPI schema. Weighs **5 kb** and has virtually zero runtime. Works with React, Vue, Svelte, or vanilla JS. +openapi-fetch is a type-safe fetch client that pulls in your OpenAPI schema. Weighs **6 kb** and has virtually zero runtime. Works with React, Vue, Svelte, or vanilla JS. | Library | Size (min) | “GET” request\* | | :------------------------- | ---------: | :------------------------- | @@ -13,7 +13,7 @@ openapi-fetch is a type-safe fetch client that pulls in your OpenAPI schema. Wei _\* [Benchmarks are approximate](https://github.com/openapi-ts/openapi-typescript/blob/main/packages/openapi-fetch/test/index.bench.js) to just show rough baseline and will differ among machines and browsers. The relative performance between libraries is more reliable._ -The syntax is inspired by popular libraries like react-query or Apollo client, but without all the bells and whistles and in a 5 kb package. +The syntax is inspired by popular libraries like react-query or Apollo client, but without all the bells and whistles and in a 6 kb package. ```ts import createClient from "openapi-fetch"; @@ -48,7 +48,7 @@ Notice there are no generics, and no manual typing. Your endpoint’s request an - ✅ No manual typing of your API - ✅ Eliminates `any` types that hide bugs - ✅ Also eliminates `as` type overrides that can also hide bugs -- ✅ All of this in a **5 kb** client package 🎉 +- ✅ All of this in a **6 kb** client package 🎉 ## Setup diff --git a/packages/openapi-fetch/package.json b/packages/openapi-fetch/package.json index f3b526f7a..c0d31554c 100644 --- a/packages/openapi-fetch/package.json +++ b/packages/openapi-fetch/package.json @@ -1,6 +1,6 @@ { "name": "openapi-fetch", - "description": "Fast, type-safe fetch client for your OpenAPI schema. Only 5 kb (min). Works with React, Vue, Svelte, or vanilla JS.", + "description": "Fast, type-safe fetch client for your OpenAPI schema. Only 6 kb (min). Works with React, Vue, Svelte, or vanilla JS.", "version": "0.11.1", "author": { "name": "Drew Powers",