Skip to content

@uppy/transloadit mother issue #6264

Description

@qxprakash

@uppy/transloadit is our flagship plugin. We should hold it to a higher standard of code quality and consumer DX than it is at today.

Below is the list of problems I've identified while testing and exploring the plugin. I'll add more
as I find them. goal is to prioritize high-ROI fixes that improve UX first. longer-term issues and breaking
changes can wait.

  • lack of documentation around the using @uppy/transloadit plugin with importFromUploadURLs option also no example demostrating how to use the plugin with this option . I struggled a lot setting this up in my testing.
  • No single "assembly updated" event. Consumers must subscribe to 8+ events and reconstruct the
    AssemblyResponse themselves See console code TestingArea/uppy.tsx 8 event listeners and mergeAssemblies to recreate assembly state which is fragile and produces stale state and lost fields and leads to bugs like this
  • Assembly state lives outside Uppy's store. PR @uppy/transloadit: simplify plugin to always run a single assembly #5158 removed assemblies from TransloaditState (before). Consumers can't use useUppyState and every framework integration has to reinvent the workaround ( discussed in 1st point ) . fixing this would also give users the ability to make custom UI around assembly execution as requested by one of our customers
  • AssemblyWatcher.ts is essentially a dead weight. A 133-line countdown latch for multi-assembly, but now we always allow 1 assembly to be executed at a time so this can be entirely removed or can be made way simpler.
  • #findFile consistently failed in my testing when using the plugin with importFromUploadURLs option
  • per file assembly progress is not accurate at times as explained in the comment here ( not sure how this can be fixed )
  • better comments / documentation in the code explaining the entire purpose of different layers of events , it was difficult for me to understand.
  • just improve the overall code quality of the plugin and simplify things.

Context

@uppy/transloadit went from multi-assembly (with per-file options) to single-assembly in #5158


Current 3-layer event architecture

┌─ Transloadit server [ api2 ]  ───────────────────────────────────┐
│  SSE / polling → assembly_uploading, assembly_executing,         │
│  assembly_execution_progress, assembly_result_finished,          │
│  assembly_upload_meta_data_extracted, assembly_finished, …       │
└──────────────────────────────┬───────────────────────────────────┘
                               ▼
┌─ Assembly.ts (component-emitter) ────────────────────────────────┐
│  `this.status` + #diffStatus → status, executing,                │
│  execution-progress, upload, result, finished, metadata, error   │
└──────────────────────────────┬───────────────────────────────────┘
                               ▼
┌─ Uppy event bus (#connectAssembly re-emits) ─────────────────────┐
│  transloadit:assembly-created / -executing / -error / -cancelled │
│  transloadit:execution-progress / result / complete              │
└──────────────────────────────┬───────────────────────────────────┘
                               ▼
                       Consumer's UI code

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions