Skip to content

Conversation

@mfbz
Copy link
Contributor

@mfbz mfbz commented Dec 9, 2025

Extracts platform-agnostic React hooks, utilities, and types from react-sdk into a new react-core package. This enables code reuse for React Native (via a future react-native-sdk) without pulling in web-specific dependencies. The react-sdk package now re-exports from react-core with no breaking changes to its public API.

Copy link
Contributor

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 extracts platform-agnostic React hooks, utilities, and types from react-sdk into a new react-core package to enable code reuse across web and React Native platforms. The react-sdk now re-exports from react-core, maintaining backward compatibility.

Key changes:

  • Created @onflow/react-core package with platform-agnostic hooks and utilities
  • Migrated hooks to use @onflow/fcl-core instead of @onflow/fcl for platform independence
  • Updated react-sdk to re-export from react-core with no breaking API changes

Reviewed changes

Copilot reviewed 91 out of 96 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/react-core/* New platform-agnostic package containing hooks, contexts, types, and utilities
packages/react-sdk/src/index.ts Updated to re-export hooks and types from react-core
packages/react-sdk/src/provider/* Updated imports to use react-core
packages/react-sdk/src/components/* Updated imports to use react-core hooks
packages/fcl-core/src/* Added FlowClientCore type export
.changeset/free-hats-hammer.md Changeset documenting the refactor

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

{
to: "0x123",
data: "",
data: "abcdef123456",
Copy link

Copilot AI Dec 9, 2025

Choose a reason for hiding this comment

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

The test expects 'abcdef123456' but encodeCalls strips the '0x' prefix using sansPrefix. The mock returns '0xabcdef123456', so after sansPrefix the result should be 'abcdef123456'. However, the original test expected an empty string. This change may break the test if the mock implementation doesn't match the expected behavior.

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

it properly mocks encodeFunctionData to return "0xabcdef123456" and verifies that sansPrefix correctly strips the 0x prefix to "abcdef123456". Master test was testing with undefined data (returning "")

@mfbz mfbz merged commit b5da56b into master Dec 10, 2025
8 checks passed
@mfbz mfbz deleted the mfbz/react-core branch December 10, 2025 19:18
@github-actions github-actions bot mentioned this pull request Dec 10, 2025
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.

4 participants