turbo-rails 2.0.13 → 2.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c101c43ed17c7c1ba0f1b6ede8ed3c9b9c7e13b8c9ad6e98c7d4f3cff549c36
4
- data.tar.gz: 6a752abd9a30eb3d8a1dae6029a7d2a0bfc125392ddf75a3affc6e4b75ed7c83
3
+ metadata.gz: e17d560cb33067c997c6cde1542866e726ab04635888c8f03e5c1617eb715939
4
+ data.tar.gz: adc7f9fb8409841348540ac39f68b1c0dd964d2ad2fa3bd98b14bdb83c92df95
5
5
  SHA512:
6
- metadata.gz: 41ff8c8acc27a382375cbeccc5c16d9525ec15bde56ac839e62fce5d018754e928d532dacaffad6d0c78466930d80b6cc1917c4990fc49132112323dafebb47d
7
- data.tar.gz: a58523957ab401c23136cb22a21e041a328ccc5afcccd177d7692b28051d1da47511a98d47cdb03ba2be8bc99f864a13c7b84c518207048137b122f748cc7270
6
+ metadata.gz: 4d840efa50eb5ffad82cd4aaf6965a8c1e764072df5a884138162fc2a72eef6fef2ad00f16bcc8867d765c8c6eae5edeb1f983baef251ce81fc342930495deea
7
+ data.tar.gz: d66318b79505d8439adbae704a387740026d87f09d9b126d10db03d6d518d741c6b08de3bbadd568e9226cc245fbf213b999cfe5467ea16f8fb7b183b88e341a
data/README.md CHANGED
@@ -182,7 +182,7 @@ import "@hotwired/turbo-rails"
182
182
 
183
183
  You can watch [the video introduction to Hotwire](https://hotwired.dev/#screencast), which focuses extensively on demonstrating Turbo in a Rails demo. Then you should familiarize yourself with [Turbo handbook](https://turbo.hotwired.dev/handbook/introduction) to understand Drive, Frames, and Streams in-depth. Finally, dive into the code documentation by starting with [`Turbo::FramesHelper`](https://github.com/hotwired/turbo-rails/blob/main/app/helpers/turbo/frames_helper.rb), [`Turbo::StreamsHelper`](https://github.com/hotwired/turbo-rails/blob/main/app/helpers/turbo/streams_helper.rb), [`Turbo::Streams::TagBuilder`](https://github.com/hotwired/turbo-rails/blob/main/app/models/turbo/streams/tag_builder.rb), and [`Turbo::Broadcastable`](https://github.com/hotwired/turbo-rails/blob/main/app/models/concerns/turbo/broadcastable.rb).
184
184
 
185
- Note that in development, the default Action Cable adapter is the single-process `async` adapter. This means that turbo updates are only broadcast within that same process. So you can't start `bin/rails console` and trigger Turbo broadcasts and expect them to show up in a browser connected to a server running in a separate `bin/dev` or `bin/rails server` process. Instead, you should use the web-console when needing to manaually trigger Turbo broadcasts inside the same process. Add "console" to any action or "<%= console %>" in any view to make the web console appear.
185
+ Note that in development, the default Action Cable adapter is the single-process `async` adapter. This means that turbo updates are only broadcast within that same process. So you can't start `bin/rails console` and trigger Turbo broadcasts and expect them to show up in a browser connected to a server running in a separate `bin/dev` or `bin/rails server` process. Instead, you should use the web-console when needing to manually trigger Turbo broadcasts inside the same process. Add "console" to any action or "<%= console %>" in any view to make the web console appear.
186
186
 
187
187
  ### RubyDoc Documentation
188
188
 
@@ -68,8 +68,10 @@ module Turbo::Streams::Broadcasts
68
68
  end
69
69
 
70
70
  def broadcast_refresh_later_to(*streamables, request_id: Turbo.current_request_id, **opts)
71
+ stream_name = stream_name_from(streamables)
72
+
71
73
  refresh_debouncer_for(*streamables, request_id: request_id).debounce do
72
- Turbo::Streams::BroadcastStreamJob.perform_later stream_name_from(streamables), content: turbo_stream_refresh_tag(request_id: request_id, **opts).to_str # Sidekiq requires job arguments to be valid JSON types, such as String
74
+ Turbo::Streams::BroadcastStreamJob.perform_later stream_name, content: turbo_stream_refresh_tag(request_id: request_id, **opts).to_str # Sidekiq requires job arguments to be valid JSON types, such as String
73
75
  end
74
76
  end
75
77
 
@@ -286,7 +286,7 @@ module Turbo::Broadcastable
286
286
  #
287
287
  # # sends <turbo-stream action="update" method="morph" target="clearance_5"><template><div id="clearance_5">Other partial</div></template></turbo-stream>
288
288
  # # to the stream named "identity:2:clearances"
289
- # # clearance.broadcast_update_to examiner.identity, :clearances, attributes: { method: :morph }, partial: "clearances/other_partial", locals: { a: 1 }
289
+ # clearance.broadcast_update_to examiner.identity, :clearances, attributes: { method: :morph }, partial: "clearances/other_partial", locals: { a: 1 }
290
290
  def broadcast_update_to(*streamables, **rendering)
291
291
  Turbo::StreamsChannel.broadcast_update_to(*streamables, **extract_options_and_add_target(rendering, target: self)) unless suppressed_turbo_broadcasts?
292
292
  end
@@ -518,7 +518,7 @@ module Turbo::Broadcastable
518
518
  options.tap do |o|
519
519
  # Add the current instance into the locals with the element name (which is the un-namespaced name)
520
520
  # as the key. This parallels how the ActionView::ObjectRenderer would create a local variable.
521
- o[:locals] = (o[:locals] || {}).reverse_merge!(model_name.element.to_sym => self).compact
521
+ o[:locals] = (o[:locals] || {}).reverse_merge(model_name.element.to_sym => self).compact
522
522
 
523
523
  if o[:html] || o[:partial]
524
524
  return o
@@ -1,5 +1,6 @@
1
1
  <html>
2
2
  <head>
3
+ <%= csrf_meta_tags %>
3
4
  <%= yield :head %>
4
5
  </head>
5
6
  <body>
data/lib/turbo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Turbo
2
- VERSION = "2.0.13"
2
+ VERSION = "2.0.14"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: turbo-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.13
4
+ version: 2.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Stephenson
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2025-03-03 00:00:00.000000000 Z
13
+ date: 2025-06-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionpack