Commit graph

27 commits

Author SHA1 Message Date
Prakash
79e6460a6c
Make Generics Optional in uppy.getPlugin (#6057)
fixes #6024.

### Problem
- `getPlugin()` defaults to `UnknownPlugin`, so methods like `openModal`
are not visible , since core is not aware of that plugin type

### Proposed change
- Introduce a types-only registry in core:
- `export interface PluginTypeRegistry<M extends Meta, B extends Body>
{}`
- Overload `getPlugin` to return a precise type when the id is a known
key of the registry.
- add `Dashboard` to  PluginTypeRegistry through module augmentation:
  - `'Dashboard': Dashboard<M, B>`.
- When a project imports from `@uppy/dashboard`, its module augmentation
extends PluginTypeRegistry, adding the correct type into it
- I've added Tests , kept them in a separate file so it's easier to
review , once this approach gets approved I'll add them to
`Uppy.test.ts`

Once this PR gets a positive review I'll add this for other plugins ,
currently only added for `@uppy/dashboard`

**Build with Local tarball can be checked here** 


https://stackblitz.com/~/github.com/qxprakash/uppy-type-test?file=type_test.ts
2025-11-17 18:18:54 +05:30
Prakash
d301c01d6a
@uppy/utils: update export maps (#5900)
- cleanup `@uppy/utils ` removed unused / redundant modules .
- migrated modules and tests from `.js` to `.ts`
- removed all the nested export paths
- updated `@uppy/utils` import paths for all packages
- `@uppy/angular` is still failing while running`yarn build` , I'm
looking into it.

---------

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2025-08-19 12:25:27 +02:00
Merlijn Vos
78299475ae
Migrate from Eslint/Prettier/Stylelint to Biome (#5794) 2025-07-01 14:55:41 +02:00
Merlijn Vos
d408570373
From Babel to TS (#5792) 2025-06-30 16:12:26 +02:00
Merlijn Vos
6e65cd8c51
Import types consistently from @uppy/core (#5589)
* Import types consistently from @uppy/core

* Add new eslint rule

* Clean up exports
2025-01-09 11:03:43 +01:00
Antoine du Hamel
cb4e5c7f77
Merge stable branch 2024-07-03 00:55:59 +02:00
Merlijn Vos
03a4cd854a
@uppy/form: do not emit 'submit' event more than once (#5299)
Instead of using `requestSubmit` from the `'submit'` event handler (which was causing a loop), we can call `submit()` after checking `reportValidity` to get the same result without re-emitting the event.
2024-07-02 17:52:17 +02:00
Merlijn Vos
88d508f7bf
TS strict mode (#5258)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
2024-06-20 16:54:10 +02:00
Antoine du Hamel
7942976218
@uppy/form: move internal property to private field (#5214) 2024-06-03 11:59:10 +02:00
Merlijn Vos
5d407087d4
@uppy/form: fix submitOnSuccess and triggerUploadOnSubmit combination (#5058) 2024-04-22 14:59:36 +02:00
Merlijn Vos
10c085301a
@uppy/form: migrate to TS (#4937)
Co-authored-by: Antoine du Hamel <antoine@transloadit.com>
Co-authored-by: Mikael Finstad <finstaden@gmail.com>
2024-02-28 10:36:19 +01:00
Merlijn Vos
7694ead67e
@uppy/form: use requestSubmit (#4852) 2024-01-04 10:44:35 +01:00
Antoine du Hamel
e65db58b29
@uppy/utils: use exports map (#3985) 2022-08-16 15:40:35 +02:00
Antoine du Hamel
7a0e893b9d
@uppy/form: refactor to ESM (#3654) 2022-04-21 16:51:54 +02:00
Antoine du Hamel
d69031524c
@uppy/core: move Uppy class to its own module (#3225)
* @uppy/core: move `Uppy` class to its own module

Fixes: https://github.com/transloadit/uppy/issues/3220

* Rename snapshot file

* Update docs

* Update website/src/_posts/2021-08-2.0.md

Co-authored-by: Merlijn Vos <merlijn@soverin.net>

* Update migration guide

* Do not bundle preact with non-UI plugin packages

Co-authored-by: Merlijn Vos <merlijn@soverin.net>
2021-09-28 19:04:33 +02:00
Artur Paikin
f455ea59e8
deprecate multipleResults option (#2996) 2021-07-08 16:12:24 +01:00
Merlijn Vos
ecec3d3213
Split Plugin into BasePlugin and extended UIPlugin (#2944) 2021-06-18 13:23:16 +02:00
Kevin van Zonneveld
764c2ccada
Update Linter (#2796)
* relocate .vscode

* Switch to transloadit linter

* Update .eslintrc.json

* autofix code

* unlink and install eslint-config-transloadit@1.1.1

* Change 0 to "off"

* Don't change 'use strict'

* Do not vertically align

* disable key-spacing

* add import/no-extraneous-dependencies per package

* add more react/a11y warnings

* Revert "autofix code"

This reverts commit 14c8a8cde8.

* add import/no-extraneous-dependencies per example and main package

* autofix code (2)

* Allow devDependencies in ./bin

* Change import/no-extraneous-dependencies to warn again

* upgrade linter

* Set import/no-extraneous-dependencies to warn
2021-03-15 16:25:17 +00:00
Renée Kooi
be66c47deb
Actually check types (#1918)
* types: stronger typings

* Remove remaining `declare module` things for uppy.use

* Format types standard-style-like

* Add `target` properties to plugin typings

* Add type for `replaceTargetContent` option

* xhr-upload: allow lowercase method

* opt in to stricter typechecks

* use the strictly typed version in all typings tests

* endtoend: use strict types in typescript test

* Add some comments to the typings file so IDEs will warn about untyped use()

* informer: remove obsolete option from typings

* react: generate prop types based on actual options types

* react: update types

* react: fix import in typings test

* companion-client: add `pluginId` property to ProviderOptions type

Co-Authored-By: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>

* core: remove some `any` types

* *: add locale string types

* *: generate locale typings

* core: fix LocaleStrings<> type

* dashboard: add locale string type tests

* tus: inherit options typings from tus-js-client

* transloadit: add missing options types

* ci: do the required build steps before testing typings

* Support TokenStorage in types, add `title?: string` options

* form: update typings

* types: put TokenStorage type in dependents

* Document Uppy.StrictTypes

* if we pin at least we should use the latest

* Allow document.querySelector

I think it's a eslint-plugin-compat bug that it's marking querySelector
as not available in Android Chrome 78.

Co-authored-by: Ifedapo .A. Olarewaju <ifedapoolarewaju@gmail.com>
2020-02-12 16:22:09 +01:00
Renée Kooi
aee4dee171
fixes flagged by LGTM.com (#1876)
* aws-s3-multipart: fix typo

This was doing a weird thing and probably causing more cancellation
bugs.

Flagged by lgtm.com

* form: fix comparison

* companion-client: fix use strict directive
2019-10-11 13:42:30 +02:00
Artur Paikin
45567c0b13
Try/catch JSON.parse, since the prev result can be empty or not json; set updatedResult to an empty array if it’s not an array (#1800) 2019-08-30 14:57:41 +03:00
Artur Paikin
ae49cefd93
form: exclude own metadata, append result instead of overwriting (#1686)
* exclude meta the the Form plugin itself has added

* append new result to the previous one, instead of overwriting it

* add `replaceResultInFormWithNew` — replace result input value by default, with option to append

* talk about `replaceResultInFormWithNew`

* replaceResultInFormWithNew --> multipleResults
2019-07-03 18:21:06 +03:00
Renée Kooi
e6c52f7681
Use opts.id as the plugin ID for all plugins, fixes #1674 2019-06-19 09:58:14 +02:00
Renée Kooi
980210f76c
Add VERSION properties to all plugins.
And remove the proposal-object-rest-spread plugin because it is built
into preset-env now.
2019-05-27 16:53:47 +02:00
Renée Kooi
59bfbce94a
form: Disable form submit buttons while upload is in progress with triggerUploadOnSubmit 2018-11-15 13:19:16 +01:00
Renée Kooi
72689d01ac
Export Plugin class from @uppy/core. 2018-06-28 12:20:21 +02:00
Renée Kooi
f5bd557e65
Move Form to @uppy/form. 2018-06-14 16:31:19 +02:00