From a52e2ba0c8256f54c62e4f73726ce67f8a6baead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Mon, 9 Oct 2023 21:16:35 +0200 Subject: [PATCH 1/3] Release post for 1.10.0 --- _releases/2023-10-09-1.10.0-released.md | 84 +++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 _releases/2023-10-09-1.10.0-released.md diff --git a/_releases/2023-10-09-1.10.0-released.md b/_releases/2023-10-09-1.10.0-released.md new file mode 100644 index 00000000..b7505268 --- /dev/null +++ b/_releases/2023-10-09-1.10.0-released.md @@ -0,0 +1,84 @@ +--- +title: Crystal 1.10.0 is released! +version: 1.10.0 +summary: +thumbnail: + +author: straight-shoota +--- + +We are delivering a new Crystal release with several bugfixes and improvements. + +Pre-built packages are available on [GitHub Releases](https://github.com/crystal-lang/crystal/releases/tag/1.10.0) +and our official distribution channels. +See [crystal-lang.org/install](https://crystal-lang.org/install/) for +installation instructions. + +## Stats + +This release includes [82 changes since 1.9.2](https://github.com/crystal-lang/crystal/pulls?q=is%3Apr+milestone%3A1.10.0) +by 21 contributors. We thank all the contributors for all the effort put into +improving the language! ❤️ + +## Changes + +Below we list the most remarkable changes in the language, compiler and stdlib. +For more details, visit the [changelog](https://github.com/crystal-lang/crystal/releases/tag/1.10.0). + +This release does not bring any big impact changes, but smaller enhancements and +bug fixes, stabilizing the compiler and standard library. + +### Unlimited block unpacking + +The most notable language change is the introduction of unlimited block +unpacking ([#11597](https://github.com/crystal-lang/crystal/pull/11597)). + +Block parameter unpacking can now be nested. + +```crystal +ary = [ + {1, {2, {3, 4}}}, +] + +ary.each do |(w, (x, (y, z)))| + w # => 1 + x # => 2 + y # => 3 + z # => 4 +end +``` + +Splat parameters are also supported. + +```crystal +ary = [ + [1, 2, 3, 4, 5], +] + +ary.each do |(x, *y, z)| + x # => 1 + y # => [2, 3, 4] + z # => 5 +end +``` + +### Breaking: `crystal spec` exists with failure when focused + +If the spec suite has any examples with `focus: true`, the spec process will +always exit with a failure code. Even if all executed specs succeed. +This is to prevent CI success when a `focus: true` is accidentally commited. ([#13653](https://github.com/crystal-lang/crystal/pull/13653)) + +### Compiler tools: `dependencies` and `unreachable` + +Two new compiler tools are available for analyzing the program source. + +* [`crystal tool dependencies`](https://crystal-lang.org/reference/1.10/man/crystal#crystal-tool-dependencies) + prints a tree of required source files. This can be useful for separating + source trees or debugging issues with require order. +* [`crystal tool unreachable`](https://crystal-lang.org/reference/1.10/man/crystal#crystal-tool-unreachable) + prints methods that are defined but never called. This can help cleaning up + unused code. + +### Deprecations + +* `HTTP::StaticFileHandler.new` parameters `fallthrough` and `directory_listing` + other type than `Bool`. From baeeb839dda0334ef1fc38c15d9489a9c48c5a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 10 Oct 2023 10:48:15 +0200 Subject: [PATCH 2/3] Apply suggestions from code review Co-authored-by: Beta Ziliani --- _releases/2023-10-09-1.10.0-released.md | 27 +++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/_releases/2023-10-09-1.10.0-released.md b/_releases/2023-10-09-1.10.0-released.md index b7505268..f7f58ca4 100644 --- a/_releases/2023-10-09-1.10.0-released.md +++ b/_releases/2023-10-09-1.10.0-released.md @@ -73,10 +73,33 @@ Two new compiler tools are available for analyzing the program source. * [`crystal tool dependencies`](https://crystal-lang.org/reference/1.10/man/crystal#crystal-tool-dependencies) prints a tree of required source files. This can be useful for separating - source trees or debugging issues with require order. + source trees or debugging issues with require order. For instance, if we have a file `two_features.cr` requiring `feature1.cr` and `feature2.cr`, and each of these in turn require `common.cr`, and this last one requires stdlib's `big` package. We can run + + crystal tool dependencies two_features.cr + + to obtain the order in which files are processed: + + feature1.cr + common.cr + feature2.cr + * [`crystal tool unreachable`](https://crystal-lang.org/reference/1.10/man/crystal#crystal-tool-unreachable) prints methods that are defined but never called. This can help cleaning up - unused code. + unused code. For instance, if we have a file required by `our_program.cr` with the following code: + + def top_not_used + end + + class NotUsed + def class_not_used + end + end + +And the two defs are not called anywhere else, then `crystal tool unreachable our_program.cr` outputs (edited): + + [...]/src/common.cr:3:1 top-level top_not_used 2 lines + [...]/src/common.cr:7:3 NotUsed#class_not_used 2 lines + ### Deprecations From ea46346522d606525131539ace80f13a93bda176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCller?= Date: Tue, 10 Oct 2023 10:55:51 +0200 Subject: [PATCH 3/3] Reformat tool examples --- _releases/2023-10-09-1.10.0-released.md | 46 +++++++++++++++---------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/_releases/2023-10-09-1.10.0-released.md b/_releases/2023-10-09-1.10.0-released.md index f7f58ca4..f707b573 100644 --- a/_releases/2023-10-09-1.10.0-released.md +++ b/_releases/2023-10-09-1.10.0-released.md @@ -73,33 +73,41 @@ Two new compiler tools are available for analyzing the program source. * [`crystal tool dependencies`](https://crystal-lang.org/reference/1.10/man/crystal#crystal-tool-dependencies) prints a tree of required source files. This can be useful for separating - source trees or debugging issues with require order. For instance, if we have a file `two_features.cr` requiring `feature1.cr` and `feature2.cr`, and each of these in turn require `common.cr`, and this last one requires stdlib's `big` package. We can run + source trees or debugging issues with require order. - crystal tool dependencies two_features.cr + For instance, if we have a file `two_features.cr` requiring `feature1.cr` and + `feature2.cr`, and each of these in turn require `common.cr`, and this last + one requires stdlib's `big` package. - to obtain the order in which files are processed: - - feature1.cr - common.cr - feature2.cr + ```console + $ crystal tool dependencies two_features.cr + feature1.cr + common.cr + feature2.cr + ``` * [`crystal tool unreachable`](https://crystal-lang.org/reference/1.10/man/crystal#crystal-tool-unreachable) prints methods that are defined but never called. This can help cleaning up - unused code. For instance, if we have a file required by `our_program.cr` with the following code: - - def top_not_used - end + unused code. - class NotUsed - def class_not_used - end - end + For instance, if we have a file defing the following methods which are never + called anywhere: -And the two defs are not called anywhere else, then `crystal tool unreachable our_program.cr` outputs (edited): - - [...]/src/common.cr:3:1 top-level top_not_used 2 lines - [...]/src/common.cr:7:3 NotUsed#class_not_used 2 lines + ```crystal + def top_not_used + end + class Foo + def not_used + end + end + ``` + + ```console + $ crystal tool unreachable source.cr + source.cr:3:1 top-level top_not_used 2 lines + source.cr:7:3 Foo#not_used 2 lines + ``` ### Deprecations