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 unfetch #1450

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

talentlessguy
Copy link

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • Commit messages follow the conventional commits spec
  • If this is a code change: I have written unit tests.
  • If this changes code in a published package: I have run pnpm changeset to create a changeset JSON document appropriate for this change.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

since near-js least supported node version is v20, the polyfill could be safely dropped. React Native, and all edge runtimes all support fetch. There is no need to keep the polyfill anymore.

Test Plan

unit tests

Related issues/PRs

none

Copy link

changeset-bot bot commented Jan 20, 2025

🦋 Changeset detected

Latest commit: 6fc2893

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@near-js/accounts Patch
@near-js/client Patch
@near-js/providers Patch
near-api-js Patch
@near-js/wallet-account Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

text: '',
json: {},
});
fetchMock.once(RPC_URL, 500, '');
Copy link
Author

Choose a reason for hiding this comment

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

for whatever reason typescript says that fetchMock once is not defined, even though it is. I suspsect this is something to do with Jest or incorrectly configured typescript compiler (probably the first)

 FAIL  test/fetch_json_error.test.ts
  ● Test suite failed to run

    test/fetch_json_error.test.ts:16:19 - error TS2339: Property 'once' does not exist on type 'FetchMockJest'.

    16         fetchMock.once(RPC_URL, 500, '');
                         ~~~~
    test/fetch_json_error.test.ts:24:19 - error TS2339: Property 'once' does not exist on type 'FetchMockJest'.

    24         fetchMock.once(RPC_URL, 408, '');
                         ~~~~
    test/fetch_json_error.test.ts:33:19 - error TS2339: Property 'once' does not exist on type 'FetchMockJest'.

    33         fetchMock.once(RPC_URL, 400, '');
                         ~~~~
    test/fetch_json_error.test.ts:41:19 - error TS2339: Property 'once' does not exist on type 'FetchMockJest'.

    41         fetchMock.once(RPC_URL, 503, '');
                         ~~~~

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.

1 participant