Releases: codama-idl/renderers-rust
v3.1.0
v3.0.0
Major Changes
-
#92
4af6c06Thanks @grod220! - Removed defaultserdesupport and replacedkaiganwithspl-collectionsBREAKING CHANGES:
-
Generated variable-sized string/vector wrappers now come from
spl-collectionsinstead ofkaigan. If you have handwritten code that references these generated wrapper types, update those imports and usages after regenerating your client:kaigan::types::RemainderStr->spl_collections::TrailingStrkaigan::types::RemainderVec<T>->spl_collections::TrailingVec<T>kaigan::types::U8PrefixString,U16PrefixString,U64PrefixString->spl_collections::U8PrefixedStr,U16PrefixedStr,U64PrefixedStrkaigan::types::U8PrefixVec<T>,U16PrefixVec<T>,U64PrefixVec<T>->spl_collections::U8PrefixedVec<T>,U16PrefixedVec<T>,U64PrefixedVec<T>
-
serdeis no longer part of the default or recommended generated client surface. The previous default derives on wrapper types were misleading because theirserderepresentation does not match the Borsh/Wincode wire format. -
If you still want
serdederives for a separate JSON representation, you can opt in explicitly viatraitOptionsas shown below. This does not make the generated types serde-compatible with their Borsh/Wincode wire format, but you can define a handwritten implementation with your own serde mapping as needed.traitOptions: { baseDefaults: [ 'borsh::BorshSerialize', 'borsh::BorshDeserialize', -
'serde::Serialize', -
'serde::Deserialize', 'Clone', 'Debug', 'Eq', 'PartialEq', ], -
featureFlags: {
-
serde: ['serde::Serialize', 'serde::Deserialize'], -
},
}
-
-
#90
f214970Thanks @grod220! - Switch generated Rust code fromsolana_pubkey::Pubkeytosolana_address::Addressand update the default dependency set to newer Solana 3.x andborsh1.0 versions. This affects generated program IDs, account/instruction types, PDA helpers, and public key literals, so downstream users may need to update imports and pubkey usage after regenerating clients.
v2.0.1
v2.0.0
Major Changes
-
#85
44daccaThanks @lorisleiva! - RefactorrenderVisitorto usecrateFolderas its primary argument instead of the generated output path. The generated folder is now derived internally using a newgeneratedFolderoption (defaults to'src/generated'). Remove thecrateFolderoption as it is no longer needed.BREAKING CHANGES
First argument of
renderVisitorchanged from output path to crate folder. The function now takes the crate folder (whereCargo.tomllives) and derives the generated output path internally.- const visitor = renderVisitor('clients/rust/src/generated', { - crateFolder: 'clients/rust', - }); + const visitor = renderVisitor('clients/rust');
crateFolderoption removed. It is replaced by the first argument ofrenderVisitor.New
generatedFolderoption. Defaults to'src/generated'and can be customized to change the output path relative to the crate folder.- const visitor = renderVisitor('clients/rust/my/custom/path', { - crateFolder: 'clients/rust', - }); + const visitor = renderVisitor('clients/rust', { + generatedFolder: 'my/custom/path', + });
Patch Changes
- #70
f0fbbb0Thanks @lorisleiva! - AddsyncCargoTomlanddependencyVersionsoptions in order to create or update the Cargo.toml of the Rust crate when generating its code.
v1.2.9
Patch Changes
- #72
08d6409Thanks @lorisleiva! - Enable Rollup treeshaking pass
v1.2.8
Patch Changes
- #61
8d51891Thanks @lorisleiva! - Use latest RenderMap type from renderers-core
v1.2.7
Patch Changes
-
#12
ac05970Thanks @buffalojoec! - Don't generateborsh::to_vecif no borsh traits -
#13
33a297dThanks @buffalojoec! - fix: make serde field attributes dynamic and optional
v1.2.6
Patch Changes
- #9
ebaf0bbThanks @lorisleiva! - Bump Codama