ترقية node-fetch من 2.x إلى 3.x
مقارنة الواجهة العامة لـ node-fetch بين 2.7.0 و3.3.2، محسوبة تلقائيًا من أنواع TypeScript. التوقيع المعدّل تغيير محتمل غير متوافق، وليس أمرًا مؤكدًا.
الملخص
| مسارات الاستيراد المحذوفة | 1 |
|---|---|
| الصادرات المحذوفة | 6 |
| التوقيعات المعدّلة | 5 |
| أعضاء الأصناف أو الواجهات المحذوفة | 19 |
| أعضاء الأصناف أو الواجهات المعدّلة | 14 |
| موقوفة حديثًا | 3 |
| تغييرات المتطلبات (engines واعتماديات peer) | 2 |
| صادرات جديدة | 7 |
مسارات الاستيراد المحذوفة
| مسارات الاستيراد المحذوفة |
|---|
node-fetch/externals |
الصادرات المحذوفة
| import | export | kind | قبل |
|---|---|---|---|
node-fetch | HeaderInit | type | Headers | string[][] | { [key: string]: string | string[]; } |
node-fetch | RequestMode | type | "same-origin" | "cors" | "no-cors" |
node-fetch | RequestCache | type | "default" | "force-cache" | "no-cache" | "no-store" | "only-if-cached" | "reload" |
node-fetch | ResponseType | type | "error" | "default" | "cors" | "basic" | "opaque" | "opaqueredirect" |
node-fetch | RequestContext | type | "object" | "audio" | "beacon" | "cspreport" | "download" | "embed" | "eventsource" | "favicon" | "fetch" | "font" | "form" | "frame" | "hyperlink" | "iframe" | "image" | "imageset" | "import" | "internal" | "location" | "manifest" | "ping" | "plugin" | "prefetch" | "script" | "serviceworker" | "sharedworker" | "style" | "subresource" | "track" | "video" | "worker" | "xmlhttprequest" | "xslt" |
node-fetch | RequestCredentials | type | "omit" | "include" | "same-origin" |
التوقيعات المعدّلة
| export | قبل | بعد |
|---|---|---|
node-fetch · Blob | class | any |
node-fetch · Body | class | interface |
node-fetch · default | (url: RequestInfo, init?: RequestInit | undefined): Promise<Response> | (url: URL | RequestInfo, init?: RequestInit | undefined): Promise<Response> |
node-fetch · HeadersInit | Headers | string[][] | { [key: string]: string | string[]; } | Headers | Record<string, string> | Iterable<readonly [string, string]> | Iterable<Iterable<string>> |
node-fetch · RequestInfo | string | Request | URLLike | string | Request |
أعضاء الأصناف أو الواجهات المحذوفة
| member | import | قبل |
|---|---|---|
Body.timeout | node-fetch | number |
Body.textConverted | node-fetch | (): Promise<string> |
Request.port | node-fetch | number | undefined |
Request.agent | node-fetch | any |
Request.follow | node-fetch | number |
Request.context | node-fetch | RequestContext |
Request.counter | node-fetch | number |
Request.timeout | node-fetch | number |
Request.compress | node-fetch | boolean |
Request.hostname | node-fetch | string |
Request.protocol | node-fetch | string |
Request.textConverted | node-fetch | (): Promise<string> |
Response.timeout | node-fetch | number |
Response.textConverted | node-fetch | (): Promise<string> |
RequestInit.timeout | node-fetch | number | undefined |
ResponseInit.url | node-fetch | string | undefined |
ResponseInit.size | node-fetch | number | undefined |
ResponseInit.counter | node-fetch | number | undefined |
ResponseInit.timeout | node-fetch | number | undefined |
أعضاء الأصناف أو الواجهات المعدّلة
| member | قبل | بعد |
|---|---|---|
Body.body | NodeJS.ReadableStream | any |
Body.json | (): Promise<any> | (): Promise<unknown> |
Body.constructor | (body?: any, opts?: { size?: number | undefined; timeout?: number | undefined; } | undefined): Body | |
Headers.raw | (): { [k: string]: string[]; } | (): Record<string, string[]> |
Headers.forEach | (callback: (value: string, name: string) => void): void | (callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any): void |
Request.body | NodeJS.ReadableStream | any |
Request.json | (): Promise<any> | (): Promise<unknown> |
Request.constructor | (input: RequestInfo, init?: RequestInit | undefined): Request | (input: URL | RequestInfo, init?: RequestInit | undefined): Request |
Response.body | NodeJS.ReadableStream | any |
Response.json | (): Promise<any> | (): Promise<unknown> |
Response.static redirect | (url: string, status: number): Response | (url: string, status?: number | undefined): Response |
AbortError.type | "aborted" | string |
AbortError.constructor | (message: string): AbortError | (message?: string | undefined): AbortError | (message?: string | undefined, options?: ErrorOptions | undefined): AbortError |
FetchError.constructor | (message: string, type: string, systemError?: SystemError | undefined): FetchError | (message: string, type: string, systemError?: Record<string, unknown> | undefined): FetchError |
موقوفة حديثًا
| export | @deprecated |
|---|---|
node-fetch · Body.buffer | Use `body.arrayBuffer()` instead. |
node-fetch · Request.buffer | Use `body.arrayBuffer()` instead. |
node-fetch · Response.buffer | Use `body.arrayBuffer()` instead. |
تغييرات المتطلبات (engines واعتماديات peer)
| قبل | بعد | |
|---|---|---|
engines.node | 4.x || >=6.0.0 | ^12.20.0 || ^14.13.1 || >=16.0.0 |
peerDependencies.encoding | ^0.1.0 | — |
صادرات جديدة (7)
| import | export | kind |
|---|---|---|
node-fetch | File | variable |
node-fetch | FormData | variable |
node-fetch | blobFrom | variable |
node-fetch | fileFrom | variable |
node-fetch | blobFromSync | variable |
node-fetch | fileFromSync | variable |
node-fetch | ReferrerPolicy | type |
الأسئلة الشائعة
ما التغييرات غير المتوافقة عند ترقية node-fetch من 2 إلى 3؟
بين node-fetch 2.7.0 و3.3.2 وجد Vigia عدد 6 من الصادرات المحذوفة، و5 من التوقيعات المعدّلة، و33 من أعضاء الأصناف أو الواجهات المحذوفة أو المعدّلة.
ما الذي أصبح موقوفًا في node-fetch 3؟
عُلِّم 3 من الصادرات أو الأعضاء حديثًا على أنها موقوفة في node-fetch 3.3.2.
للوكلاء
GET https://vigia.coredls.cloud/v1/packages/npm/node-fetch/upgrade?from=2.7.0&to=3.3.2