crystal v0.32.0 Release Notes

Release Date: 2019-12-11 // over 4 years ago
  • Language changes

    • ๐Ÿ‘ Allow boolean negation to be written also as a regular method call expr.!. (#8445, thanks @jan-zajic)

    Macros

    • โž• Add TypeNode#class_vars to list class variables of a type in a macro. (#8405, thanks @jan-zajic)
    • โž• Add TypeNode#includers to get an array of types a module is directly included in. (#8133, thanks @Blacksmoke16)
    • Add ArrayLiteral#map_with_index and TupleLiteral#map_with_index. (#8049, thanks @Blacksmoke16)
    • โž• Add docs for ArrayLiteral#reduce. (#8379, thanks @jan-zajic)
    • โž• Add lower: named argument to StringLiteral#camelcase. (#8429, thanks @Blacksmoke16)

    Standard library

    Numeric

    • ๐Ÿ›  Fixed % and Int#remainder edge case of min int value against -1. (#8321, thanks @asterite)
    • ๐Ÿ›  Fixed Int#gcd types edge case and improve performance. (#7996, #8419, thanks @yxhuvud, @j8r)
    • โž• Add Int#bits for accessing bit ranges. (#8165, thanks @stakach)
    • ๐Ÿ‘ Allow Number#round with UInt argument. (#8361, thanks @igor-alexandrov)

    Text

    Collections

    • (breaking-change) Deprecate Enumerable#grep, use Enumerable#select. (#8452, thanks @j8r)
    • ๐Ÿ›  Fixed Enumerable#minmax, #min, #max for partially comparable values. (#8490, thanks @TedTran2019)
    • ๐Ÿ›  Fixed Hash#rehash. (#8450, thanks @asterite)
    • ๐Ÿ›  Fixed Array range assignment index out of bounds. (#8347, thanks @asterite)
    • ๐Ÿ›  Fixed endless ranged support for String#[]? and Array#[]?. (#8567, thanks @KarthikMAM)
    • Add Hash#compare_by_identity and Set#compare_by_identity. (#8451, thanks @asterite)
    • Add Enumerable#each_cons_pair and Iterator#cons_pair yielding a tuple. (#8332, thanks @straight-shoota)
    • Add offset argument to all map_with_index methods. (#8264, thanks @asterite)
    • ๐ŸŽ (performance) Optimized version of Tuple#to_a. (#8265, thanks @asterite)
    • โž• Add docs to Hash.merge!(other : Hash, &). (#8380, thanks @jan-zajic)
    • โž• Add docs to Hash.select. (#8391, thanks @jan-zajic)
    • โž• Add docs and specs to Enumerable.reduce. (#8378, thanks @jan-zajic)

    Serialization

    • (breaking-change) Make XML::Reader#expand raise, introduce XML::Reader#expand? for former behavior. (#8186, thanks @Blacksmoke16)
    • ๐Ÿ‘ Allow JSON.mapping & YAML.mapping converter attribute to be applied to Array and Hash. (#8156, thanks @rodrigopinto)
    • Add use_json_discriminator and use_yaml_discriminator to choose type based on property value. (#8406, thanks @asterite)
    • Remove return type self restriction from Object.from_json and Object.from_yaml. (#8489, thanks @straight-shoota)

    Files

    • (breaking-change) Remove expand home (~) by default in File.expand_path and Path#expand, now opt-in argument. (#7903, thanks @didactic-drunk)
    • Fixed bugs in Path regarding #dirname, #each_part, #each_parent. (#8415, thanks @jan-zajic)
    • ๐Ÿ›  Fixed GZip::Reader and GZip::Writer to handle large data sizes. (#8421, thanks @straight-shoota)
    • ๐Ÿ›  Fixed File::Info#same_file? by providing access to 64 bit inode numbers. (#8355, thanks @didactic-drunk)

    Networking

    • ๐Ÿ›  Fixed HTTP::Response#mime_type returns nil on empty Content-Type header. (#8464, thanks @Sija)
    • ๐Ÿ›  Fixed handling of unidirectional SSL servers hang. (#8481, thanks @rdp)
    • โž• Add HTTP::Client#write_timeout. (#8507, thanks @Sija)
    • โšก๏ธ Updated mime type of .js files to text/javascript and include image/webp. (#8342, thanks @mamantoha)
    • ๐Ÿ”จ Refactor websocket protocol GUID string. (#8339, thanks @vlazar)

    Crypto

    • (breaking-change) Enforce single-line results of OpenSSL::DigestBase#base64digest via Base64.strict_encode. (#8215, thanks @j8r)

    Concurrency

    System

    โš™ Runtime

    Spec

    • ๐Ÿ›  Fixed --fail-fast behaviour. (#8453, thanks @asterite)
    • โž• Add before, after, and around hooks. (#8302, thanks @asterite)
    • Restrict the type returned by should_not be_nil and others. (#8412, thanks @asterite)
    • โž• Add ability to randomize specs via --order random|<seed-value>. (#8310, thanks @Fryguy)
    • โž• Add specs for Spec filters. (#8242, thanks @Fryguy)
    • โž• Add ability to tag specs. (#8068, thanks @Fryguy)

    Compiler

    • ๐Ÿ›  Fixed musl libc detection (Alpine 3.10 regression bug). (#8330, thanks @straight-shoota)
    • ๐Ÿ›  Fixed pragmas handling in macros. (#8256, thanks @asterite)
    • ๐Ÿ›  Fixed parser crash for 'alias Foo?'. (#8282, thanks @oprypin)
    • ๐Ÿ›  Fixed parser error on newline before closing parenthesis. (#8320, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed generic subtypes edge cases triggering no target defs error. (#8417, thanks @asterite)
    • ๐Ÿ›  Fixed cleanup of local vars reachable by macros. (#8529, thanks @asterite)
    • โž• Add support for LLVM 9. (#8358, thanks @RX14)
    • โž• Add --mcmodel option to compiler. (#8363, thanks @ffwff)
    • Disallow instance_sizeof on union. (#8399, thanks @asterite)
    • โž• Add mention to crystal <command> --help in help. (#3628, thanks @rdp)
    • ๐Ÿ‘Œ Improve error message when a filename is misspelled. (#8500, thanks @rdp)
    • ๐Ÿ‘‰ Show full path of locally compiled Crystal. (#8486, thanks @rdp)
    • Code cleanups. (#8460, thanks @veelenga)

    Language semantics

    • ๐Ÿ›  Fixed method lookup priority when type alias of union is used. (#8258, thanks @asterite)
    • ๐Ÿ›  Fixed visibility modifiers in virtual types. (#8562, thanks @asterite)
    • ๐Ÿ›  Fixed sizeof(Bool). (#8273, thanks @asterite)

    Tools

    Formatter

    • ๐Ÿ›  Fixed indent in arguments. (#8315, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed crash related to parenthesis on generic types. (#8501, thanks @asterite)

    Doc generator

    Playground

    • Do not collapse whitespaces in playground sidebar. (#8528, thanks @hugopl)

    Others