Skip to content

Releases: contextgeneric/cgp

v0.6.0

26 Oct 11:44
fdf8f26

Choose a tag to compare

Changelog

  • Introduce #[cgp_impl] to simplify provider trait implementation - #174
  • Allow context types to delegate components directly - #175
  • Introduce #[cgp_inherit] for inheriting from presets - #176
  • Fix use of self inside default trait method implementation body - #179

v0.5.0

12 Oct 14:29
ba9bf32

Choose a tag to compare

Read the announcement blog post

Changelog

  • Monadic computation support

    • Use Monadic composition to simplify the implementation of DispatchMatchers - #127
    • Add full monad transformer support for monadic composition of CGP handlers - #129
  • Extensible data types improvements

    • Add generalized field transformation on partial records to support building with default values. - #128
    • Add CanFinalizeWithDefault method for partial records - #130
    • Extensible Visitor Improvements - #132
    • Add support for passing additional arguments to extensible visitors - #134
    • Add extensible visitor support mutable partial variants - #135
    • Introduce UpdateField trait to generalize field transformation in partial data - #148
    • Add optional field builder constructs for extensible records - #152
    • Introduce #[derive(CgpData)] and #[derive(CgpRecord)] Macros - #154
    • Add __ prefix to Partial data types generated - #156
    • Implement ref variants of matcher providers - #161
  • Handler improvements

    • Introduce AsyncComputer Component - #136
    • Derive AsyncComputer when using #[cgp_computer] with async functions - 137
    • Add new cgp-extra-macro crate - #138
  • Dispatch macro

    • Implement #[cgp_dispatch] macro - #139
    • #[cgp_dispatch] macro improvements - 142
    • Rename #[cgp_dispatch] to #[cgp_auto_dispatch] - #155
  • Component system improvements

    • Allow only provider name to be specified inside #[cgp_getter] - #143
    • Support use of lifetime parameters inside CGP traits - #145
    • Add ?Sized bound to DelegateComponent's Name parameter - #147
    • Allow shortcut definition of provider name in #[cgp_type] - #163
    • Fix use of new in delegate_components! when keys array are used - #164
    • Add Life type to represent lifetimes as types - #166
  • Field improvements

    • Desugar field constructs into their symbolic forms - #151
    • Allow first argument in #[cgp_getter] methods to be non-self - #169
  • Symbol improvements

    • Implement MatchStr for static string matching with symbols - #153
    • Implement StaticString trait to produce &'static str from symbol types - #159
  • Breaking changes toward stabilization

    • Remove Async trait and Send bounds in async functions - #149
    • Reorganize exports in cgp-field - #150
    • Rename Char to Chars - #165
    • Remove HasInner trait - #170
    • Remove lowercase symbol! macro - #173

v0.4.2

07 Jul 13:03
3a5e8dc

Choose a tag to compare

Changelog

  • Implement Extensible Data Types - more info in the blog post

    • Data-generic programming support in CGP - #112
    • Implement DispatchHandlersRef for dispatching based on enum references - #116
    • Builder dispatcher refactoring - #117
    • Introduce ref version of handler traits - #118
    • Dispatcher Refactoring - #119
    • Remove Input param from MatchWithFieldHandlers - #120
    • Support use of ref handlers in handler macros - #121
  • Preset Improvements

    • Add new direct delegation mode and use it in preset inheritance - #111
  • Bug Fixes

    • Derive HasField<Index<{i}>> for structs with unnamed fields - #115
    • Allow unsized generic arguments in IsProviderFor trait - #114

v0.4.1

13 Jun 22:48
337004c

Choose a tag to compare

More details about this release is covered in the update blogpost.

Changelog

  • New cgp-handler Crate

    • Introduce new cgp-handler crate - #105
  • Macro Improvements

    • Support wrapping of Preset::Provider inside cgp_preset! macro - #103
    • Support derivation of UseDelegate inside #[cgp_component] - #106
  • CGP Field Improvements

    • Format Char statically without self - #104
  • Miscellaneous

    • Minor improvements - #107
  • Documentation

    • Add inline Rust documentation for common CGP constructs - #109

v0.4.0

09 May 14:22
9d4c031

Choose a tag to compare

More details about this release is covered by the update blogpost.

Changelog

  • Debugging Improvements

    • Implement delegate_and_check_components! - #98
    • Implement check_components! macro to check if a context implements a component - #78
    • Permanently enable provider supertrait - #73
    • Introduce #[new_cgp_provider] to also generate provider struct definition - #67
    • Preserve original provider bounds inside #[cgp_provider] - #65
    • Introduce IsProviderFor trait to help improve compile errors - #63
  • CGP Presets Implementation

    • Fix nested inheritance and multi inheritance for presets - #92
    • Preset Macro Improvements - #91
    • Expand cgp_preset! into a preset module - #72
    • Re-export imports inside a re_export submodule - #71
    • Introduce #[cgp::re_export_imports] macro - #70
  • CGP Getter Improvements

    • CGP Getter Improvements - #94
    • Getter Macro Improvements - #87
    • Refactoring and Improvements on #[cgp_getter] - #81
    • Fix component generics inside derivation of WithProvider for #[cgp_getter] - #80
    • Fix #[cgp_getter] macro when the getter trait contains generic parameters - #76
    • Allow generic arguments inside #[cgp_auto_getter] traits - #64
  • Macro Improvements

    • Simplify attribute arguments for #[cgp_component], #[cgp_provider] and #[cgp_context] - #96
    • Allow definition of new structs inside delegate_components! - #93
    • Migrate macro tests to cgp-tests crate, part 1 - #90
    • Automatically derive UseContext implementation inside #[cgp_component] - #88
    • Macro Crates Reorganization - #83
    • Refactoring and rename #[trait_alias] to #[blanket_trait] - #82
    • Introduce #[trait_alias] macro to simplify definition of alias traits - #79
    • CGP Macro Refactoring - #77
    • Rename #[new_cgp_provider] to #[cgp_new_provider] - #75
    • Introduce #[cgp_context] attribute macro for CGP contexts - #66
  • Component System Improvements

    • Rename HasProvider trait to HasCgpProvider - #97
    • Add support for const item in component traits - #95
    • Remove 'static bound from Async trait alias - #89
    • Rename HasComponents trait to HasProvider - #69
    • Redesign cgp_type to work as attribute macro - #68
  • CGP Field Improvements

    • Add Display instance for symbol types - #86
    • Use Unicode Greek alphabets for visual representation of CGP field types - #85
    • Implement traits and derive macros for HasFields, FromFields, and ToFields - #84
    • Add #[diagnostic::do_not_recommend] to blanket impl of HasField - #74

v0.3.1

16 Jan 16:31
19c239d

Choose a tag to compare

  • Update Rust MSRV to v1.84 - #58

  • Add HasAsyncErrorType to prelude - #59

  • Add CanRaiseAsyncError and CanWrapAsyncError to cgp-error and prelude - #60

v0.3.0

08 Jan 21:20
fa0e457

Choose a tag to compare

More details about this release is covered by the update blogpost.

Changelog

  • Introduce Accessor Component Macros - #56

    • Introduce #[cgp_getter] attribute macro that extends #[cgp_component] and implement
      UseFields and UseField for accessor traits.
    • Introduce #[cgp_auto_getter] attribute macro for deriving accessor traits with
      blanket implementations that use HasField directly.
  • Introduce cgp_type! macro for defining simple abstract CGP types - #55

    • Use cgp_type! to derive HasErrorType and HasRuntimeType.
  • Implement ErrorWrapper on generic ErrorRaiser providers - #54

    • Implement ErrorWrapper for the following providers: DebugError, DisplayError,
      DebugAnyhowError, DisplayAnyhowError, RaiseAnyhowError,
      DebugEyreError, DisplayEyreError, RaiseEyreError,
      DebugBoxedStdError, DisplayBoxedStdError.
  • Reorganize crate exports - #53

    • Move generic error providers to the cgp-error-extra crate.
    • Add an alloc feature to cgp-error-extra to enable use of alloc in providers.
    • Make private the sub-modules inside CGP crates.
    • Explicitly export module items instead of using *.
  • Move cgp-inner to cgp-extra - #51

    • Remove re-export of cgp-inner from cgp-core.
    • Re-export cgp-inner and cgp-runtime from cgp-extra.
  • Introduce cgp-runtime crate - #50

    • Introduce the HasRuntimeType and HasRuntime traits.
    • Introduce HasAsyncRuntimeType trait used for adding Async constraint to HasRuntimeType::Error.
  • Error crates refactoring - #48

    • Remove Async trait bound from HasErrorType::Error.
    • Introduce HasAsyncErrorType trait used for adding Async constraint to HasErrorType::Error.
    • Introduce CanWrapError trait.
    • Introduce generic ErrorRaiser providers in cgp-error.
    • Rename and reoganize constructs in cgp-error-eyre and cgp-error-std.
    • Introduce cgp-error-anyhow crate.
  • Decouple component and field macro crates from the library crates - #47

    • Remove cgp-component-macro crate from being a dependency of cgp-component.
    • Remove cgp-field-macro crate from being a dependency of cgp-field.