Repository navigation
feat(upload-input-v4): direct-to-storage uploads with Uppy - #363
caseylocker wants to merge 8 commits into
Conversation
… abandoned tickets - Retry calls onUploadStart again, as V3's re-add did, so a parent that disables Save while uploading stays disabled during the retry. - A file API error with no message of its own shows the translated "Upload failed" text instead of "File API returned HTTP <status>". - Retrying a failed single PUT DELETEs the previous ticket first: the dropped PUT may have stored its object, and nothing else purges it. - List UploadInputV4 with its third-party deps in the components barrel.
…emoved A file removed and added again keeps its Uppy id, so the first attempt's hash could land on the new one: a stale failure marked it errored and it never uploaded. Each hash now applies its result only while it is still the file's current attempt.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟡 Changes recommended
The UMD build externalizes ESM-only Uppy packages through CommonJS calls, preventing direct CommonJS and SSR loading.
2 open findings
What changed in this PR
Adds UploadInputV4 for direct-to-storage uploads using Uppy and presigned URLs.
Changes:
- Implements single and multipart uploads, retries, cancellation, and cleanup.
- Adds the V4 UI with previews, progress, errors, and tests.
- Adds Uppy dependencies and build/Jest configuration.
| File | Description |
|---|---|
package.json |
Adds Uppy dependencies and Jest transforms. |
yarn.lock |
Locks new dependency graph. |
webpack.common.js |
Adds the V4 build entry. |
src/components/index.js |
Documents the optional V4 export. |
upload-input-v4/index.js |
Implements the component UI. |
upload-input-v4/index.less |
Styles the upload area. |
upload-input-v4/uppy-client.js |
Implements direct-upload orchestration. |
__tests__/uppy-client.test.js |
Tests upload transport behavior. |
__tests__/upload-input-v4.test.js |
Tests component behavior. |
__fixtures__/fake-file-api.js |
Provides fake upload transports. |
__fixtures__/jsdom-polyfills.js |
Adds required test polyfills. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
santipalenque
left a comment
There was a problem hiding this comment.
just a missing translation otherwise looks good
| // Per file: a rejection here would fail the batch with no file error set, and | ||
| // retry would find nothing. An errored file is skipped by the uploader and | ||
| // re-hashed on retry. | ||
| if (hashing.get(fileID) === attempt) failFile(fileID, err, 'Could not hash file: '); |
… read A failed hash showed an untranslated 'Could not hash file: ' followed by the raw FileReader error. The client now tags the failure with a code and the component maps it to upload_input_v3.hash_failed, like its other transport failures.
The hash failure now carries its code on an error of its own, since a caught DOMException cannot take one, and resolveErrorMessage checks that code before the TypeError and message branches can claim it.


ref: https://app.clickup.com/t/86bcgnf86
What
Adds
UploadInputV4, published asopenstack-uicore-foundation/lib/components/inputs/upload-input-v4. It takes the same props asUploadInputV3, but files go straight to Spaces through presigned URLs from file-upload-api instead of being chunked through the API.POST /uploads/single/{id}/complete.DELETE /uploads/{id}for any upload that was not delivered. A delivered upload is never deleted.onUploadCompleteunchanged, so consumers handle it the same way as V3's.V3 is untouched, and V4 is not exported from
components/index.js(only a commented line listing its dependencies, like V3's).Dependencies
@uppy/core@^5.2.0and@uppy/aws-s3@^5.1.0are new peer dependencies, kept out of the bundle likedropzone. A consumer that imports V4 needs both installed. Pinned to 5.x because that is the version the cancellation and retry behaviour was verified against.Jest gets a
transformIgnorePatternsentry because Uppy ships ESM only. The V4 tests also polyfillTextEncoder, which jsdom lacks.Depends on
ETag(done on dev and prod).Tests
87 new tests run real Uppy against a fake file API: single and multipart flows, retries, removal and unmount at each stage, auth failures, and V3's component suite ported to V4. Full suite: 127 suites, 1174 tests passing.
yarn buildpasses and the V4 entryrequires Uppy rather than bundling it.No version bump; that is left for the release.