Skip to content

Latest commit

 

History

History
152 lines (105 loc) · 8.83 KB

File metadata and controls

152 lines (105 loc) · 8.83 KB

@edwardloopez/react-native-coachmark

0.5.2

Patch Changes

  • 1e18f04 Thanks @edwardloopez! - Fix Android vertical offset when using navigation buttons instead of gestures

0.5.2-beta.0

Patch Changes

  • #19 f1cf1fd Thanks @christian-jayme! - Fix Android vertical offset when using navigation buttons instead of gestures. Modal now uses statusBarTranslucent and screen dimensions on Android to align coachmark holes correctly with target elements.

0.5.1

Patch Changes

0.5.0

Minor Changes

  • #12 4b37583 Thanks @edwardloopez! - This release focuses on performance optimizations, better error handling, and improved developer experience.

    🚀 Performance Improvements

    Component Optimization

    • Memoization: Added React.memo to CustomTooltipWrapper to prevent unnecessary re-renders
    • Hook Extraction: Refactored CoachmarkOverlay (282 → 150 lines) by extracting custom hooks:
      • useTourMeasurement: Handles anchor measurement and positioning logic
      • useTooltipPosition: Computes optimal tooltip placement
      • useOrientationChange: Manages device orientation changes
    • Callback Memoization: Optimized callbacks with useCallback and useMemo to reduce re-render cycles
    • Result: ~60-80% reduction in re-renders during tours

    Orientation Support

    • Auto-remeasure: Tours now automatically re-measure and reposition when device orientation changes
    • Seamless UX: No more misaligned highlights after screen rotation
    • Platform Support: Works on iOS, Android, and web

    🛡️ Stability Enhancements

    Error Boundary

    • New Component: CoachmarkErrorBoundary catches errors in custom tooltip renderers
    • Graceful Degradation: Displays user-friendly error UI instead of crashing the app
    • Developer Feedback: Logs detailed error information to console for debugging
    • Customizable: Supports custom fallback components via fallback prop
    • Export: Now exported from main index for direct usage

    TypeScript Strictness

    • Fixed Context Type: Removed unsafe null as any cast in CoachmarkContext
    • Proper Error Handling: useCoachmarkContext now throws descriptive error when used outside provider
    • Type Safety: Full type inference without type assertions
    • Better DX: Clear error messages guide developers to proper usage

    📊 Test Coverage

    • Added comprehensive tests for new functionality
    • Coverage: Maintained 96.92% statement coverage (90 tests passing)
    • New test suites:
      • CoachmarkErrorBoundary.test.tsx: Error handling scenarios
      • useOrientationChange.test.ts: Orientation change detection
      • useCoachmarkContext.test.tsx: Context provider validation

0.4.5

Patch Changes

  • 5b8eb21 Thanks @edwardloopez! - Fix broken npm package by removing path aliases from source code.

    Breaking Issue Fixed:

    • Version 0.4.4 was broken due to unresolved path aliases (@core, @ui, @utils, etc.) in the published package
    • Metro bundler couldn't resolve these aliases in consuming projects, causing "Unable to resolve module" errors

    Changes:

    • Replaced all path alias imports with relative imports throughout the codebase
    • Removed babel-plugin-module-resolver and eslint-import-resolver-babel-module dependencies
    • Cleaned up path alias configuration from tsconfig.json, babel.config.js, and eslint.config.mjs
    • Verified compiled output (lib/) now contains only relative imports

    Impact:

    • Package now works correctly in all React Native projects (Expo, bare workflow, Snack)
    • No breaking changes for consumers - the public API remains identical
    • Source code maintainability: Uses standard relative imports (industry best practice for published libraries)

0.4.4

Patch Changes

  • #9 e7cc340 Thanks @edwardloopez! - ## Documentation and Configuration Improvements
    • Documentation: Reorganized README into modular structure with dedicated docs folder (ADVANCED_USAGE.md, EXAMPLES.md, ACCESSIBILITY.md, BEST_PRACTICES.md)
    • API Reference: Converted props and options to table format for better readability
    • Web Support: Fixed findNodeHandle and ScrollView compatibility issues on web platform
    • Import Organization: Added ESLint import ordering with React/React Native prioritization
    • Path Aliases: Configured TypeScript and Babel path aliases (@core, @ui, @utils, @anchors) for cleaner imports
    • Build Configuration: Added cardStyle: { flex: 1 } to Stack Navigator for proper web layout
    • Git Hooks: Enhanced lefthook to auto-fix ESLint issues on pre-commit

0.4.3

Patch Changes

  • #7 3a041f6 Thanks @edwardloopez! - Comprehensive documentation improvements and code cleanup:

    Documentation Enhancements:

    • Added detailed Auto-Scroll Features section with ScrollView/FlatList integration examples
    • Documented all lifecycle hooks (onBeforeEnter, onBeforeScroll, onEnter, onExit) with use cases
    • Complete theme customization reference including all properties and easing functions
    • Added ScrollView integration guide with practical examples
    • Added 3 comprehensive real-world examples (auto-scroll, conditional steps, custom theme)
    • Updated features list to highlight auto-scroll and lifecycle hooks

    Code Improvements:

    • Added TooltipPosition type for better type safety in placement utilities
    • Removed web-specific code from accessibility utils (iOS/Android only)
    • Cleaned up all @ts-ignore comments and Platform.OS checks for web
    • Simplified accessibility functions to focus on native platforms

    Configuration:

    • Fixed changeset config to remove non-existent monorepo package reference

0.4.2

Patch Changes

  • #5 873d562 Thanks @edwardloopez! - Improve test coverage to 99% - added comprehensive tests for useCoachmark hook and CoachmarkAnchor component

0.4.1

Patch Changes

0.4.0

Minor Changes

  • ff7d165 Thanks @edwardloopez! - Add scrollDelay parameter to TourStep for smoother auto-scroll transitions. Eliminates visual jumpiness by adding a configurable delay (default: 150ms) between scroll completion and mask rendering.

0.3.0

Minor Changes

  • 2e19377 Thanks @edwardloopez! - Add auto-focus feature for automatic scrolling to off-screen coachmark anchors
    • Add autoFocus prop ('always' | 'ifNeeded') to TourStep
    • Add scrollRef prop on CoachmarkAnchor for linking ScrollView/FlatList
    • Implement automatic viewport detection and smooth scrolling
    • Add scrollBehavior, scrollPadding, and onBeforeScroll options
    • Include comprehensive tests and documentation