Skip to content
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 CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ Please follow the recommendations outlined at [keepachangelog.com](http://keepac
### [Unreleased]
Changes since the last non-beta release.

### [14.2.1] - 2025-04-11

#### Fixed
- Fixed a bug where the `load` event was not firing in Safari by postponing hydration to the next JavaScript task using `setTimeout(callback, 0)`. [PR 1729](https://github.com/shakacode/react_on_rails/pull/1729) by [Romex91](https://github.com/Romex91).

### [14.2.0] - 2025-03-03

#### Added
Expand Down
2 changes: 1 addition & 1 deletion lib/react_on_rails/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module ReactOnRails
VERSION = "14.2.0"
VERSION = "14.2.1"
end
4 changes: 3 additions & 1 deletion node_package/src/clientStartup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,9 @@ function isWindow(context: Context): context is Window {

function onPageReady(callback: () => void) {
if (document.readyState === "complete") {
callback();
// When hydrating React from the `readystatechange` listener, Safari skips the `load` event.
// To avoid this, we use a timeout to postpone the callback until after the `load` event.
setTimeout(callback, 0);
} else {
document.addEventListener("readystatechange", function onReadyStateChange() {
onPageReady(callback);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-on-rails",
"version": "14.2.0",
"version": "14.2.1",
"description": "react-on-rails JavaScript for react_on_rails Ruby gem",
"main": "node_package/lib/ReactOnRails.full.js",
"exports": {
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: ../..
specs:
react_on_rails (14.2.0)
react_on_rails (14.2.1)
addressable
connection_pool
execjs (~> 2.5)
Expand Down
Loading