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

Update node-fetch and use newer style #97

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

Conversation

ageorgou
Copy link
Contributor

Fixes #96.

  • Moving to fetch-node v3.
  • Removing type declarations as dependency (now bundled).
  • Also requires updating the import style and some package settings to be (more?) compliant with ES6.

This may be useful long-term if more packages move to ES6-only imports.

@ageorgou ageorgou added the technical Related to VSCode, packaging etc rather than usage label Jan 31, 2022
@ageorgou ageorgou requested a review from giordano January 31, 2022 17:35
This doesn't seem to work - the output file is named .cjs
but it uses the wrong (new) import style.
This requires the experimental "node12" setting for "module",
which is only available on nightly builds.
From trying out different combinations, the "moduleResolution" also
needs to be set to "node12" (this is available for tsc >= 4.5).
It seems that this combination also needs a slight change when
importing default modules ("import * as ... from ..."), and this
requires setting the "esModuleInterop" option (or, more
specifically, the "allowSyntheticDefaultImports" option,
which the former sets).
@ageorgou
Copy link
Contributor Author

ageorgou commented Feb 3, 2022

I thought I had this working now (builds, producing ES6 output except for runTests.cjs), but relying on some experimental features which are only available on nightly builds of the TypeScript infrastructure (typescript@next).

However, the tests are still not running and it looks like this may require a cascade of changes. It may be easier to try dynamically importing node-fetch instead (example in their upgrade guide), or sticking with version 2 for now.

@ageorgou ageorgou changed the title Update fetch-node and use newer style Update node-fetch and use newer style Feb 3, 2022
@ageorgou
Copy link
Contributor Author

ageorgou commented Feb 3, 2022

Some more comments:

@ageorgou
Copy link
Contributor Author

ageorgou commented Sep 29, 2022

Labelled as blocked because of the situation above, though I haven't checked progress on the linked issues recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked technical Related to VSCode, packaging etc rather than usage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Upgrade node-fetch to v3
1 participant