diff --git a/docs/about/02-comparison.md b/docs/about/02-comparison.md index 6c15ecc32..7e7a285cd 100644 --- a/docs/about/02-comparison.md +++ b/docs/about/02-comparison.md @@ -32,8 +32,6 @@ react-query is a powerful asynchronous state management library, swr is a React | Dependency collection (performance) | ❌ | ✅ | ✅ | | Data synchronization | ✅ | ✅ | ✅ | -1 - ## Compare with traditional request tools such as axios/fetch/XMLHttpRequest Traditional request tools such as `axios/fetch/XMLHttpRequest` and the next-generation request tool alova solve different problems. The former focuses on sending requests and receiving responses, while the latter is used to improve APIs The consumption efficiency of alova is improved. They complement each other. Combining alova with traditional request tools can obtain more powerful request features. Let's take axios as an example. diff --git a/docs/tutorial/02-getting-started/01-introduce.md b/docs/tutorial/02-getting-started/01-introduce.md index 98a444fd5..17e71526d 100644 --- a/docs/tutorial/02-getting-started/01-introduce.md +++ b/docs/tutorial/02-getting-started/01-introduce.md @@ -384,7 +384,7 @@ See [Request Rate Limit Strategy](/tutorial/server/strategy/rate-limit) for deta ### More modern openAPI solution -1. alova's devtools can generate API calling code, along with corresponding TypeScript types and comprehensive documentation, all in one go, so you can enjoy comprehensive API type hints even in JavaScript projects. +1. alova's devtools can generate API calling code, as well as TypeScript types and detailed documentation for each API, so you can enjoy full API type hints even in JavaScript projects. ```mermaid flowchart LR diff --git a/i18n/zh-CN/code.json b/i18n/zh-CN/code.json index d0eebbcc0..be1be5a65 100644 --- a/i18n/zh-CN/code.json +++ b/i18n/zh-CN/code.json @@ -298,7 +298,7 @@ "description": "title for automatic generate" }, "homepage.automaticGenerate.description": { - "message": "alova的devtools能够同时生成API调用代码,同时提供相应的TypeScript类型定义和详尽的文档。即使在JavaScript项目中,也能享受到完整的TypeScript类型提示。此外,你还可以快速查找所需API,参照参数表快速传参,所有操作均在编辑器内完成。", + "message": "alova的devtools能够同时生成API调用代码,以及每个API的TypeScript类型和详尽的文档。即使在JavaScript项目中,也能享受到完整的TypeScript类型提示。此外,你还可以快速查找所需API,参照参数表快速传参,所有操作均在编辑器内完成。", "description": "desc for automatic generate" }, "homepage.automaticGenerate.Locate API by its url or description": { diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorial/02-getting-started/01-introduce.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorial/02-getting-started/01-introduce.md index e806f003a..9dc2b79cf 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorial/02-getting-started/01-introduce.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/tutorial/02-getting-started/01-introduce.md @@ -384,7 +384,7 @@ const orderRes = await limit(alova.Get('/api/order')); ### 更先进的 openAPI 解决方案 -1. alova 的开发工具能够同时生成 API 调用代码,以及每个 API 的 TypeScript 类型定义和详尽的 API 文档,即使在 JavaScript 项目中也能享受到完整的 API 类型提示。 +1. alova 的开发工具能够同时生成 API 调用代码,以及每个 API 的 TypeScript 类型和详尽的 API 文档,即使在 JavaScript 项目中也能享受到完整的 API 类型提示。 ```mermaid flowchart LR diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-v2/tutorial/11-others/02-comparison.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-v2/tutorial/11-others/02-comparison.md index 585301dee..ee0832c65 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-v2/tutorial/11-others/02-comparison.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-v2/tutorial/11-others/02-comparison.md @@ -7,28 +7,29 @@ import TabItem from '@theme/TabItem'; ## react-query/swr/alova 对比 -react-query 是一个强大的异步状态管理,swr 是一个用于数据请求的 React Hooks 库,它们的共同特性也是使用 use hook 来发送和管理请求,和数据缓存功能,以下是三者的对比表格。 - -| 特性 ↓/库 → | react-query | swr | alova | -| ------------------- | ------------ | ------------ | ---------------------------------------------------- | -| 定位 | 异步状态管理 | 异步状态管理 | 提升 API 消费效率 | -| 使用模式 | hooks 为主 | hooks 为主 | 完整的请求方案 | -| 适用环境 | client | client | client/server | -| 请求策略 | 2-3 个 hooks | 2-3 个 hooks | hooks/interceptors/middlewares/server hooks 等 20+个 | -| hooks 操作函数 | ❌ | ❌ | ✅ | -| 框架支持 | 多包支持 | 仅 React | 适配器支持 | -| SSR | ✅ | ✅ | ✅ | -| 服务端 | ❌ | ❌ | nodejs/deno/bun | -| 自由度 | 🟡 受限 | 🟡 受限 | 灵活度高 | -| 请求共享 | ❌ | ❌ | ✅ | -| 缓存模式 | 单级缓存 | 单级缓存 | 多级缓存 | -| axios 支持 | ✅ | ✅ | ✅ | -| fetch 支持 | ✅ | ✅ | ✅ | -| XMLHttpRequest 支持 | 🟡 受限 | 🟡 受限 | ✅ | -| 请求方式 | 第三方库 | 第三方库 | 统一的 Method 代理 | -| 插件系统 | 请求库决定 | 请求库决定 | 官方提供 | -| 依赖收集(性能) | ❌ | ✅ | ✅ | -| 数据同步 | ✅ | ✅ | ✅ | +react-query 是一个强大的异步状态管理库,swr 是一个用于数据请求的 React Hooks 库,它们的共同特性也是使用 use hook 来发送和管理请求,和数据缓存功能,以下是三者的对比表格。 + +| 特性 ↓/库 → | react-query | swr | alova | +| ------------------- | --------------- | ------------------------- | ----------------------- | +| 定位 | 异步状态管理 | 数据请求的 React Hooks 库 | 极致简化 API 集成工作流 | +| 使用模式 | hooks | hooks | 完整的请求方案 | +| 适用环境 | client | client | client/server | +| 框架支持 | 多包支持 | 仅 React | 适配器支持 | +| SSR | ✅ | ✅ | ✅ | +| hooks 数量 | 2-3 | 2-3 | 15+ | +| hooks 操作函数 | ❌ | ❌ | ✅ | +| 服务端 | ❌ | ❌ | nodejs/deno/bun | +| server hooks | ❌ | ❌ | ✅ | +| 自由度 | 🟡 受限 | 🟡 受限 | 🟢 灵活度高 | +| 请求共享 | ❌ | ❌ | ✅ | +| 缓存模式 | 单级缓存 | 单级缓存 | 多级缓存 | +| axios 支持 | ✅ | ✅ | ✅ | +| fetch 支持 | ✅ | ✅ | ✅ | +| XMLHttpRequest 支持 | 🟡 受限 | 🟡 受限 | ✅ | +| 请求方式 | 第三方库 | 第三方库 | 统一的 Method 代理 | +| openAPI 支持 | 🟡 受限第三方库 | 🟡 受限第三方库 | 🟢 更现代的方案 | +| 依赖收集(性能) | ❌ | ✅ | ✅ | +| 数据同步 | ✅ | ✅ | ✅ | ## 与 axios/fetch/XMLHttpRequest 等传统请求工具对比 diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 6bf5562aa..d086bdf67 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -176,7 +176,7 @@ export default function Home(): JSX.Element { id: 'homepage.automaticGenerate.title' })} description={translate({ - message: `alova's devtools can generate API calling code, along with corresponding TypeScript types and comprehensive documentation, all in one go. Even in JavaScript projects, you can enjoy full TypeScript type hinting. Moreover, you can quickly search for the APIs you need, match parameters from the parameter list, all without leaving your editor.`, + message: `alova's devtools can generate API calling code, as well as TypeScript types and detailed documentation for each API. Even in JavaScript projects, you can enjoy full TypeScript type hinting. Moreover, you can quickly search for the APIs you need, match parameters from the parameter list, all without leaving your editor.`, id: 'homepage.automaticGenerate.description' })} /> diff --git a/versioned_docs/version-v2/tutorial/11-others/02-comparison.md b/versioned_docs/version-v2/tutorial/11-others/02-comparison.md index 26676da72..f8997687c 100644 --- a/versioned_docs/version-v2/tutorial/11-others/02-comparison.md +++ b/versioned_docs/version-v2/tutorial/11-others/02-comparison.md @@ -3,33 +3,33 @@ title: Compare with other libraries --- import Tabs from '@theme/Tabs'; - import TabItem from '@theme/TabItem'; ## react-query/swr/alova comparison -react-query is a powerful asynchronous state management, swr is a React Hooks library for data requests, their common feature is also the use of use hook to send and manage requests, and data caching function, the following is a comparison table of the three. - -| Features ↓/Library → | react-query | swr | alova | -| ----------------------------------- | ----------------------------- | ----------------------------- | ----------------------------------------------- | -| Positioning | Asynchronous state management | Asynchronous state management | Improve API consumption efficiency | -| Usage mode | Hooks-based | Hooks-based | Complete request solution | -| Applicable environment | client | client | client/server | -| Request strategy | 2-3 hooks | 2-3 hooks | 20+ hooks/interceptors/middlewares/server hooks | -| Hooks operation function | ❌ | ❌ | ✅ | -| Framework support | Multi-package support | React only | Adapter support | -| SSR | ✅ | ✅ | ✅ | -| Server | ❌ | ❌ | nodejs/deno/bun | -| Freedom | 🟡 Limited | 🟡 Limited | High flexibility | -| Request sharing | ❌ | ❌ | ✅ | -| Cache strategy | Single-level cache | Single-level cache | Multi-level cache | -| Axios support | ✅ | ✅ | ✅ | -| Fetch support | ✅ | ✅ | ✅ | -| XMLHttpRequest support | 🟡 Limited | 🟡 Limited | ✅ | -| Request method | Third-party library | Third-party library | Unified Method proxy | -| Plugin system | Request library decision | Request library decision | Officially provided | -| Dependency collection (performance) | ❌ | ✅ | ✅ | -| Data synchronization | ✅ | ✅ | ✅ | +react-query is a powerful asynchronous state management library, swr is a React Hooks library for data requests, their common features are also using use hook to send and manage requests, and data caching function, the following is a comparison table of the three. + +| Features ↓/Library → | react-query | swr | alova | +| ----------------------------------- | --------------------------------- | ------------------------------------- | --------------------------------------------- | +| Positioning | Asynchronous state management | React Hooks library for data requests | Extremely simplified API integration workflow | +| Usage mode | hooks | hooks | Complete request scheme | +| Applicable environment | client | client | client/server | +| Framework support | Multi-package support | React only | Adapter support | +| SSR | ✅ | ✅ | ✅ | +| Number of hooks | 2-3 | 2-3 | 15+ | +| Hooks operation function | ❌ | ❌ | ✅ | +| Server | ❌ | ❌ | nodejs/deno/bun | +| server hooks | ❌ | ❌ | ✅ | +| Freedom | 🟡 Limited | 🟡 Limited | 🟢 High flexibility | +| Request sharing | ❌ | ❌ | ✅ | +| Cache strategy | Single-level cache | Single-level cache | Multi-level cache | +| Axios support | ✅ | ✅ | ✅ | +| Fetch support | ✅ | ✅ | ✅ | +| XMLHttpRequest support | 🟡 Restricted | 🟡 Restricted | ✅ | +| Request method | Third-party library | Third-party library | Unified Method proxy | +| openAPI support | 🟡 Restricted third-party library | 🟡 Restricted third-party library | 🟢 More modern solutions | +| Dependency collection (performance) | ❌ | ✅ | ✅ | +| Data synchronization | ✅ | ✅ | ✅ | ## Comparison with traditional request tools such as axios/fetch/XMLHttpRequest