Skip to content

Ruby 3.4.0 Preview 2 Released #3379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _data/downloads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# optional
preview:

- 3.4.0-preview1
- 3.4.0-preview2

stable:

Expand Down
29 changes: 29 additions & 0 deletions _data/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,35 @@

# 3.4 series

- version: 3.4.0-preview2
date: 2024-10-07
post: /en/news/2024/10/07/ruby-3-4-0-preview2-released/
tag: v3_4_0_preview2
stats:
files_changed: 4422
insertions: 163889
deletions: 243380
url:
gz: https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview2.tar.gz
zip: https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview2.zip
xz: https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview2.tar.xz
size:
gz: 22722332
zip: 28101194
xz: 16878876
sha1:
gz: c23265acf6c07b4c1df1e41eebf8b4cf2f25b97b
zip: 479bd223bca3225fb3a15984e3eae4efb9a40189
xz: dbff404b969012702dc500cac72f4d6b3822068e
sha256:
gz: 443cd7ec54ade4786bc974ce9f5d49f172a60f8edc84b597b7fe2bd2a94b8371
zip: e00a6fbf6f9e25a725711a8aac7e38be6bed61de4db9862a405172b96bf38b5b
xz: 626bf4fe952323c15ec9a8999f470ec136ef91c0fc34c484646aaaa9a0b62ca7
sha512:
gz: 0946d256587597bdf13437a50f7a3298c151133edea161a1c4806a04dcbd8c2e8a7fd617f3eda16c5c05f6e6346317562cc30ba67698f1fdd92237c03bdbd23e
zip: 0d9ee1c41920e4d594b0f2c40d02339b4e9a2cd5232f5ee914cab5a685cb4a2279fbbfd8fbad40ef0a53866db4e1de96068c62580ede6d8fab02550393bcbe81
xz: f23257896a35d3a581cbf5e8c94fe28e45725e39608a7669f47f31085338b1b4929a4db40d826d8fee628afb97b0c25b2f9e7bda4cd42e80c1208c46caf54265

- version: 3.4.0-preview1
date: 2024-05-16
post: /en/news/2024/05/16/ruby-3-4-0-preview1-released/
Expand Down
144 changes: 144 additions & 0 deletions en/news/_posts/2024-10-07-ruby-3-4-0-preview2-released.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
---
layout: news_post
title: "Ruby 3.4.0 preview2 Released"
author: "naruse"
translator:
date: 2024-10-07 00:00:00 +0000
lang: en
---

{% assign release = site.data.releases | where: "version", "3.4.0-preview2" | first %}
We are pleased to announce the release of Ruby {{ release.version }}.
In

## Prism

Switch the default parser from parse.y to Prism. [[Feature #20564]]

## Language changes

* String literals in files without a `frozen_string_literal` comment now behave
as if they were frozen. If they are mutated a deprecation warning is emitted.
These warnings can be enabled with `-W:deprecated` or by setting `Warning[:deprecated] = true`.
To disable this change, you can run Ruby with the `--disable-frozen-string-literal`
command line argument. [[Feature #20205]]

* `it` is added to reference a block parameter. [[Feature #18980]]

* Keyword splatting `nil` when calling methods is now supported.
`**nil` is treated similarly to `**{}`, passing no keywords,
and not calling any conversion methods. [[Bug #20064]]

* Block passing is no longer allowed in index. [[Bug #19918]]

* Keyword arguments are no longer allowed in index. [[Bug #20218]]

## Core classes updates

Note: We're only listing outstanding class updates.

* Exception

* `Exception#set_backtrace` now accepts an array of `Thread::Backtrace::Location`.
`Kernel#raise`, `Thread#raise` and `Fiber#raise` also accept this new format. [[Feature #13557]]

* Range

* `Range#size` now raises `TypeError` if the range is not iterable. [[Misc #18984]]



## Compatibility issues

Note: Excluding feature bug fixes.

* Error messages and backtrace displays have been changed.
* Use a single quote instead of a backtick as a opening quote. [[Feature #16495]]
* Display a class name before a method name (only when the class has a permanent name). [[Feature #19117]]
* `Kernel#caller`, `Thread::Backtrace::Location`'s methods, etc. are also changed accordingly.
```
Old:
test.rb:1:in `foo': undefined method `time' for an instance of Integer
from test.rb:2:in `<main>'

New:
test.rb:1:in 'Object#foo': undefined method 'time' for an instance of Integer
from test.rb:2:in `<main>'
```


## C API updates

* `rb_newobj` and `rb_newobj_of` (and corresponding macros `RB_NEWOBJ`, `RB_NEWOBJ_OF`, `NEWOBJ`, `NEWOBJ_OF`) have been removed. [[Feature #20265]]
* Removed deprecated function `rb_gc_force_recycle`. [[Feature #18290]]

## Implementation improvements

* `Array#each` is rewritten in Ruby for better performance [[Feature #20182]].

## Miscellaneous changes

* Passing a block to a method which doesn't use the passed block will show
a warning on verbose mode (`-w`).
[[Feature #15554]]

* Redefining some core methods that are specially optimized by the interpeter
and JIT like `String.freeze` or `Integer#+` now emits a performance class
warning (`-W:performance` or `Warning[:performance] = true`).
[[Feature #20429]]

See GitHub releases like [Logger](https://github.com/ruby/logger/releases) or
changelog for details of the default gems or bundled gems.

See [NEWS](https://github.com/ruby/ruby/blob/{{ release.tag }}/NEWS.md)
or [commit logs](https://github.com/ruby/ruby/compare/v3_3_0...{{ release.tag }})
for more details.

With those changes, [{{ release.stats.files_changed }} files changed, {{ release.stats.insertions }} insertions(+), {{ release.stats.deletions }} deletions(-)](https://github.com/ruby/ruby/compare/v3_3_0...{{ release.tag }}#file_bucket)
since Ruby 3.3.0!


## Download

* <{{ release.url.gz }}>

SIZE: {{ release.size.gz }}
SHA1: {{ release.sha1.gz }}
SHA256: {{ release.sha256.gz }}
SHA512: {{ release.sha512.gz }}

* <{{ release.url.xz }}>

SIZE: {{ release.size.xz }}
SHA1: {{ release.sha1.xz }}
SHA256: {{ release.sha256.xz }}
SHA512: {{ release.sha512.xz }}

* <{{ release.url.zip }}>

SIZE: {{ release.size.zip }}
SHA1: {{ release.sha1.zip }}
SHA256: {{ release.sha256.zip }}
SHA512: {{ release.sha512.zip }}

## What is Ruby

Ruby was first developed by Matz (Yukihiro Matsumoto) in 1993,
and is now developed as Open Source. It runs on multiple platforms
and is used all over the world especially for web development.

[Feature #13557]: https://bugs.ruby-lang.org/issues/13557
[Feature #15554]: https://bugs.ruby-lang.org/issues/15554
[Feature #16495]: https://bugs.ruby-lang.org/issues/16495
[Feature #18290]: https://bugs.ruby-lang.org/issues/18290
[Feature #18980]: https://bugs.ruby-lang.org/issues/18980
[Misc #18984]: https://bugs.ruby-lang.org/issues/18984
[Feature #19117]: https://bugs.ruby-lang.org/issues/19117
[Bug #19918]: https://bugs.ruby-lang.org/issues/19918
[Bug #20064]: https://bugs.ruby-lang.org/issues/20064
[Feature #20182]: https://bugs.ruby-lang.org/issues/20182
[Feature #20205]: https://bugs.ruby-lang.org/issues/20205
[Bug #20218]: https://bugs.ruby-lang.org/issues/20218
[Feature #20265]: https://bugs.ruby-lang.org/issues/20265
[Feature #20429]: https://bugs.ruby-lang.org/issues/20429
[Feature #20564]: https://bugs.ruby-lang.org/issues/20564