Fixing node types #3237
Fixing node types #3237
Conversation
The `ProgressEvent` type comes from the `DOM` lib. This is typically unwanted when using axios in a NodeJS environment.
@jasonsaayman Among related PRs, I prefer this one, which simply reverts the type to any. And users can assert the type by themselves.
Similar debates are for |
I think @chinesedfan is right, simpler is better sometimes. |
Although these types currently don’t conflict, they might in the future. For a practical example, the types of TypeScript should help by providing type information. If you’re working on a TypeScript project and somehow one types Also a project that claims to work in a Node environment, shouldn’ require the user to specify they’re using a DOM environment, which is the current situation with Axios. |
@chinesedfan I like this solution most too, do you think we should add this one into 0.20.1? I am happy to merge it and close the other PR's |
@jasonsaayman Sure. Friendly remind that breaking changes should be released in 0.21, instead of 0.20.1. To make things simple, we can release this PR in 0.21 together, though it looks like not breaking. |
This is non breaking. |
|
While we wait for this fix to get published, create a /**
* Fix for axios while we wait for ^0.2.1 to be published
* merge: https://github.com/axios/axios/commit/b7e954eba3911874575ed241ec2ec38ff8af21bb
* issue: https://github.com/axios/axios/issues/3219
*/
interface ProgressEvent {} |
The
ProgressEvent
type comes from theDOM
lib. This is typically unwanted when using axios in a NodeJS environment.Fixes #3219