Vermonster / fhir-kit-client

Node.js FHIR client library
MIT License
173 stars 37 forks source link

Conditionally import cross-fetch with polyfill - Issue #197 #198

Open taylorkle opened 1 year ago

taylorkle commented 1 year ago

Allow developers to conditionally import the optional polyfill with the cross-fetch package to address issue 197 https://github.com/Vermonster/fhir-kit-client/issues/197

It is unclear if the entire package cross-fetch with ponyfill caused the issue or the use of polyfill alone, but we could consider testing with disabled polyfill first. The polyfill is only applied in the absence of global fetch.

jpowers commented 1 year ago

Looks good and will work, but I think we could probably just remove the polyfill and allow users who need it to load it. This blog post suggests that as well.

https://www.builder.io/blog/stop-polyfilling-fetch-in-your-npm-package