crystal v0.27.1 Release Notes

Release Date: 2019-01-30 // about 5 years ago
  • Language changes

    • ๐Ÿ‘ Allow trailing commas inside tuple types. (#7182, thanks @asterite)

    Standard library

    • ๐ŸŽ (performance) Optimize generating UUID from String. (#7030, thanks @jgaskins)
    • ๐ŸŽ (performance) Improve SemanticVersion operations. (#7234, thanks @j8r)
    • ๐Ÿ›  Fixed markdown inline code parsing. (#7090, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed inappropriate uses of Time.now. (#7155, thanks @straight-shoota)
    • ๐Ÿ‘‰ Make Nil#not_nil! raise NilAssertionError. (#7330, thanks @r00ster91)
    • โž• Add SemanticVersion to API docs. (#7003, thanks @Blacksmoke16)
    • โž• Add docs to discourage the use of Bool#to_unsafe other than for C bindings. (#7320, thanks @oprypin)
    • ๐Ÿ”จ Refactor #to_s to be independent of the name method. (#7295, thanks @asterite)

    Macros

    • ๐Ÿ›  Fixed docs of ArrayLiteral#unshift. (#7127, thanks @Blacksmoke16)
    • ๐Ÿ›  Fixed Annotation#[] to accept String and Symbol as keys. (#7153, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed NamedTupleLiteral#[] to raise a compile error for invalid key type. (#7158, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed getter/property macros to work properly with Bool types. (#7313, thanks @Sija)
    • โž• Add read_file macro method. (#6967, #7094, thanks @Sija, @woodruffw)
    • โž• Add StringLiteral#count. (#7239, thanks @Blacksmoke16)

    Numeric

    • ๐Ÿ›  Fixed scale issues when dividing BigDecimal. (#7218, thanks @Sija)
    • ๐Ÿ‘ Allow underscores in the String passed to Big* constructors. (#7107, thanks @Sija)
    • โž• Add conversion methods and docs to Complex. (#5440, thanks @Sija)
    • โž• Add specs for Int128, UInt128. (#7173, thanks @bcardiff)
    • Add unsafe number ops value.to_X!/T.new!/Int#&**. (#7226, thanks @bcardiff)
    • โž• Add overflow detection with preview opt-in. (#7206, thanks @bcardiff)

    Text

    • ๐Ÿ›  Fixed ECR location error reported. (#7137, thanks @MakeNowJust)
    • โž• Add docs to ECR. (#7121, thanks @KCErb)
    • ๐Ÿ”จ Refactor String#to_i to avoid future overflow. (#7172, thanks @bcardiff)

    Collections

    • ๐Ÿ›  Fixed docs example in Hash#from. (#7210, thanks @r00ster91)
    • ๐Ÿ›  Fixed docs links of Enumerable#chunks and Iterator#chunk. (#6941, thanks @r00ster91)
    • โœ‚ Remove implicit null skip from Hash to JSON serialization. (#7053, thanks @MakeNowJust)
    • โž• Add Iterator#slice_after. (#7146, thanks @asterite)
    • โž• Add Iterator#slice_before. (#7152, thanks @asterite)
    • Add Iteratory#slice_when and Iterator#chunk_while. (#7159, thanks @asterite)
    • โž• Add Enumerable#to_h(&block). (#7150, thanks @Sija)
    • โž• Add Enumerable#one?. (#7166, thanks @asterite)
    • โž• Add several Enumerable, Iterator and Array overloads that accept a pattern. (#7174, thanks @asterite)
    • โž• Add docs to hash constructors. (#6923, thanks @KCErb)

    Serialization

    • โž• Add conversion between JSON and YAML. (#7232, thanks @straight-shoota)
    • Standardize #as_T/#as_T? methods between JSON::Any/YAML::Any. (#6556, thanks @j8r)
    • โž• Add Set#from_yaml. (#6310, thanks @kostya)

    Time

    • ๐Ÿ›  Fixed Time::Span initializer and sleep for big seconds. (#7221, thanks @asterite)
    • ๐Ÿ›  Fixed docs to show proper use of parse. (#7035, thanks @jwoertink)
    • โž• Add missing Float#weeks method similar to Int#weeks. (#7165, thanks @vlazar)

    Files

    • ๐Ÿ›  Fix mkstemps support on aarch64. (#7300, thanks @silmanduin66)
    • Validate LibC error codes in specs involving Errno errors. (#7087, thanks @straight-shoota)
    • โž• Add microsecond precision to System::File.utime (Unix). (#7156, thanks @straight-shoota)
    • โž• Add missing tempfile cleanup in specs. (#7250, thanks @bcardiff)
    • โž• Add docs for file open modes. (#6664, thanks @r00ster91)

    Networking

    • ๐Ÿ›  Fixed HTTP::Client edge case of exception during in TLS initialization. (#7123, thanks @asterite)
    • ๐Ÿ›  Fixed OpenSSL::SSL::Error.new to not raise Errno. (#7068, thanks @straight-shoota)
    • ๐Ÿ›  Fixed URI encoding in StaticFileHandler::DirectoryListing. (#7072, thanks @Sija)
    • โž• Add MIME registry. (#5765, #7079, #7080, thanks @straight-shoota, @Sija)
    • โž• Add MIME::MediaType for parsing mime media types. (#7077, thanks @straight-shoota)
    • โž• Add support for 100-continue in HTTP::Server::Response. (#6912, thanks @jreinert)
    • โž• Add support for creating sockets from raw file descriptors. (#6894, thanks @myfreeweb)
    • โž• Add SNI support for OpenSSL. (#7291, thanks @bararchy)
    • ๐Ÿ‘Œ Improve HTTP::Server docs. (#7251, thanks @straight-shoota)
    • ๐Ÿ”จ Refactor OpenSSL specs to reduce chances of failing. (#7202, thanks @bcardiff)

    Crypto

    • โž• Add OpenSSL::Cipher#authenticated? to see if the cipher supports aead. (#7223, thanks @danielwestendorf)

    System

    • ๐Ÿ›  Fixed inline ASM when compiling for ARM. (#7041, thanks @omarroth)
    • Implement Crystal::System for Win32. (#6972, thanks @markrjr)
    • โž• Add Errno#errno_message getter. (#6702, thanks @r00ster91)

    Spec

    • Detect nesting it and pending at run-time. (#7297, thanks @MakeNowJust)

    Compiler

    • ๐Ÿ›  Fixed how LLVM::Type.const_int emit Int128 literals. (#7135, thanks @bcardiff)
    • ๐Ÿ›  Fixed ICE related to named tuples. (#7163, thanks @asterite)
    • ๐Ÿ›  Fixed automatic casting for private top-level methods. (#7310, thanks @asterite)
    • Give proper error if defining initialize inside enum, allow Enum.new. (#7266, thanks @asterite)
    • Give proper error when trying to access instance variable of union type. (#7194, thanks @asterite)
    • Give proper error when trying to instantiate Module. (#6735, thanks @r00ster91)
    • Give proper error related to named arguments. (#7288, thanks @asterite)
    • ๐Ÿ“œ Parse required comma between block args. (#7343, thanks @asterite)
    • ๐Ÿ‘Œ Improve inference in recursion that involves blocks. (#7161, thanks @asterite)
    • โž• Add locations to all expanded macro arguments. (#7008, thanks @MakeNowJust)
    • Turn a not compiler specific error while requiring into ICE. (#7208, thanks @MakeNowJust)
    • โœ‚ Remove old nil? error on pointer types. (#7180, thanks @asterite)
    • ๐Ÿ‘Œ Improve too big tuple and named tuple error message. (#7131, thanks @r00ster91)
    • โ†ช Workaround buggy offset debug info values. (#7335, thanks @bcardiff)
    • ๐Ÿ”จ Refactor extract helper methods to emit Float32, Float64 values. (#7134, thanks @bcardiff)
    • ๐Ÿ”จ Refactor filename resolution logic out of interpret_run. (#7051, thanks @Sija)
    • ๐Ÿ”จ Refactor internals regarding overflow. (#7262, thanks @bcardiff)
    • ๐Ÿ”จ Refactor Crystal::Codegen::Target and consolidate triple handling. (#7282, #7317, thanks @RX14, @bcardiff)

    Tools

    • โšก๏ธ Update README template. (#7118, thanks @mamantoha)
    • Capitalise Crystal in CLI output. (#7224, thanks @dwightwatson)

    Formatter

    • ๐Ÿ›  Fixed formatting of multiline literal elements. (#7048, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed formatting of heredoc with interpolations. (#7184, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed prevent conflict between nested tuple types and macro expressions. (#7097, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed format when typeof appears inside generic type. (#7176, thanks @asterite)
    • ๐Ÿ›  Fixed format of newline after &.foo in call. (#7240, thanks @MakeNowJust)
    • Honor same behaviour for single or multiple file arguments. (#7144, thanks @straight-shoota)
    • ๐Ÿ”จ Refactor remove quotes from overflow symbols in formatter spec. (#6968, thanks @r00ster91)
    • Major rework of crystal tool format command. (#7257, thanks @MakeNowJust)

    Doc generator

    • ๐Ÿ”’ (security) Prevent XSS via args. (#7056, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed generation of toplevel. (#7063, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed display of double splat and block arg. (#7029, #7031, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed keep trailing spaces in macros. (#7099, thanks @MakeNowJust)
    • ๐Ÿ›  Fixed avoid showing subtypes of aliased type. (#7124, thanks @asterite)
    • ๐Ÿ›  Fixed style of methods when hovering. (#7022, thanks @r00ster91)
    • ๐Ÿ›  Fixed duplicate source_link field. (#7033, thanks @bcardiff)
    • ๐Ÿ›  Fixed missing keywords in Doc::Highlighter. (#7054, thanks @MakeNowJust)
    • โž• Add --format option to docs command. (#6982, thanks @mniak)

    Others

    • CI improvements and housekeeping. (#7018, #7043, #7133, #7139, #7230, #7227, #7263, thanks @bcardiff)
    • CI split formatting check. (#7228, thanks @bcardiff)
    • ๐Ÿ— Depend on standard variable to let the user define the build date. (#7186, thanks @eli-schwartz)
    • Reorganize community section in README, add forum. (#7235, thanks @straight-shoota)
    • ๐Ÿ›  Fixed docs grammar and typos. (#7034, #7242, #7331, thanks @r00ster91, @girng)
    • ๐Ÿ‘Œ Improve samples. (#6454, thanks @r00ster91)
    • ๐Ÿ›  Fixed 0.27.0 CHANGELOG. (#7024, thanks @arcage)
    • โšก๏ธ Update ISSUE_TEMPLATE to include forum. (#7301, thanks @straight-shoota)
    • โšก๏ธ Update LICENSE's copyright year. (#7246, thanks @matiasgarciaisaia)