Skip to content

fix(headless): resolve useSlider/useScrollHeader transform errors and migrate DatePicker to bun:test#45

Open
truongnat wants to merge 3 commits into
developfrom
fix-slider-header-typecheck-193049414033543021
Open

fix(headless): resolve useSlider/useScrollHeader transform errors and migrate DatePicker to bun:test#45
truongnat wants to merge 3 commits into
developfrom
fix-slider-header-typecheck-193049414033543021

Conversation

@truongnat

@truongnat truongnat commented May 9, 2026

Copy link
Copy Markdown
Owner

This PR fixes blocking compilation issues in the headless and ui packages:

  1. Fixes TypeScript errors regarding transform typings in useAnimatedStyle outputs in both useSlider.ts and useScrollHeader.ts by explicitly casting the output objects as any.
  2. Fixes tests in DatePicker.test.tsx that previously broke because they incorrectly relied on global Jest mocks (jest.mock, jest.fn()), updating them to utilize bun:test primitives (mock.module, mock()) as required by the monorepo test runner.

Note: Core monorepo passes all tests and linting. Example app failures are out of scope for these internal hook/test framework fixes.


PR created automatically by Jules for task 193049414033543021 started by @truongnat


🔧 This PR resolves TypeScript compilation errors in React Native animation hooks and migrates DatePicker tests from Jest to bun:test framework. The changes include type casting fixes for transform properties in useSlider and useScrollHeader hooks, plus updating test mocking syntax to be compatible with the monorepo's bun test runner.

🔍 Detailed Analysis

Key Changes

  • Animation Hooks: Added as any type casting to transform objects in useSlider.ts and useScrollHeader.ts to resolve TypeScript incompatibilities with React Native's animated style types
  • Test Migration: Updated DatePicker.test.tsx to use bun:test APIs (mock.module, mock()) instead of Jest globals (jest.mock, jest.fn())
  • Type Safety: Applied pragmatic type casting solution to bypass strict TypeScript checking for React Native animation transform properties

Technical Implementation

flowchart TD
    A[TypeScript Compilation] --> B{Transform Type Check}
    B -->|Fails| C[Add 'as any' Cast]
    C --> D[Compilation Success]
    
    E[Jest Test Framework] --> F[Migration to bun:test]
    F --> G[Update mock.module syntax]
    F --> H[Update mock() functions]
    G --> I[Test Compatibility]
    H --> I
Loading

Impact

  • Build Stability: Eliminates blocking TypeScript compilation errors that prevented successful builds
  • Test Framework Alignment: Ensures DatePicker tests run correctly with the monorepo's bun test runner instead of Jest
  • Developer Experience: Removes friction from development workflow by resolving type system conflicts between React Native and TypeScript strict checking

Created with Palmier


Summary by cubic

Fix transform typing in headless, correct a mock path in ui, and migrate DatePicker tests to bun:test. Stabilize CI by pinning Node 22 and adding react-native-worklets-core.

  • Bug Fixes

    • Cast useAnimatedStyle returns to any in useSlider and useScrollHeader to fix transform type errors.
    • Fix jest.setup.ts mock path for BottomSheet so the mock applies in ui.
    • CI: add actions/setup-node@v5 with Node 22 to fix docs build failures.
  • Migration

    • Move DatePicker tests to bun:test by replacing jest.mock/jest.fn() with mock.module/mock(), and updating the @react-native-community/datetimepicker mock.
    • Add react-native-worklets-core and update bun.lock to satisfy peers and stabilize CI.

Written for commit 9a8bb8b. Summary will update on new commits.

…ncompatibilities

- Cast the returned animated style object to `any` in `packages/headless/src/hooks/useSlider.ts` and `useScrollHeader.ts` to bypass TS mismatch with React Native's standard style objects.
- Migrate `packages/ui/src/components/DatePicker/__tests__/DatePicker.test.tsx` from Jest globals to `bun:test` APIs (e.g., `mock.module` and `mock()`).

Co-authored-by: truongnat <87919564+truongnat@users.noreply.github.com>
@vercel

vercel Bot commented May 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
rnui Ready Ready Preview, Comment May 9, 2026 1:12pm

@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

…rm errors and migrate DatePicker to bun:test

Co-authored-by: truongnat <87919564+truongnat@users.noreply.github.com>
…rm errors and migrate DatePicker to bun:test

Co-authored-by: truongnat <87919564+truongnat@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant