Use extendClient in program plugins and bump @solana/kit to ^6.4.0#140
Use extendClient in program plugins and bump @solana/kit to ^6.4.0#140lorisleiva wants to merge 1 commit intomainfrom
Conversation
This updates the program plugin code generator to use `extendClient` from `@solana/plugin-core` instead of manually spreading the client object. The return type now uses `Omit<T, key> & { key: Plugin }` instead of `T & { key: Plugin }`, which allows proper type narrowing when extending clients with overlapping plugin keys. The minimum `@solana/kit` version is bumped to `^6.4.0` across all default dependency versions and e2e test packages.
🦋 Changeset detectedLatest commit: 7f9d414 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
trevor-cortex
left a comment
There was a problem hiding this comment.
Summary
This PR updates the program plugin code generator to use extendClient from @solana/plugin-core instead of manually spreading the client object ({ ...client, key: { ... } }). The return type changes from T & { key: Plugin } to Omit<T, "key"> & { key: Plugin }, which enables proper type narrowing when composing plugins with overlapping keys. All @solana/* default dependency versions are bumped from ^6.1.0 to ^6.4.0.
Review
Clean, mechanical change. The core logic update is in src/fragments/programPlugin.ts — a single new use('extendClient', 'solanaPluginCore') call and two template literal changes. The import mapping in importMap.ts already maps solanaPluginCore → @solana/kit (default) / @solana/plugin-core (granular), so the generated import will resolve correctly in both strategies.
The Omit<T, key> & { key: Plugin } pattern is the right approach — it replaces any existing property with the same key rather than creating an impossible intersection type (T & { key: Plugin } where T already has a different key).
All e2e generated files are consistent with the new template output, and the test expectation is updated to match.
Notes for subsequent reviewers
- The
<PluginType>type assertion on the object literal (e.g.<SplTokenPlugin>{ ... }) is worth noting — this is a deliberate cast. Since the object is being constructed inline with dynamic helpers likeaddSelfFetchFunctions, TypeScript may not be able to fully verify the shape matches the plugin type. This was likely already the case implicitly before; now it's explicit. - The
^6.4.0bump applies to all 14@solana/*default dependencies uniformly. IfextendClientwas introduced in a specific minor version, it might be worth confirming that6.4.0is indeed the minimum version that exports it. - The lockfile diff is large (~780 lines) but is just the natural result of bumping
@solana/kitin the e2e test packages.

This updates the program plugin code generator to use
extendClientfrom@solana/plugin-coreinstead of manually spreading the client object. The return type now usesOmit<T, key> & { key: Plugin }instead ofT & { key: Plugin }, which allows proper type narrowing when extending clients with overlapping plugin keys. The minimum@solana/kitversion is bumped to^6.4.0across all default dependency versions and e2e test packages.