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

@uppy/store-default: refactor to typescript #4785

Merged
merged 3 commits into from
Nov 21, 2023

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Nov 9, 2023

No description provided.

class DefaultStore {
static VERSION = packageJson.version

public state: StateOrStateFragment
Copy link
Member

Choose a reason for hiding this comment

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

I think DefaultStore should accept a generic which makes the state strongly typed. Otherwise we have to type check everything and have no editor intelligence.

class DefaultStore<T extends GenericState = GenericState> {
static VERSION = packageJson.version

public state: T = {} as T
Copy link
Member

Choose a reason for hiding this comment

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

now that I see this type it's actually odd we don't have an initial state passed in the constructor, which would make this type and state correct from the start. Just a thought, not something for now.

@Murderlon Murderlon merged commit 3d46ed0 into transloadit:main Nov 21, 2023
15 checks passed
@aduh95 aduh95 deleted the store-default-ts branch November 21, 2023 13:42
@github-actions github-actions bot mentioned this pull request Nov 24, 2023
github-actions bot added a commit that referenced this pull request Nov 24, 2023
| Package                | Version | Package                | Version |
| ---------------------- | ------- | ---------------------- | ------- |
| @uppy/companion-client |   3.6.1 | @uppy/store-default    |   3.1.0 |
| @uppy/locales          |   3.5.0 | uppy                   |  3.20.0 |

- meta: uppy CDN: Export UIPlugin and BasePlugin (Artur Paikin / #4774)
- @uppy/locales: Add missing translations to de_DE (Leonhard Melzer / #4800)
- @uppy/store-default: refactor to typescript (Antoine du Hamel / #4785)
- meta: improve js2ts script (Antoine du Hamel / #4786)
- @uppy/companion-client: fix log type error (Mikael Finstad / #4766)
- @uppy/companion-client: revert breaking change (Antoine du Hamel / #4801)
- @uppy/locales: use TypeScript for source files (Antoine du Hamel / #4779)
- meta: migrate AWS SDK v2 to v3 in `bin/uploadcdn` (Trivikram Kamat / #4776)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants