Skip to content

Ruby 3.4.0-preview1 Released #3240

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
May 16, 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
5 changes: 5 additions & 0 deletions _data/branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
# date: date of first stable release (YYYY-MM-DD)
# eol_date: date of EOL (YYYY-MM-DD)

- name: 3.4
status: preview
date:
eol_date:

- name: 3.3
status: normal maintenance
date: 2023-12-25
Expand Down
1 change: 1 addition & 0 deletions _data/downloads.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# optional
preview:

- 3.4.0-preview1

stable:

Expand Down
31 changes: 31 additions & 0 deletions _data/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,37 @@
# In order to get the release listed on the downloads page,
# you also need to add an entry to `_data/downloads.yml'.

# 3.4 series

- version: 3.4.0-preview1
date: 2024-05-16
post: /en/news/2024/05/16/ruby-3-4-0-preview1-released/
tag: v3_4_0_preview1
stats:
files_changed: 3283
insertions: 107449
deletions: 115380
url:
gz: https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview1.tar.gz
zip: https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview1.zip
xz: https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.0-preview1.tar.xz
size:
gz: 22507726
zip: 27731060
xz: 16709536
sha1:
gz: 1619cbe06b5a8c774711b3351d18bb0f84f1d017
zip: 5d79834050369ea9241d86467bf93e9e89e2ab7a
xz: 6041ad2651527d01c36106de3d3cdab680ed3132
sha256:
gz: 1a3c322e90cb22e5fba0b5d257bb2be9988affa3867eba7642ed981fdde895bb
zip: bd2a6c0e8396698e6f6768c00b0f155510859bb6fb92420f7b7abec610e71dbb
xz: 4ee4ec44366050d4b2ee1d88034cc63e0b9174a1a6650285777f3d3447213a97
sha512:
gz: 29c0e32179f7b823b6708f5328e495cd333fe8dd88f7df7d9051deab47add67b14d899bba565bba1a77e1b04c9693d9708541445c112925777bb6891cb7b2b62
zip: 36ea6897e6ad769141516f4c1bb18989fbde27a76f0f3abcce947f8b6b79639846ba93907e085181f7d305ab06ad73f1bbb37928049c8c951d33176ee444abbf
xz: 4ce306b9beb1e2d88c76d7f809724b66bed17e354c07a2b54aa050fc2035652e4d83deadc8dbf7a375bbdb1c816f2996334bb8e7ff5e6c24b71a858bf6b0cb7c

# 3.3 series

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

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

## 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 arrays 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