-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Fetch API definitions #4948
Comments
Reference the current DefinitelyTyped definitions. |
Yes, when an API is standardized/well supported we'll make sure it's in lib.d.ts (or whatever appropriate sub component). We generally generate these libraries from spec's so we don't need issues per new API. In the meantime if you're hoping for improvements to the DefinitelyTyped definitions that's something we should track with an issue over there. |
@danquirk - thanks, we're raising a PR to fix up one deviation from the spec. |
Still not supported ? |
Now that |
PRs welcomed. You can find more information about contributing lib.d.ts fixes at https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md#contributing-libdts-fixes. |
There are already typings for it on DefinitelyTyped. Hopefully those could be moved to lib, then we could deprecate the |
All of Web IDL definitions are here: There is also this tool for converting Web IDL to TSD files: https://github.com/RicoP/idl2typings Anyone wants to actually do it? |
Be the PR you want to see in the world :) |
The PR would just be to add the fetch typings to lib.d.ts right? |
@quantuminformation pr already at #12493 🌹 |
@basarat roger that! |
This should be fixed by #13856 |
@mhegazy Which version of TS is this expected to land in? And is there anything special to do in |
As noted in the milestone, |
Hi, im not pretty sure what im' writing in correct topic, but i guess i have related issue.
i can't remove one of such definitions because they are dependencies from third part packages and they are installed (@types/isomorphic-fetch, @types/whatwg-fetch) own td's. ps. i used some packages from MS to create webparts with react and apollo-client to connect to graphql. Please does anyone know how to resolve this conflict? |
If there are other dependencies, then you need them to publish a new version before using TS 2.2 |
All this errors were appeared after install |
we need to fix isomorphic-fetch first, then ask apollo-client to update their package. |
@mhegazy I don't see an mention of |
Yes. i have not fully updated the docs for the release yet. hopefully will do this this week. I still need to add the breaking changes, finish the what's new, and clean up the roadmap :) |
Documentation added to breaking changes page: https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#changes-to-dom-apis-in-the-standard-library |
@mhegazy - Sorry, just to be clear -- if I'm working on a nodejs app, do I still need any kind of fetch polyfill, or does TypeScript provide it regardless of environment? What are the correct steps in every scenario and do I still need any third party libraries, or is TypeScript fixing fetch "once and for all"?? |
The fetch API is included as part of the DOM API, so it is part of If you are using node, you are not interested in the DOM, so my recommendation is to use |
@atrauzzi These are typings only, there is no polyfill included for fetch just like there is no polyfill included for Promise. There are very few polyfills included with typescript: class extends and async/await are really the only two I can think of. I suspect we won't see many more polyfills included in the future. |
So when are we expecting @types/isomorphic-fetch to be patched to work with the new typings? |
|
It would be nice if the updated typings have kept the parity with the Specifically the typed version of |
see microsoft/TypeScript#4948 for more details
see microsoft/TypeScript#4948 for more details
Apologies if this is mentioned elsewhere, but I couldn't find an issue/PR that mentions it.
The Fetch API is still experimental, but I assume its definitions will make their way into TypeScript core at some point?
The text was updated successfully, but these errors were encountered: