turbo-rails 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 02b7b8f50542dc4f9ab484c802b39f3d6534a8738eed4f9366df1b15f7df47b7
4
- data.tar.gz: c0d269a2181eb5f26b8cfa359e75f08fdcc7a3a16c3c7dd1eb83147db961d7cf
3
+ metadata.gz: 5a04c56491cef79ef30cdf087a1f1e4cd33d7673ac2cc48e239dfdda1d72eba9
4
+ data.tar.gz: 8c5e1082280c5663717638e3b78c136542b8692d952f2547880140efffc5abea
5
5
  SHA512:
6
- metadata.gz: e2804f7d6c3aa12d2c6ae1a622f6f762f6e2a42024621de99399c9c898f9f48a3d7e3d82e810b49cb0a39c39298b9e244bc7551d8236eaf1e1cb901959b3fd65
7
- data.tar.gz: e4cfc154aae81e25edf7442a820d9ef5c33050879ab67b9b42a78aa51e8da365eab0c6d9669d3b708291ac31299e6739ead947062737af95788121e84990f328
6
+ metadata.gz: 14d8247c79082e8b6d495492b0b955703f8739247ce39c0604ca384b9b9d43e33d8509e1a5adfa97283cfa9420df3be0bd887b3109ec0784e67d83b2c952eefa
7
+ data.tar.gz: b8211e86013e1919df5099c830a5fe22964b8f4ef2cd59871da0d08d8152dc88e639992ac26dfedf9bc6e57cae1a62af20577e1dd103c85563e5203f9c27d562
data/README.md CHANGED
@@ -48,7 +48,20 @@ If you use Webpacker, it's:
48
48
  ```js
49
49
  import { Turbo, cable } from "@hotwired/turbo-rails"
50
50
  ```
51
+
52
+ Note, if you were using Turbolinks/Rails UJS in your app previously, you should remove them:
51
53
 
54
+ 1. Remove the `turbolinks` gem from your Gemfile.
55
+ 2. Run `./bin/bundle install`
56
+ 3. Run `./bin/yarn remove turbolinks @rails/ujs`
57
+ 4. Remove these from your application's JavaScript pack:
58
+
59
+ ```js
60
+ import Rails from "@rails/ujs"
61
+ import Turbolinks from "turbolinks"
62
+ Rails.start()
63
+ Turbolinks.start()
64
+ ```
52
65
 
53
66
  ## Usage
54
67
 
@@ -4,19 +4,19 @@ module Turbo::FramesHelper
4
4
  #
5
5
  # === Examples
6
6
  #
7
- # # => turbo-frame id="tray" src="http://example.com/trays/1"></turbo-frame>
8
7
  # <%= turbo_frame_tag "tray", src: tray_path(tray) %>
8
+ # # => <turbo-frame id="tray" src="http://example.com/trays/1"></turbo-frame>
9
9
  #
10
- # # => turbo-frame id="tray" links-target="top" src="http://example.com/trays/1"></turbo-frame>
11
10
  # <%= turbo_frame_tag "tray", src: tray_path(tray), links_target: "top" %>
11
+ # # => <turbo-frame id="tray" links-target="top" src="http://example.com/trays/1"></turbo-frame>
12
12
  #
13
- # # => turbo-frame id="tray" links-target="other_tray"></turbo-frame>
14
13
  # <%= turbo_frame_tag "tray", links_target: "other_tray" %>
14
+ # # => <turbo-frame id="tray" links-target="other_tray"></turbo-frame>
15
15
  #
16
- # # => turbo-frame id="tray"><div>My tray frame!</div></turbo-frame>
17
16
  # <%= turbo_frame_tag "tray" do %>
18
17
  # <div>My tray frame!</div>
19
18
  # <% end %>
19
+ # # => <turbo-frame id="tray"><div>My tray frame!</div></turbo-frame>
20
20
  def turbo_frame_tag(id, src: nil, target: nil, **attributes, &block)
21
21
  tag.turbo_frame(**attributes.merge(id: id, src: src, target: target).compact, &block)
22
22
  end
@@ -1,11 +1,11 @@
1
1
  module Turbo::Streams::ActionHelper
2
2
  # Creates a `turbo-stream` tag according to the passed parameters. Examples:
3
3
  #
4
- # # => <turbo-stream action="remove" target="message_1"></turbo-stream>
5
4
  # turbo_stream_action_tag "remove", target: "message_1"
5
+ # # => <turbo-stream action="remove" target="message_1"></turbo-stream>
6
6
  #
7
- # # => <turbo-stream action="replace" target="message_1"><template><div id="message_1">Hello!</div></template></turbo-stream>
8
7
  # turbo_stream_action_tag "replace", target: "message_1", template: %(<div id="message_1">Hello!</div>)
8
+ # # => <turbo-stream action="replace" target="message_1"><template><div id="message_1">Hello!</div></template></turbo-stream>
9
9
  def turbo_stream_action_tag(action, target:, template: nil)
10
10
  target = convert_to_turbo_stream_dom_id(target)
11
11
  template = template ? "<template>#{template}</template>" : ""
@@ -8,7 +8,9 @@ module Turbo
8
8
  config.turbo = ActiveSupport::OrderedOptions.new
9
9
 
10
10
  initializer "turbo.assets" do
11
- Rails.application.config.assets.precompile += %w( turbo )
11
+ if Rails.application.config.respond_to?(:assets)
12
+ Rails.application.config.assets.precompile += %w( turbo )
13
+ end
12
14
  end
13
15
 
14
16
  initializer "turbo.helpers" do
@@ -1,3 +1,3 @@
1
1
  module Turbo
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
@@ -38,5 +38,8 @@
38
38
  "bugs": {
39
39
  "url": "https://github.com/hotwired/turbo-rails/issues"
40
40
  },
41
- "homepage": "https://github.com/hotwired/turbo-rails"
41
+ "homepage": "https://github.com/hotwired/turbo-rails",
42
+ "publishConfig": {
43
+ "access": "public"
44
+ }
42
45
  }
data/yarn.lock CHANGED
@@ -23,9 +23,10 @@
23
23
  chalk "^2.0.0"
24
24
  js-tokens "^4.0.0"
25
25
 
26
- "@hotwired/turbo@git+ssh://git@github.com:hotwired/turbo#dev-builds/99d8a70":
26
+ "@hotwired/turbo@^7.0.0-beta.1":
27
27
  version "7.0.0-beta.1"
28
- resolved "git+ssh://git@github.com:hotwired/turbo#947298e9e053b4f355469a3df40e915e536dce5a"
28
+ resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-7.0.0-beta.1.tgz#0111db8a80a7bb308c4cfdd2720112d06bf25c33"
29
+ integrity sha512-V7hhELbDkYUGaHw/Yw4tu9pDUT1WE4t3A7tRs7Zh0Uwtk2vaJnmykNZ2uq20BnLjofufA1+MLJZ6AXJ3B/Il5A==
29
30
 
30
31
  "@rails/actioncable@^6.1.0":
31
32
  version "6.1.0"
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: 0.5.0
4
+ version: 0.5.1
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: 2020-12-22 00:00:00.000000000 Z
13
+ date: 2020-12-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails