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 aProc(Nil)
. (#8969, #8970, thanks @asterite)
Standard library
- (breaking-change) Replace
Errno
,WinError
,IO::Timeout
withRuntimeError
,IO::TimeoutError
,IO::Error
,File::Error
,Socket::Error
, and subclasses. (#8885, thanks @waj) - (breaking-change) Replace
Logger
module in favor ofLog
module. (#8847, #8976, thanks @bcardiff) - (breaking-change) Move
Adler32
andCRC32
toDigest
. (#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 obsoleteflag?(: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
andBigInt#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 ofColorize.with
. (#8892, #8958, thanks @bcardiff, @oprypin) - โ Add overloads for
String#ljust
,String#rjust
andString#center
that take anIO
. (#8923, thanks @asterite) - โ Add missing
Regex#hash
andRegex::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
toCrystal
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 anEnumerable
private definition. (#8884, thanks @bcardiff)
Serialization
- (breaking-change) Rename
YAML::Builder.new
with block toYAML::Builder.build
. (#8896, thanks @straight-shoota) - โ Add
XML.build_fragment
. (#8813, thanks @straight-shoota) - โ Add
CSV#rewind
. (#8912, thanks @asterite) - Add
Deque#from_json
andDeque#to_json
. (#8850, thanks @carlhoerberg) - ๐ Call to
IO#flush
onCSV
,INI
,JSON
,XML
, andYAML
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 closedFile
/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 underlyingIO
. (#8908, thanks @carlhoerberg)
Networking
- (breaking-change) Correctly support WebSocket close codes. (#8975, #8981, thanks @RX14, @Sija)
- ๐ Make
HTTP::Client
return emptybody_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
, andHTTP::WebSocket
specs to ensure server is accepting before closing. (#8755, #8879, thanks @bcardiff) - โ Add type annotation to
tls
argument inHTTP
. (#8678, thanks @j8r) - โ Add
Location
toHTTP::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
toCrystal
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
- (breaking-change) Exhaustive