updating node-fetch to v3
- Lingua principale
- TypeScript
- Stelle
- 7.8k
- Fork
- 2.2k
- Merge medio
- 22h 28m
- PR unite (30g)
- 6
Descrizione
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();
}
```
Guida per i contributori
Apri la guida per i contributori
Direzione di ricerca
Apri site/src/shortcodes/includecode/fetch.js e ispeziona le righe 17-31, che attualmente usano node-fetch con require. Verifica come viene caricata la versione più recente di node-fetch insieme a globalThis.fetch, quindi verifica che fetchCode recuperi ancora correttamente il testo della risposta della GitHub API.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- javascript, node.js
- Ambito
- web-dev
- Tipo di issue
- Refactoring
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 52/100