uppy
uppy copied to clipboard
Complete TypeScript support of our documented APIs
Problem
It would be nice to have our types complete, but we're not quite there yet. I have collected some related issues about missing types:
Uppy
- #4355
- #3083
- #3336
- #4293
- #4090
- #4319
Companion
- [ ] Companion options object #4355
- [ ] Rewrite Companion to Typescript
TypeScript fixes
Update: We are in the process of migrating the codebase to typescript. But in the process we have taken some shortcuts, and in order to improve our type safety we should fix this.
- [ ] Remove most usage of
any
- [ ] Remove most usage of
as
keyword (exceptas const
) - [ ] Remove
noImplicitAny: false
from alltsconfig.json
- [ ] Remove all
@ts-ignore
unless absolutely necessary - [ ] Remove all eslint ignore typescript rules unless absolutely necessary
- [ ] Remove most usage of non-null assertion operator
!
- [ ] maybe use strict typescript config?
- [ ] tsify
private/dev
project
https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html
Solution
Maybe to keep issue count down, we can close all those above issues, and instead use this issue to track missing types. When people report missing types, we can add them here. Then someone who knows typescript well can take a few days to go through all the issues and implement them.
Alternatives
remove typescript support 🙊 (j/k)
I think this is the right place to suggest adding typescript types for @uppy/locales
, right?
I think this is the right place to suggest adding typescript types for
@uppy/locales
, right?
BTW is this happening?
Uppy has been completely rewritten in TS. The new types are available on the @next
tag of all packages.
Uppy has been completely rewritten in TS. The new types are available on the
@next
tag of all packages.
@Murderlon thank you for your quick response. BTW where can I find those packages tagged with @next
? Currently I use @uppy/core: 3.8.0
and @uppy/locales: 3.5.3
Looks like for locales there's v4.0.0-beta.1 and for core v4.0.0-beta.8
All packages, normally installed like npm i @uppy/core @uppy/dashboard
would now just be npm i @uppy/core@next @uppy/dashboard@next
. There is no list of breaking changes or a migration guide but the beta is stable. Use with caution of course.
v4 was just released and all types seem to work fine for me! Took a bit to find the migration guide on GitHub though, as the website did not update for me yet it appears.
Thanks for the migration hint, website still not showing v4 guide
Site didn't update automatically. Taking a look now.