We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
rails changelog
Here's a delightful roundup of the latest and greatest updates to keep your code running smoothly and efficiently. ๐
Bugfix: Fixed the default Docker build for Ruby images by reintroducing the libyaml-dev
package. This essential package was previously removed, causing issues with installing and building the psych
gem. Now your Ruby applications can build without a hitch! ๐
Improvement: Enhanced the node plaintext conversion process by excluding script
and style
content. This means cleaner and more relevant plaintext outputs, free from the clutter of JavaScript and CSS code. Your text conversions just got a lot tidier! ๐งน
Bugfix: Stopped duplicating frozen query values in ActiveRecord. If you're using frozen string literals, this fix ensures that your frozen strings aren't unnecessarily duplicated in where
calls, boosting performance and memory efficiency. Your Ruby app will now run smoother than ever! ๐จ
Improvement: Optimized model instantiation by eliminating allocations during Model.respond_to?
calls. This tweak reduces initialization costs and enhances performance, making your model queries zippier. Say goodbye to unnecessary memory allocations! ๐๏ธ
Bugfix: Fixed ActionDispatch::Request::HTTP_METHOD_LOOKUP
from being affected by unwanted inflections introduced by gems. This ensures that HTTP methods remain consistent, regardless of external library modifications. Your HTTP requests are now more reliable! ๐
Improvement: Streamlined the autosave process for collection associations by skipping already persisted targets. This reduces unnecessary database operations, leading to better performance and faster response times. Your data manipulations just got a performance boost! ๐
Chore: Cleaned up the documentation by making FilterParameters#ENV_MATCH
, NULL_ENV_FILTER
, and NULL_PARAM_FILTER
nodoc. This helps keep the API documentation focused and concise, ensuring developers only see the most relevant information. Less clutter, more clarity! ๐๏ธ
These updates are crafted to enhance your development experience, making your applications more efficient, reliable, and easy to maintain. Enjoy coding! ๐ปโจ
Included Commits
This commit introduces a modification to the autosaving behavior of collection associations in the application. Specifically, it ensures that when autosaving occurs, any targets that have already been persisted are skipped, preventing unnecessary database operations and improving efficiency. This change aims to optimize performance by reducing redundant saves for objects that do not require updates.
Overall, the update enhances the handling of collection associations by streamlining the autosave process, which can lead to better resource management and faster response times during data manipulation tasks. This adjustment is particularly beneficial in scenarios where large collections are involved, as it minimizes the overhead associated with saving unchanged records.
Files changed
This commit focuses on optimizing the performance of model instantiation in ActiveRecord by eliminating memory allocations during calls to Model.respond_to?
. Profiling revealed that these allocations contributed to the overhead of initializing models, such as when calling Post.new
. By modifying the implementation of respond_to?
, the patch aims to reduce initialization costs and improve overall performance for model queries.
The benchmark tests conducted before and after the patch demonstrated a reduction in allocations per model instantiation and a complete elimination of allocations during respond_to?
calls. Before the patch, creating a new Post
model allocated an average of 9 objects, while respond_to?
calls allocated 2 objects. After the changes, these numbers decreased to 7 and 0, respectively, showcasing a significant enhancement in efficiency. The commit was co-authored by Eileen M. Uchitelle.
Files changed
The commit removes documentation for the constants ENV_MATCH
, NULL_ENV_FILTER
, and NULL_PARAM_FILTER
in the FilterParameters
module of ActionDispatch in Ruby on Rails. This decision likely reflects a move to streamline the documentation by eliminating references to constants that may no longer be relevant or necessary for users.
By making these constants undocumented, the commit aims to reduce confusion and improve the clarity of the API, ensuring that developers focus on the most pertinent and actively maintained features. This change is part of ongoing efforts to keep the Rails documentation clean and up-to-date.
Files changed
This commit addresses an issue where query values in ActiveRecord are unnecessarily duplicated even when they are frozen, specifically when the frozen_string_literal
feature is enabled in Ruby. The commit highlights that strings like "foo" and "bar" in a default scope defined in a model would still be duplicated, which is inefficient.
The change aims to prevent the duplication of frozen values in all where
calls, not limited to just default scopes. By implementing this fix, the commit enhances performance and memory efficiency by recognizing and preserving the immutability of frozen string literals, which are increasingly utilized in Ruby applications.
Files changed
This commit introduces a modification to the node plaintext conversion process by excluding the content of script
and style
tags. The rationale behind this change is to ensure that any JavaScript or CSS code present within these tags does not interfere with the plaintext output, thereby enhancing the clarity and relevance of the converted text.
As a result of this update, when converting a node to plaintext, any content encapsulated within script
or style
elements will be ignored, leading to a cleaner and more focused representation of the node's textual content. This change aims to improve the usability of the plaintext output for end-users or further processing tasks.
Files changed
This commit addresses an issue with the ActionDispatch::Request::HTTP_METHOD_LOOKUP
being adversely affected by inflections introduced by external gems. When a gem adds custom inflections before the action_dispatch/http/request
module is loaded, it can lead to incorrect transformations of HTTP method names. For instance, if a gem defines "OS" as an acronym, the method #underscore
may incorrectly convert "POST" to :p_os_t
, resulting in invalid method identifiers.
To resolve this issue, the commit implements changes that ensure the integrity of HTTP method lookups by isolating the inflection logic from external gem modifications. This ensures that the core functionality of handling HTTP methods remains consistent and reliable, regardless of any inflections introduced by other libraries in the application.
Files changed
This commit addresses an issue with the default Docker build for Ruby images, specifically related to the removal of the libyaml-dev
package, which is necessary for installing and building the psych
gem. The change was prompted by a recent update in the Ruby Docker images that omitted this essential package.
In the modified file railties/lib/rails/generators/app_base.rb
, the code for defining the dockerfile_build_packages
has been updated to include libyaml-dev
in the list of essential packages. This ensures that the required dependencies for building Ruby applications remain intact, thereby preventing potential build failures related to the psych
gem.
Files changed
- railties/lib/rails/generators/app_base.rb