Skip to content

Conversation

@JoseLion
Copy link
Owner

No description provided.

@JoseLion JoseLion requested a review from Copilot June 16, 2025 22:41
@JoseLion JoseLion self-assigned this Jun 16, 2025
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates dependencies and supporting code to enable compatibility with React Native v0.80.0 while also refining internal component mocking behavior. Key changes include:

  • Updating the mock behavior in native mocks by standardizing the structure returned by the replace() function.
  • Adding a new Babel plugin configuration with a custom resolvePath for module resolution.
  • Adjusting import paths and component type checks to improve clarity and reliability.
  • Bumping dependency versions in package.json, .yarnrc.yml, and .nvmrc.

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/lib/mockNative.ts Standardizes the mock return shape; previously conditional logic for ActivityIndicator.
src/lib/babelRegister.ts Introduces a module-resolver plugin with custom resolvePath logic.
src/lib/Animated/AnimatedMock.ts Corrects the import to the properly named AnimatedValueXYMock file.
src/helpers/mockComponent.ts Enhances component type checking by using additional isFunction and isClass logic.
package.json, .yarnrc.yml, .nvmrc Updates dependency versions and configurations to support the new React Native version.
Comments suppressed due to low confidence (4)

src/lib/babelRegister.ts:24

  • [nitpick] Consider adding an inline comment to explain the purpose of appending '.ios' for relative paths matching certain haste paths, which will aid future maintainers in understanding this custom resolvePath logic.
return hastePaths.some(path => sourcePath.endsWith(path)) ? `${sourcePath}.ios` : undefined;

src/lib/Animated/AnimatedMock.ts:4

  • The import path has been updated to reflect the correct filename. Verify that there are no remaining references to the old file name to maintain consistency.
import { AnimatedValueXYMock } from "./AnimatedValueXYMock";

src/lib/mockNative.ts:68

  • The updated logic in replace() now uniformly returns an object with a default property, which deviates from the previous conditional structure. Please verify that all consumers of this API are updated to expect this change.
replace(path, () => ({ default: Mock }));

src/helpers/mockComponent.ts:20

  • [nitpick] The new check for determining if RealComponent is a class is a good enhancement. Ensure that using get(RealComponent.prototype, "constructor") reliably distinguishes class components from functional ones in all expected cases.
const isClass = get(RealComponent.prototype, "constructor") instanceof Component;

@JoseLion JoseLion force-pushed the feat/react-native-0.80.0 branch from 88866fb to ae1f715 Compare June 16, 2025 22:43
@JoseLion JoseLion force-pushed the feat/react-native-0.80.0 branch from ae1f715 to f0c3c99 Compare June 16, 2025 22:56
@JoseLion JoseLion merged commit ffa7234 into main Jun 16, 2025
7 checks passed
@JoseLion JoseLion deleted the feat/react-native-0.80.0 branch June 16, 2025 23:01
@github-actions
Copy link

🎉 This PR is included in version 1.7.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants