Skip to content

Conversation

@ddddsssss4
Copy link

Summary

  • Documented the relationship with @solana/kit in the root README to explicitly explain the dependency structure.
  • Clarified the architectural decision to not re-export Kit primitives to ensure separation of concerns and prevent "wrapper confusion."
  • Added an Interop Example code block demonstrating the intended usage pattern: importing primitives (like address) directly from @solana/kit while using hooks from @solana/react-hooks.

Testing

  • pnpm lint
  • pnpm test
  • pnpm build
  • Other (describe):

@GuiBibeau GuiBibeau changed the title docs:Documented need of solana kit with framework-git docs: Documented need of solana kit with framework-kit Dec 8, 2025
README.md Outdated

### Why this architecture?

We want to avoid the "wrapper confusion" often seen in earlier libraries (like Gill), where it was unclear whether developers should use the framework's version of a type or the native version.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Even if i put something like this in the issue, i think we don't have to be explicit about it or name other libraries in there.

I like the separation of concerns bullet points bellow! I think the intro text should simply state the approach maybe a bit like this

Suggested change
We want to avoid the "wrapper confusion" often seen in earlier libraries (like Gill), where it was unclear whether developers should use the framework's version of a type or the native version.
Framework-kit is built on top of `@solana/kit`. As such, types from Kit are compatible with Framework-kit.

Comment on lines 51 to 61
```typescript
// 1. Import standard primitives directly from @solana/kit
import { address, type Address } from "@solana/kit";

// 2. Import high-level logic from the framework
import { useWalletConnection } from "@solana/react-hooks";

export const UserProfile = ({ userAddress }: { userAddress: Address }) => {
const { connect } = useWalletConnection();
// ... component logic
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

do we have a way to show where the types converge? For example

import { useWallet } from '@solana/react-hooks'
import { address, type Address } from "@solana/kit";

export const MyComponent = () => {
const wallet = useWallet();

 // wallet.session.account.address is of type Address
}

This is likely not the example to give but the whole type system of framework-kit is built on top of @solana/kit we should give an example of mixing the two libraries where the types converge

Copy link
Author

Choose a reason for hiding this comment

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

Hey thanks for feedback, I’ve updated the sections you highlighted. Please let me know if you'd like any further refinement.

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.

3 participants