Skip to content

v0.3.1 - Type Safety & Code Organization Improvements

Choose a tag to compare

@jacksonkasi1 jacksonkasi1 released this 01 Oct 22:05
· 91 commits to main since this release

πŸ”§ Type Safety & Code Organization Improvements

This release focuses on improving type safety, validation, and code organization across the data table component.

πŸ”§ Type Safety Improvements

  • βœ… Removed all any types and replaced with proper TypeScript types
  • βœ… Fixed DataTableResizer component with proper Header<TData, unknown> and Table<TData> types
  • βœ… Fixed DataTableRowActions with correct Table<TData> type instead of any
  • βœ… Added UserRowFromDb interface for API route type safety
  • βœ… Improved case-utils with ConvertedKeys<T> type for better type inference
  • βœ… Enhanced column-sizing with proper type guards and unknown instead of any

βœ… Enhanced Validation & Error Handling

  • βœ… Added type guards hasIdAndSize() and hasAccessorKeyAndSize() for column sizing
  • βœ… Implemented isValidColumnSizing() validation for localStorage data
  • βœ… Enhanced URL state validation with proper JSON structure checks
  • βœ… Added empty array checks before accessing array elements in data export
  • βœ… Improved primitive value detection before array sorting in deep-utils

πŸ†” ID Handling Improvements

  • βœ… Unified internal ID storage to use strings for consistency
  • βœ… Smart type detection for numeric vs string IDs
  • βœ… Full support for UUID, Nano ID, and custom string ID formats
  • βœ… Proper type conversion when calling fetchByIdsFn API
  • βœ… Safe parsing with NaN filtering for numeric conversions

πŸ’Ύ localStorage Safety

  • βœ… Validates parsed JSON structure before use
  • βœ… Checks array and object types with proper type guards
  • βœ… Cleans up corrupted data automatically
  • βœ… Comprehensive error handling with try-catch blocks

πŸ“ Code Organization

  • βœ… Applied import organization style guide across all modified files
  • βœ… Proper categorization: types β†’ core packages β†’ components β†’ utils
  • βœ… Lowercase category comments following style guidelines
  • βœ… Consistent spacing between import sections

πŸ“Š Build & Test Results

  • βœ… TypeScript compilation: PASSED (0 errors)
  • βœ… Next.js build: PASSED (production ready)
  • βœ… ESLint: PASSED (0 warnings, 0 errors)

πŸš€ What's Changed

Full Changelog: v0.3.0...v0.3.1

πŸ“¦ Installation

npm install

πŸ”— Links