Skip to content
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 cross-fetch dependency. #1

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 12 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rosetta-client-typescript",
"version": "1.4.10-rc1",
"version": "1.5.0",
"description": "Typescript generated client to connect apps with Rosetta nodes.",
"homepage": "https://github.com/fboucquez/rosetta-client-typescript",
"main": "lib/index",
Expand All @@ -21,7 +21,7 @@
},
"license": "Apache-2.0",
"engines": {
"node": ">=12.0.0"
"node": ">=18.0.0"
},
"keywords": [
"rosetta",
Expand All @@ -43,7 +43,6 @@
"version": "echo $npm_package_version"
},
"dependencies": {
"cross-fetch": "^3.1.5",
"encoding": "^0.1.13"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion src/client/RosettaRestClientFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import fetch from 'cross-fetch';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this work on browser and node environments? Is fetch out of the box for node js 18+?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exactly. so the browsers got support for the fetch api and then someone wrote the cross-fetch polyfill, and now node js 18+ supports the api out of the box.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is more information in the release announcement about this:

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

People using old node version could provide a custom fetch implementation

import {
AccountApi,
BlockApi,
Expand Down