Skip to content

Conversation

@designcode
Copy link
Collaborator

@designcode designcode commented Dec 1, 2025

Note

Introduces the @tigrisdata/react package providing a drag‑and‑drop Uploader component, a useUpload hook with multipart/progress support, styles, tests, and build/release configs; updates root README and adds build script.

  • New Package: @tigrisdata/react
    • Components/Hooks: Uploader (drag-and-drop, multiple, accept/maxSize, progress/status, multipart/partSize/threshold, keyboard accessible) and useUpload (single/multi upload, progress callbacks, state map, reset).
    • Exports/Types/Styles: Public API in src/index.ts, typed options/returns, default CSS (styles.css) with tigris- classes.
    • Testing/Build/Release: Vitest + Testing Library tests, tsup build, tsconfig, vitest.config.ts, tsup.config.ts, and release.config.cjs.
    • Docs: README with usage, props, styling guide, and server setup example.
  • Repo Updates:
    • Add build:react script in root package.json.
    • Update root README.md to list @tigrisdata/react.

Written by Cursor Bugbot for commit c41ab3e. This will update automatically on new commits. Configure here.

@greptile-apps
Copy link

greptile-apps bot commented Dec 1, 2025

Greptile Overview

Greptile Summary

This PR introduces a new @tigrisdata/react package that provides React components and hooks for file uploads to Tigris Storage. The implementation includes:

  • useUpload hook: Core functionality for file uploads with progress tracking, multipart upload support, and error handling
  • Uploader component: Drag-and-drop file uploader with accessibility features (keyboard navigation, ARIA attributes)
  • Comprehensive test coverage: 209 test lines for the hook and 380 test lines for the component, covering success/error scenarios, drag-and-drop, multipart uploads, and accessibility
  • Well-documented API: Clear README with usage examples, prop documentation, and styling guide
  • Proper packaging: Dual ESM/CJS exports, TypeScript declarations, and CSS bundling

The code quality is high with:

  • Proper error handling that converts non-Error objects to Error instances
  • Correct ES2020 compatibility (avoids newer Error features like cause field)
  • Clean separation of concerns between hook logic and component UI
  • Thorough test coverage including edge cases
  • Accessible UI implementation with keyboard support and ARIA attributes

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is well-architected with comprehensive test coverage (589 lines of tests), proper error handling, accessibility support, and follows best practices. The code correctly targets ES2020 without using incompatible features, has thorough documentation, and includes both unit tests and component tests covering edge cases.
  • No files require special attention

Important Files Changed

File Analysis

Filename Score Overview
packages/react/src/lib/hooks/useUpload.ts 5/5 Core React hook for file uploads with progress tracking, multipart support, and error handling
packages/react/src/lib/components/Uploader.tsx 5/5 Drag-and-drop file uploader component with accessibility features and file validation
packages/react/src/lib/types/index.ts 5/5 TypeScript type definitions for uploader props, hook options, and upload state management
packages/react/src/lib/hooks/useUpload.test.ts 5/5 Comprehensive test suite for useUpload hook covering success, error, progress, and multipart scenarios
packages/react/src/lib/components/Uploader.test.tsx 5/5 Thorough component tests including drag-drop, keyboard accessibility, file validation, and state rendering
packages/react/package.json 5/5 Package configuration with proper peer dependencies, dual ESM/CJS exports, and build scripts
packages/react/README.md 5/5 Clear documentation with usage examples, API reference, styling guide, and server setup instructions

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

16 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@designcode designcode merged commit f7832ce into main Dec 2, 2025
2 checks passed
@designcode designcode deleted the ui/react-components branch December 2, 2025 10:51
@github-actions
Copy link

github-actions bot commented Dec 2, 2025

🎉 This PR is included in version 1.0.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

🎉 This PR is included in version 1.0.7 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

@github-actions
Copy link

github-actions bot commented Dec 2, 2025

🎉 This PR is included in version 2.10.0 🎉

The release is available on npm package (@latest dist-tag)

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants