[Lightspeed] Replace node-fetch with global built-in fetch function#2345
[Lightspeed] Replace node-fetch with global built-in fetch function#2345michael-valdron wants to merge 13 commits intoredhat-developer:mainfrom
node-fetch with global built-in fetch function#2345Conversation
|
Important This PR includes changes that affect public-facing API. Please ensure you are adding/updating documentation for new features or behavior. Changed Packages
|
N/A |
2bbc51b to
05ed8f2
Compare
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
e680079 to
78943b2
Compare
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
…ugins root Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
Signed-off-by: Michael Valdron <mvaldron@redhat.com>
78943b2 to
31d1517
Compare
|



User description
ref: https://issues.redhat.com/browse/RHIDP-12033
Replace
node-fetchwith built-infetchReplaces
fetchfunction with built-in one and refactors source to fit the change. This change comes from ADR014 that now recommends the use of the global built-infetchfunction since Node v20.Hey, I just made a Pull Request!
✔️ Checklist
PR Type
Enhancement
Description
Replace
node-fetchdependency with Node.js built-infetchfunctionRefactor response piping to use
Readable.fromWeb()for stream conversionUpdate target Node version to 22 and configure Yarn 4.12
Add early return in error handling to prevent response piping
Remove
node-fetchfrom package dependenciesDiagram Walkthrough
File Walkthrough
router.ts
Replace node-fetch with built-in fetch and refactor pipingworkspaces/lightspeed/plugins/lightspeed-backend/src/service/router.ts
node-fetchimport and use global built-infetchReadableimport fromnode:streammoduleReadable.fromWeb()for pipingcompatibility
fetchResponse.bodybefore pipingblue-donuts-wash.md
Changeset documenting node-fetch replacementworkspaces/lightspeed/.changeset/blue-donuts-wash.md
node-fetchimportReadable.fromWeb().yarnrc.yml
Configure Yarn 4.12 for lightspeed workspaceworkspaces/lightspeed/.yarnrc.yml
package.json
Update Node version and add dependencyworkspaces/lightspeed/package.json
package.jsondependency version ^2.0.1package.json
Remove node-fetch dependencyworkspaces/lightspeed/plugins/lightspeed-backend/package.json
node-fetchversion 2.7.0 from dependencieshttp-proxy-middlewaredependency unchanged