v0.3.1 - Type Safety & Code Organization Improvements
π§ 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
anytypes and replaced with proper TypeScript types - β
Fixed
DataTableResizercomponent with properHeader<TData, unknown>andTable<TData>types - β
Fixed
DataTableRowActionswith correctTable<TData>type instead ofany - β
Added
UserRowFromDbinterface for API route type safety - β
Improved
case-utilswithConvertedKeys<T>type for better type inference - β
Enhanced
column-sizingwith proper type guards andunknowninstead ofany
β Enhanced Validation & Error Handling
- β
Added type guards
hasIdAndSize()andhasAccessorKeyAndSize()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
fetchByIdsFnAPI - β 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