Repository navigation
v1.0.4 - TypeScript Improvements & Better Developer Experience
Release v1.0.4 - TypeScript Improvements & Better Developer Experience
π― What's New
This release focuses on improving TypeScript support, fixing autocomplete issues, and enhancing overall developer experience.
β¨ Improvements
π§ TypeScript & Autocomplete
- Fixed
typeprop autocomplete - Now properly suggests all 9 button variants (primary, secondary, tertiary, success, error, warning, info, anchor, danger) in your IDE - Added
sizeprop autocomplete - Get suggestions for 'small', 'medium', 'large' while still allowing custom string values - Improved type safety - Replaced all
anytypes with proper TypeScript types throughout the codebase
π‘οΈ Type Safety Enhancements
- helpers.ts improvements
- Added proper
Record<string, string>types for CSS modules - Made
POSITION_STATESa const assertion for better type inference - Added explicit return types to all functions
- Improved null safety checks
- Added proper
- Button3D.tsx improvements
- Changed
elementprop from complexForwardRefExoticComponentto simplerReact.ElementType - Added strict type for
setCssEndEventparameter:'transition' | 'animation' - Better type definitions for
cssModuleprop
- Changed
π Bug Fixes
- Fixed memory leak in
setCssEndEventhelper function- Added proper cleanup of event listeners
- Implemented
resolvedflag to prevent double resolution - Ensures timeout is cleared when promise resolves early
π¦ Package Optimization
- Added
.npmignore- Extra safeguard to exclude unnecessary files from npm package - Better exports - Added named export alongside default export for
Button3D// Both import styles now work import Button3D from 'react-3d-button' import { Button3D } from 'react-3d-button'
π¨ Developer Experience
- Better IDE support - IntelliSense now shows all available props with proper types
- Improved error messages - TypeScript will catch more issues at compile time
- Consistent type annotations - More maintainable codebase
π Impact
- β No breaking changes - Fully backward compatible
- β
Better autocomplete - IntelliSense works perfectly for
typeandsizeprops - β
Type safety - Eliminated all
anytypes for better compile-time checks - β Memory safety - No more potential event listener leaks
- β
Smaller package - Optimized with
.npmignore
π Migration Guide
No migration needed! This release is 100% backward compatible. Just update:
npm update react-3d-button
# or
yarn upgrade react-3d-button
# or
pnpm update react-3d-buttonπ Full Changelog
Changed
- Improved
typeprop definition - removed genericstringto enable autocomplete - Enhanced
sizeprop with predefined values ('small' | 'medium' | 'large') - Upgraded all helper functions with proper TypeScript types
- Simplified
elementprop type for better compatibility
Fixed
- Memory leak in
setCssEndEventwith proper cleanup - Event listener accumulation in long-running applications
- Null/undefined edge cases in helper functions
Added
.npmignorefile for package size optimization- Named export for
Button3Dcomponent - React type imports in helpers.ts
- Comprehensive type annotations throughout
π Credits
Thanks to everyone using react-3d-button! These improvements were driven by community feedback and usage patterns.
π¦ Install
npm install react-3d-button@1.0.4π Links
- π Documentation
- π¦ npm Package
- π Report Issues
- π¬ Discussions