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

Fixing ProgressEvent type definitions so that Axios doesn't have to depend on lib dom (Fixes #3219) #3228

Closed
wants to merge 3 commits into from

Conversation

jan-molak
Copy link

As noted in #3219, Axios 0.20.0 introduced an implicit dependency on lib dom, which prevents transpilation of pure Node.js projects using Axios (such as Serenity/JS REST).

Instead of making the dependency semi-explicit, as per the suggestion in #3221, I'd like to propose to avoid the dependency altogether by replacing ProgeressEvent type with its structural equivalent:

{ lengthComputable?: boolean; loaded?: number; total?: number }

This change will allow Axios (and any other project using, for that matter) to avoid having to depend on lib dom while still providing type information better than using any.

index.d.ts Outdated Show resolved Hide resolved
Copy link

@sk- sk- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jan-molak, I think it's much better now.

Let's see what the maintainers think about it.

@jasonsaayman any chance to review this PR?

@chinesedfan chinesedfan mentioned this pull request Sep 12, 2020
@chinesedfan
Copy link
Collaborator

Closed in favor of #3237 (comment). Thanks for your contribution all the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants