Skip to content

Conversation

@tsyirvo
Copy link
Owner

@tsyirvo tsyirvo commented Jan 7, 2026

Summary by CodeRabbit

  • Chores
    • Updated multiple dependencies including React, React Native, and related ecosystem packages to latest versions.
    • Improved testing infrastructure and mock implementations for better test reliability.
    • Refined Storybook configuration and integration.

✏️ Tip: You can customize this high-level summary in your review settings.

@tsyirvo tsyirvo self-assigned this Jan 7, 2026
@coderabbitai
Copy link

coderabbitai bot commented Jan 7, 2026

Walkthrough

This pull request updates project dependencies and refactors storage initialization patterns. The react-native-mmkv mock in __mocks__/react-native-mmkv.ts is restructured from a singleton to a factory pattern with improved type safety. Storage implementations across src/infra/storage/ are updated to use the new createMMKV factory function instead of the MMKV constructor. Testing setup is enhanced with a mock for @gorhom/bottom-sheet. Configuration changes include updating metro.config.cjs import style, adding an environment variable to the start:storybook script, simplifying src/app/Storybook.tsx, and adding an MCP permission in .claude/settings.local.json.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the primary change as a dependencies update, though it is generic and doesn't capture the broader refactoring work (MMKV migration, Storybook updates) included in the changeset.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In @src/app/Storybook.tsx:
- Line 1: The .rnstorybook export was re-exported directly which removed lazy
loading, Suspense, ErrorBoundary and loading UI; revert by importing the
Storybook UI lazily (React.lazy(() => import('../../.rnstorybook'))) and export
a wrapper component that renders the lazy-loaded Storybook inside React.Suspense
with your Loader as fallback and an ErrorBoundary around it (or reintroduce the
previous ErrorBoundary component), or if you intentionally removed them,
document in preview.tsx why Suspense/Loader/ErrorBoundary are not needed and
ensure the preview decorator still provides equivalent error/loading handling.
🧹 Nitpick comments (1)
metro.config.cjs (1)

6-8: Optional: Remove trailing comma in destructuring.

The trailing comma after withStorybook is unnecessary since only one export is being destructured. While not incorrect, it's typically used when multiple items are being destructured.

♻️ Proposed cleanup
-const {
-  withStorybook,
-} = require('@storybook/react-native/metro/withStorybook');
+const { withStorybook } = require('@storybook/react-native/metro/withStorybook');
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 47df4b6 and 2a4379c.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (10)
  • .claude/settings.local.json
  • __mocks__/react-native-mmkv.ts
  • metro.config.cjs
  • package.json
  • src/app/Storybook.tsx
  • src/domain/testing/setup.ts
  • src/infra/storage/appStorage.ts
  • src/infra/storage/productTrackingStorage.ts
  • src/infra/storage/queryClientStorage.ts
  • src/infra/storage/storeStorage.ts
🧰 Additional context used
📓 Path-based instructions (2)
src/**/*.{ts,tsx}

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.{ts,tsx}: Always use TypeScript for code files
Use ES modules with import statements instead of require
Always wrap arrow function arguments in parentheses
Prefer async/await for promises and always handle error cases
Always fix ESLint warnings and errors before finishing a task
Run yarn lint, yarn lint:ts, and yarn prettify and fix potential errors before finishing a task

Files:

  • src/infra/storage/storeStorage.ts
  • src/infra/storage/appStorage.ts
  • src/infra/storage/queryClientStorage.ts
  • src/domain/testing/setup.ts
  • src/app/Storybook.tsx
  • src/infra/storage/productTrackingStorage.ts
src/**/*.{tsx,ts}

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.{tsx,ts}: Always use arrow functions with extracted Props interfaces for React components
Don't use React.FC type for components; prefer interfaces to types for Props
Use ComponentProps<typeof MyComponent> to extract Props type instead of manually defining them
Never define inline styles; always use Unistyles's StyleSheet API for styling
Maintain theme consistency using Unistyles theme file located at src/domain/theme/unistyles.ts

Files:

  • src/infra/storage/storeStorage.ts
  • src/infra/storage/appStorage.ts
  • src/infra/storage/queryClientStorage.ts
  • src/domain/testing/setup.ts
  • src/app/Storybook.tsx
  • src/infra/storage/productTrackingStorage.ts
🧠 Learnings (3)
📚 Learning: 2026-01-07T07:41:02.477Z
Learnt from: CR
Repo: tsyirvo/react-native-starter PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T07:41:02.477Z
Learning: Applies to src/**/*.{ts,tsx} : Use ES modules with `import` statements instead of `require`

Applied to files:

  • metro.config.cjs
📚 Learning: 2026-01-07T07:41:02.477Z
Learnt from: CR
Repo: tsyirvo/react-native-starter PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T07:41:02.477Z
Learning: Applies to src/**/*.{ts,tsx} : Run `yarn lint`, `yarn lint:ts`, and `yarn prettify` and fix potential errors before finishing a task

Applied to files:

  • package.json
📚 Learning: 2026-01-07T07:41:02.477Z
Learnt from: CR
Repo: tsyirvo/react-native-starter PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-01-07T07:41:02.477Z
Learning: Applies to src/**/*.{ios,android}.tsx : Support platform-specific files using extensions like `.ios.tsx` and `.android.tsx`

Applied to files:

  • package.json
🧬 Code graph analysis (4)
src/infra/storage/storeStorage.ts (1)
__mocks__/react-native-mmkv.ts (3)
  • MMKV (31-31)
  • Configuration (33-36)
  • createMMKV (27-29)
src/infra/storage/appStorage.ts (1)
__mocks__/react-native-mmkv.ts (1)
  • createMMKV (27-29)
src/infra/storage/queryClientStorage.ts (1)
__mocks__/react-native-mmkv.ts (3)
  • MMKV (31-31)
  • Configuration (33-36)
  • createMMKV (27-29)
src/infra/storage/productTrackingStorage.ts (1)
__mocks__/react-native-mmkv.ts (1)
  • createMMKV (27-29)
🔇 Additional comments (14)
package.json (5)

55-55: LGTM! APP_ENV added for consistency.

Adding APP_ENV=development to the storybook script ensures consistency with the development environment setup across scripts.


206-206: LGTM! Storybook patterns added to transform ignore list.

The addition of storybook|@storybook/.* to transformIgnorePatterns is correct and necessary for Jest to properly handle the Storybook 10 upgrade.


108-113: React 19 is already properly integrated into this codebase.

The project uses React 19.1.0 and follows modern React patterns throughout. Code examination confirms:

  • No deprecated React APIs (ReactDOM.render, findDOMNode) in use
  • No React.FC patterns; components use modern functional declarations
  • All useRef instances are properly typed for TypeScript
  • All ref callbacks follow correct patterns with no problematic return values
  • ReactNode and ReactElement types are imported and used correctly

No React 19 compatibility updates are needed.

Likely an incorrect or invalid review comment.


131-131: No action required—the codebase is already using Zod 4 compatible patterns. The validators use the new { error: ... } syntax for messages (loginForm.validators.ts, env.js), and error handling correctly uses z.treeifyError() instead of the deprecated .format() or .flatten() methods.


113-113: Remove this comment — React Native 0.81.5 is the correct version for React 19 and Expo 54.

The version 0.81.5 is a valid patch release (published Oct 21, 2025) and follows the standard React Native versioning pattern. It is specifically paired with React 19.1 and is the version targeted by Expo SDK 54, making it the appropriate choice for these dependencies. This is not a typo or unusual version.

Likely an incorrect or invalid review comment.

.claude/settings.local.json (1)

24-25: LGTM! MCP permission added for documentation queries.

The addition of mcp__context7__query-docs permission follows the established MCP permission pattern and enables documentation querying capabilities.

src/domain/testing/setup.ts (1)

15-15: Mock path for @gorhom/bottom-sheet is correct.

The mock setup is valid. @gorhom/bottom-sheet@5.2.8 includes mock.js at the package root, and the pattern jest.mock('@gorhom/bottom-sheet', () => require('@gorhom/bottom-sheet/mock')) is the documented approach for this package version.

src/infra/storage/queryClientStorage.ts (1)

2-2: Consistent migration to factory pattern.

The refactoring is consistent with the changes in storeStorage.ts, properly updating to createMMKV() factory and remove() method.

Also applies to: 10-10, 24-24

src/infra/storage/appStorage.ts (1)

1-7: Clean and simplified storage initialization.

The direct use of createMMKV() without a wrapper class is appropriate for this simple storage instance. The refactoring is well-executed.

src/infra/storage/productTrackingStorage.ts (1)

1-7: Consistent factory pattern implementation.

The migration to createMMKV() is consistent with other storage modules. The helper functions in CustomProductTrackingStorage will work correctly with the factory-created instance.

__mocks__/react-native-mmkv.ts (2)

1-25: Excellent type safety improvements in the mock.

The factory-based mock implementation significantly improves type safety by:

  • Checking types before returning values from getters (lines 5-10)
  • Providing explicit return types for all methods
  • Supporting isolated storage instances via the factory pattern

The mock API is complete and correctly implements the expected MMKV interface.


27-36: Well-structured factory mock and type exports.

The export pattern is clean:

  • createMMKV as a jest mock function that returns storage instances
  • MMKV as a type (not a value), enabling proper type inference
  • Configuration interface matching the library's signature

This structure supports testing multiple storage instances with different configurations.

src/infra/storage/storeStorage.ts (2)

2-2: Factory pattern migration correctly implemented.

The refactoring from new MMKV(config) to createMMKV(config) is valid. The createMMKV factory function is supported in react-native-mmkv and maintains type safety.


24-24: API change verified as correct for react-native-mmkv 4.1.0. The method remove() is the correct API in v4 (the old delete() method was renamed per the v4 release notes due to delete being a C++ keyword).

@tsyirvo tsyirvo merged commit 700322c into develop Jan 7, 2026
2 checks passed
@tsyirvo tsyirvo deleted the chore/dependenciesUpdates branch January 7, 2026 11:50
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.

2 participants