DatX is an opinionated JS/TS data store. It features support for simple property definition, references to other models and first-class TypeScript support.
isomorphic-fetch is used both in DatX unit tests and in any apps that might use datx on server-side. This lib is 3 years old and I would not consider it safe for production, from security perspective.
In node 20, we have experimental native fetch API and it is stable in 21. We should look into using that for all apps that are running node >=21 (so I guess when we switch to 22 LTS would be the ideal time). I have tried using fetch on some app I am working on that runs datx unit tests in node and it does not work. Simply removing the use of fetch from isomorphic-fetch and using native fetch causes this error:
Note: jsonapi-angular is not affected, because there we connect fetchReference to Angular's HttpClient (which in the background uses native XHR in the browser and xhr2 in node)
Relevant version
Relevant libraries
Breaking change
No
Description
isomorphic-fetch is used both in DatX unit tests and in any apps that might use datx on server-side. This lib is 3 years old and I would not consider it safe for production, from security perspective.
In node 20, we have experimental native
fetch
API and it is stable in 21. We should look into using that for all apps that are running node >=21 (so I guess when we switch to 22 LTS would be the ideal time). I have tried usingfetch
on some app I am working on that runs datx unit tests in node and it does not work. Simply removing the use of fetch fromisomorphic-fetch
and using native fetch causes this error:Note:
jsonapi-angular
is not affected, because there we connectfetchReference
to Angular'sHttpClient
(which in the background uses native XHR in the browser and xhr2 in node)