crystal v0.34.0 Release Notes

Release Date: 2020-04-06 // about 4 years ago
  • Language changes

    • (breaking-change) Exhaustive case expression check added, for now it produces warnings. (#8424, #8962, thanks @asterite, @Sija)
    • Let Proc(T) be used as a Proc(Nil). (#8969, #8970, thanks @asterite)

    Standard library

    • (breaking-change) Replace Errno, WinError, IO::Timeout with RuntimeError, IO::TimeoutError, IO::Error, File::Error, Socket::Error, and subclasses. (#8885, thanks @waj)
    • (breaking-change) Replace Logger module in favor of Log module. (#8847, #8976, thanks @bcardiff)
    • (breaking-change) Move Adler32 and CRC32 to Digest. (#8881, thanks @bcardiff)
    • (breaking-change) Remove DL module. (#8882, thanks @bcardiff)
    • Enable more win32 specs. (#8683, #8822, thanks @straight-shoota)
    • ๐Ÿš€ Make SemanticVersion::Prerelease comparable. (#8991, thanks @MakeNowJust)
    • ๐Ÿ‘‰ Use flag?(:i386) instead of obsolete flag?(:i686). (#8863, thanks @bcardiff)
    • โœ‚ Remove Windows workaround using vsnprintf. (#8942, thanks @oprypin)
    • ๐Ÿ›  Fixed docs broken link to ruby's prettyprint source. (#8915, thanks @matthin)
    • โšก๏ธ Update OptionParser example to exit on --help. (#8927, thanks @vlazar)

    Numeric

    • ๐Ÿ›  Fixed Float32#to_s corner-case. (#8838, thanks @toddsundsted)
    • Fixed make Big*#to_u raise on negative values. (#8826, thanks @Sija)
    • Fixed BigDecimal#to_big_i regression. (#8790, thanks @Sija)
    • โž• Add Complex#round. (#8819, thanks @miketheman)
    • Add Int#bit_length and BigInt#bit_length. (#8924, #8931, thanks @asterite)
    • ๐Ÿ›  Fixed docs of Int#gcd. (#8894, thanks @nard-tech)

    Text

    • (breaking-change) Deprecate top-level with_color in favor of Colorize.with. (#8892, #8958, thanks @bcardiff, @oprypin)
    • โž• Add overloads for String#ljust, String#rjust and String#center that take an IO. (#8923, thanks @asterite)
    • โž• Add missing Regex#hash and Regex::MatchData#hash. (#8986, thanks @MakeNowJust)
    • โฌ†๏ธ Upgrade Unicode to 13.0.0. (#8906, thanks @Blacksmoke16)
    • โช Revert deprecation of String#codepoint_at. (#8902, thanks @vlazar)
    • ๐Ÿšš Move Iconv to Crystal namespace. (#8890, thanks @bcardiff)

    Collections

    • ๐Ÿ›  Fixed make Range#size raise on an open range. (#8829, thanks @Sija)
    • โž• Add Enumerable#empty?. (#8960, thanks @Sija)
    • ๐ŸŽ (performance) Optimized Implementation of Array#fill for zero Values. (#8903, thanks @toddsundsted)
    • ๐Ÿ”จ Refactor Reflect to an Enumerable private definition. (#8884, thanks @bcardiff)

    Serialization

    • (breaking-change) Rename YAML::Builder.new with block to YAML::Builder.build. (#8896, thanks @straight-shoota)
    • โž• Add XML.build_fragment. (#8813, thanks @straight-shoota)
    • โž• Add CSV#rewind. (#8912, thanks @asterite)
    • Add Deque#from_json and Deque#to_json. (#8850, thanks @carlhoerberg)
    • ๐Ÿ— Call to IO#flush on CSV, INI, JSON, XML, and YAML builders. (#8876, thanks @asterite)
    • โž• Add docs to Object.from_yaml. (#8800, thanks @wowinter13)

    Time

    • (breaking-change) Improve Time::Span initialization API with mandatory named arguments. (#8257, #8857, thanks @dnamsons, @bcardiff)
    • โž• Add Time::Span#total_microseconds. (#8966, thanks @vlazar)

    Files

    • ๐Ÿ›  Fixed multi-thread race condition by setting fd to -1 on closed File/Socket. (#8873, thanks @bcardiff)
    • ๐Ÿ›  Fixed File.dirname with unicode chars. (#8911, thanks @asterite)
    • Add IO::Buffered#flush_on_newline back and set it to true for non-tty. (#8935, thanks @asterite)
    • Forward missing methods of IO::Hexdump to underlying IO. (#8908, thanks @carlhoerberg)

    Networking

    • (breaking-change) Correctly support WebSocket close codes. (#8975, #8981, thanks @RX14, @Sija)
    • ๐Ÿ‘‰ Make HTTP::Client return empty body_io if content-length is zero. (#8503, thanks @asterite)
    • ๐Ÿ›  Fixed UDP specs in the case of a local firewall. (#8817, thanks @RX14)
    • ๐Ÿ›  Fixed MIME spec examples to not collide with actual registry. (#8795, thanks @straight-shoota)
    • ๐Ÿ›  Fixed UNIXServer, and HTTP::WebSocket specs to ensure server is accepting before closing. (#8755, #8879, thanks @bcardiff)
    • โž• Add type annotation to tls argument in HTTP. (#8678, thanks @j8r)
    • โž• Add Location to HTTP::Request common header names. (#8992, thanks @mamantoha)

    Concurrency

    • โž• Add docs on Future regarding exceptions. (#8860, thanks @rdp)
    • Disable occasionally failing Thread specs on musl. (#8801, thanks @straight-shoota)

    System

    • ๐Ÿ›  Fixed typo on src/signal.cr. (#8805, thanks @lbguilherme)

    โš™ Runtime

    • ๐Ÿ›  Fixed exceptions not being inspectable when running binary from PATH. (#8807, thanks @willhbr)
    • ๐Ÿšš Move AtExitHandlers to Crystal namespace. (#8883, thanks @bcardiff)

    Compiler

    • (breaking-change) Drop disable_overflow compiler flag. (#8772, thanks @Sija)
    • ๐Ÿ›  Fixed url in "can't infer block return type" error message. (#8869, thanks @nilium)
    • ๐Ÿ›  Fixed typo in math interpreter error message. (#8941, thanks @j8r)
    • 0๏ธโƒฃ Use CRYSTAL_OPTS environment variable as default compiler options. (#8900, thanks @bcardiff)
    • โš  Avoid using the default --exclude-warnings value if some is specified. (#8899, thanks @bcardiff)
    • 0๏ธโƒฃ Honor LIBRARY_PATH as default library path, and allow linking with no explicit /usr/lib:/usr/local/lib paths. (#8948, thanks @bcardiff)
    • ๐Ÿ›  Fix Windows LLVM globals codegen in non-single-module mode. (#8978, thanks @oprypin)
    • โž• Add support for LLVM 10. (#8940, thanks @RX14)
    • โœ‚ Remove redundant calls to Object.to_s in interpolation in compiler's code. (#8947, thanks @veelenga)

    Language semantics

    • Type as NoReturn if calling method on abstract class with no concrete subclasses. (#8870, thanks @asterite)

    Tools

    • โž• Add crystal init name validation. (#8737, thanks @straight-shoota)

    Doc generator

    • โš  Show warnings on docs command. (#8880, thanks @bcardiff)

    Others

    • CI improvements and housekeeping. (#8804, #8811, #8982, thanks @bcardiff, @oprypin)
    • โšก๏ธ Update to Shards 0.10.0. (#8988, thanks @bcardiff)
    • ๐Ÿ›  Fix pretty_json sample. (#8816, thanks @asterite)
    • ๐Ÿ›  Fix typos throughout the codebase. (#8971, thanks @Sija)