Export AssemblyInstructionsInput type from @uppy/transloadit (#6184)
The
AssemblyInstructionsInputtype from@transloadit/typesis now publicly exported from@uppy/transloadit, allowing consumers to type their assembly parameters without importing from the external package.Changes
- Re-exported
AssemblyInstructionsInputtype inpackages/@uppy/transloadit/src/index.tsUsage
import type { AssemblyInstructionsInput } from '@uppy/transloadit' const params: AssemblyInstructionsInput = { steps: { encode: { robot: '/video/encode', use: ':original', preset: 'mp4', }, }, }The type was already imported internally and aliased as
AssemblyParameters. This change makes it available to plugin consumers.Original prompt
Make the AssemblyInstructionsInput type available from the @uppy/transloadit package by re-exporting it from packages/@uppy/transloadit/src/index.ts.
Background
- The Transloadit plugin imports the type AssemblyInstructionsInput from the external package @transloadit/types and aliases it as AssemblyParameters in packages/@uppy/transloadit/src/index.ts.
- Consumers of the @uppy/transloadit package need direct access to the AssemblyInstructionsInput type but it is not currently exported from the plugin package.
Change requested
- Add a type re-export so that consumers can import AssemblyInstructionsInput from the transloadit plugin package, e.g. import type { AssemblyInstructionsInput } from ‘@uppy/transloadit’
Files to change
- packages/@uppy/transloadit/src/index.ts
- Add the following export alongside the other package exports (near the end of the module where other exports live):
url=https://github.com/transloadit/uppy/blob/main/packages/@uppy/transloadit/src/index.ts -export { COMPANION_URL, COMPANION_ALLOWED_HOSTS } +export { COMPANION_URL, COMPANION_ALLOWED_HOSTS } + +// Re-export type from @transloadit/types so callers can import it from the plugin package. +export type { AssemblyInstructionsInput } from '@transloadit/types'Notes
- This is a purely type-only export and should be erased at compile time; it does not add runtime code.
- No other behavior or API surface should change.
Please create a branch, apply the change, and open a pull request with a descriptive title and a short description of the change. Run TypeScript build checks if available.
This pull request was created from Copilot chat.
💬 We’d love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
Co-authored-by: copilot-swe-agent[bot] 198982749+Copilot@users.noreply.github.com Co-authored-by: mifi 402547+mifi@users.noreply.github.com Co-authored-by: Mikael Finstad finstaden@gmail.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Uppy
Uppy is a sleek, modular JavaScript file uploader that integrates seamlessly with any application. It’s fast, has a comprehensible API and lets you worry about more important problems than building a file uploader.
Read the docs | Try Uppy
Uppy is being developed by the folks at Transloadit, a versatile API to handle any file in your app.
Example
Code used in the above example:
Try it online or read the docs for more details on how to use Uppy and its plugins.
Integrations
Uppy has first-class support for plain JS/HTML, React, Svelte, Vue, and Angular.
For the supported frameworks (except Angular) Uppy offers three ways to build user interfaces:
<Dashboard />. The downside is that you can’t customize the UI.Features
Installation
Add CSS uppy.min.css, either to your HTML page’s
<head>or include in JS, if your bundler of choice supports it.Alternatively, you can also use a pre-built bundle from Transloadit’s CDN: Smart CDN. In that case
Uppywill attach itself to the globalwindow.Uppyobject.Documentation
Plugins
UI Elements
Dashboard— universal UI with previews, progress bars, metadata editor and all the cool stuff. Required for most UI plugins like Webcam and InstagramSources
Drag & Drop— plain drag and drop areaFile Input— even plainer “select files” buttonWebcam— snap and record those selfies 📷Google Drive— import files from Google DriveDropbox— import files from DropboxBox— import files from BoxInstagram— import images and videos from InstagramFacebook— import images and videos from FacebookOneDrive— import files from Microsoft OneDriveImport From URL— import direct URLs from anywhere on the webThe ⓒ mark means that
@uppy/companion, a server-side component, is needed for a plugin to work.Destinations
Tus— resumable uploads via the open tus standardXHR Upload— regular uploads for any backend out there (like Apache, Nginx)AWS S3— plain upload to AWS S3 or compatible servicesFile Processing
Transloadit— support for Transloadit’s robust file uploading and encoding backendMiscellaneous
Golden Retriever— restores files after a browser crash, like it’s nothingThumbnail Generator— generates image previews (included by default withDashboard)Form— collects metadata from<form>right before an Uppy upload, then optionally appends results back to the formBrowser Support
We aim to support recent versions of Chrome, Firefox, and Safari.
FAQ
Why not use
<input type="file">?Having no JavaScript beats having a lot of it, so that’s a fair question! Running an uploading & encoding business for ten years though we found that in cases, the file input leaves some to be desired:
Not all apps need all these features. An
<input type="file">is fine in many situations. But these were a few things that our customers hit / asked about enough to spark us to develop Uppy.Why is all this goodness free?
Transloadit’s team is small and we have a shared ambition to make a living from open source. By giving away projects like tus.io and Uppy, we’re hoping to advance the state of the art, make life a tiny little bit better for everyone and in doing so have rewarding jobs and get some eyes on our commercial service: a content ingestion & processing platform.
Our thinking is that if only a fraction of our open source userbase can see the appeal of hosted versions straight from the source, that could already be enough to sustain our work. So far this is working out! We’re able to dedicate 80% of our time to open source and haven’t gone bankrupt yet. :D
Does Uppy support S3 uploads?
Yes, please check out the docs for more information.
Can I use Uppy with Rails/Node.js/Go/PHP?
Yes, whatever you want on the backend will work with
@uppy/xhr-uploadplugin, since it only does aPOSTorPUTrequest. Here’s a PHP backend example.If you want resumability with the Tus plugin, use one of the tus server implementations 👌🏼
And you’ll need
@uppy/companionif you’d like your users to be able to pick files from Instagram, Google Drive, Dropbox or via direct URLs (with more services coming).Contributions are welcome
.github/CONTRIBUTING.mdCHANGELOG.mdUsed by
Uppy is used by: Photobox, Issuu, Law Insider, Cool Tabs, Soundoff, Scrumi, Crive and others.
Use Uppy in your project? Let us know!
Contributors
License
The MIT License.