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

Conversation

dvc94ch
Copy link
Contributor

@dvc94ch dvc94ch commented Nov 15, 2022

No longer required since nodejs 18 implements the fetch api. Because of this cross-fetch is no longer maintained [0], and node-fetch was giving me some weird "socket hangup" error which is resolved by relying on the nodejs 18 fetch.

@dvc94ch
Copy link
Contributor Author

dvc94ch commented Nov 21, 2022

@fboucquez: do you have time and interest to review the odd PR to rosetta-client-typescript and rosetta-explorer?

@fboucquez
Copy link
Owner

Hey @dvc94ch , sorry for the late response. I'm interested just a bit busy atm. Please bear with me but keep them coming :)

@@ -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

@dvc94ch
Copy link
Contributor Author

dvc94ch commented Nov 23, 2022

so wdyt? can this be merged and a new release made?

@fboucquez fboucquez merged commit 626174f into fboucquez:main Nov 23, 2022
@fboucquez
Copy link
Owner

@dvc94ch , release, Please try version 1.4.13-alpha-c6861d7. It includes the latest openapi spec

@dvc94ch dvc94ch deleted the fetch branch November 24, 2022 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants