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
fromString
. (#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!
raiseNilAssertionError
. (#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 thename
method. (#7295, thanks @asterite)
Macros
- ๐ Fixed docs of
ArrayLiteral#unshift
. (#7127, thanks @Blacksmoke16) - ๐ Fixed
Annotation#[]
to acceptString
andSymbol
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 withBool
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 toBig*
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
andIterator#chunk
. (#6941, thanks @r00ster91) - โ Remove implicit null skip from
Hash
toJSON
serialization. (#7053, thanks @MakeNowJust) - โ Add
Iterator#slice_after
. (#7146, thanks @asterite) - โ Add
Iterator#slice_before
. (#7152, thanks @asterite) - Add
Iteratory#slice_when
andIterator#chunk_while
. (#7159, thanks @asterite) - โ Add
Enumerable#to_h(&block)
. (#7150, thanks @Sija) - โ Add
Enumerable#one?
. (#7166, thanks @asterite) - โ Add several
Enumerable
,Iterator
andArray
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 betweenJSON::Any
/YAML::Any
. (#6556, thanks @j8r) - โ Add
Set#from_yaml
. (#6310, thanks @kostya)
Time
- ๐ Fixed
Time::Span
initializer andsleep
for big seconds. (#7221, thanks @asterite) - ๐ Fixed docs to show proper use of parse. (#7035, thanks @jwoertink)
- โ Add missing
Float#weeks
method similar toInt#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 raiseErrno
. (#7068, thanks @straight-shoota) - ๐ Fixed
URI
encoding inStaticFileHandler::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
andpending
at run-time. (#7297, thanks @MakeNowJust)
Compiler
- ๐ Fixed how
LLVM::Type.const_int
emitInt128
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)