All notable changes to this project will be documented in this file.
- Empty release for the gem republishing;
- Nested schemas requires :hash type for their schema key, but
this type is resolved from the type alias, not from the type object.
- Added an object reference to the hash primitive in
type interopsubsystem (interop + abstract factory); - each type system should provide hash type class:
- smart-core provides/recognizes nested structures with
SmartCore::Types::Hash; - dry-types provides/recognizes nested structures with
Dry::Types['hash'];
- smart-core provides/recognizes nested structures with
- Added an object reference to the hash primitive in
# before:
require 'dry-types'
SmartCore::Schema::Configuration.configure { |c| c.type_system = :dry_types }
class MySchema < SmartCore::Schema
schema do
requried(:some_data) do # <- previously: failed on unrecognized type with :hash alias
requireqd(:some_key).type(Dry::Types['string'])
end
end
end- Plugin ecosystem;
- Support for Ruby@4.x;
- Support for
dry-typestype system; - An ability to chose the preferred type system (globally at the moment):
- supports
smart-types(by default); - supports
dry-types(as a plugin);
- supports
- Ruby@3.3 is a minimal ruby version at the moment;
- Reduced object allocation count inside the type validation logic (updated
smart_typesto~> 0.8); - Support for Ruby@2.5 and Ruby@2.6 has ended;
- Updated development dependencies;
- Updated
smart_enginedependency with aSmartCore::Engine::ReadWriteLockfixes;
- Reduced context switching count during lock operations (migrate from
SmartCore::Engine::LocktoSmartCore::Engine::ReadWriteLock);
- Reduced object allocations and mutex usage:
- only one mutex of
SmartCore::Schema::Checkerinstance is enough cuz this mutex covers the entire validation process; - more retained objects in
SmartCore::Schema::Checker::Rules(cache layer for rule names);
- only one mutex of
- Updated development dependencies;
- Updated
smart_enginedependency (~> 0.11->~> 0.13);
- Started the total code refactoring in order to decrease object and memory allocations:
- Decreased object allocations in
SmartCore::Schema::Checker::VerifiableHash#fetch(key)
- Decreased object allocations in
- Now
Forwardablemodule has explicit requiring in order to support Ruby@3.1 (lib/smart_core/smart_schema.rb#6);
- Updated
smart_typesdependency (~> 0.4.0) to guarantee Ruby@3 compatability;
- Support for Ruby@3;
- No more
TravisCI(TODO: migrate toGitHub Actions); - Updated development dependencies;
- Support for strict and non-strict schemas;
strict!DSL directive marks your schema as a strict schema (your hash can not have extra keys);non_strict!DSL directive marks your schema as non-strict schema (your hash can have extra keys);- use
strict!in any schema's context place to mark your current schema context as a strict; - use
non_strictin any schema's context place to mark your current schema context as a strict; - use
schema(:strict)to globally define strict schema (default behavior); - use
schema(:non_strict)to globally define non-strict schema; - nested schemas inherits strict behavior from outer schemas;
- root schema is
:strictby default; - schema reopening without mode attribute does not change original schema mode (you should manually pass a mode attribute to redefine already defined schema mode);
#errorsnow includes#extra_keystoo (:extra_keyerror code for each extra key);- Unfreezed
SmartCore::Schema::Checker::Rules::TYPE_ALIASESfor extendability (untilsmart_type-systehas been integrated);
- Release :)