updating node-fetch to v3
未关闭
- 主要语言
- TypeScript
- 星标
- 7.8k
- 派生
- 2.2k
- 平均合并
- 22 小时 28 分钟
- 30 天内合并 PR
- 6
描述
https://github.com/angular/angularfire/blob/a26676c69790b9a236dbc08504db705f983bd8fc/site/src/shortcodes/includecode/fetch.js#L17-L31
to use latest node-fetch version you would need to use import instead of require
```js
async function fetchCode(githubPath) {
const fetch = globalThis.fetch || import('node-fetch').then(mod => mod.default);
const githubApiUrl = convertToGitHubApiUrl(githubPath);
const response = await fetch(githubApiUrl);
return response.text();
}
```
贡献指南
调研方向
打开 site/src/shortcodes/includecode/fetch.js 并检查第 17-31 行,这些行目前使用 require 引入 node-fetch。检查最新版本的 node-fetch 如何与 globalThis.fetch 一起加载,然后验证 fetchCode 仍能成功获取 GitHub API 的响应文本。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, node.js
- 领域
- web-dev
- Issue 类型
- 重构
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100