-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove dependency on isomorphic-fetch #1616
Remove dependency on isomorphic-fetch #1616
Conversation
Signed-off-by: Yushmanth <pali@pali-reddy.com>
Signed-off-by: Yushmanth <pali@pali-reddy.com>
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## main #1616 +/- ##
=======================================
Coverage 96.01% 96.01%
=======================================
Files 242 242
Lines 7559 7559
Branches 1984 1984
=======================================
Hits 7258 7258
Misses 301 301 ☔ View full report in Codecov by Sentry. |
package.json
Outdated
"dependencies": { | ||
"isomorphic-fetch": "3.0.0" | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was that needed to be moved from devDependencies
to dependencies
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after changing scripts/get-changelog.js there was an error ('isomorphic-fetch' should be listed in the project's dependencies, not devDependencies). So I modified it and it worked fine.
scripts/get-changelog.js
Outdated
@@ -17,11 +17,11 @@ | |||
// This code will generate changelog entries | |||
|
|||
const { readFile } = require('fs'); | |||
const { promisify } = require('util'); | |||
// eslint-disable-next-line import/no-extraneous-dependencies | |||
const fetch = require('isomorphic-fetch'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this dep altogether? It's a polyfill for browsers, but we're using this script only with node.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yurishkuro Yes, it can be removed. @Yushmanth-reddy Here's some instructions to go ahead
// ... (rest of the code)
const { readFile } = require('fs').promises; // Use native fs.promises.readFile
// ... (rest of the code)
// Remove the following line since 'promisify' is not required anymore
// const { promisify } = require('util');
// ... (rest of the code)
// Modify this function to use native fs.promises.readFile
// const readFilePromise = promisify(readFile);
// Instead, use the following line to define readFilePromise
// const readFilePromise = readFile;
// ... (rest of the code)
// No other changes are required in the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, thanks @anshgoyalevil
Signed-off-by: Yushmanth <pali@pali-reddy.com>
It's still not removed |
Signed-off-by: Yushmanth <pali@pali-reddy.com>
Don't know why the unit test is failed but the command "yarn install --frozen-lockfile" is running successfully in my local setup. |
@yurishkuro Should I make any changes? |
Which problem is this PR solving?
Short description of the changes
isomorphic-fetch