Closed kevinheavey closed 2 months ago
I like the intent. Would it be cleaner to do this by keeping a single crate and using a feature flag instead?
No, if anything feature flags are overused in the Rust ecosystem. I've been meaning to write a piece about this, but here are some problems with that approach:
Sometimes feature flags are kinda unavoidable, like if you want to optionally derive(Serialize) on a struct. That's not something you can achieve with crate splitting, but it's also not something that affects this PR.
Implemented this pattern for the new v2 build. Closing this now
I've been meaning to demonstrate what it looks like to have separate crates for a Solana program and its API, and the Ore code is really clean so I chose Ore. Up to you if you wanna merge obviously (if not I'll point people to my fork as a demo), but if you do merge you get the following benefits:
What this PR does:
Btw if you want to regenerate the shank IDL, the command is now
shank idl -r crates/api