@hotwired/turbo-rails 8.0.0 → 8.0.1
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.
- package/README.md +12 -5
- package/app/assets/javascripts/turbo.js +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -6,7 +6,6 @@ On top of accelerating web applications, Turbo was built from the ground-up to f
|
|
|
6
6
|
|
|
7
7
|
Turbo is a language-agnostic framework written in JavaScript, but this gem builds on top of those basics to make the integration with Rails as smooth as possible. You can deliver turbo updates via model callbacks over Action Cable, respond to controller actions with native navigation or standard redirects, and render turbo frames with helpers and layout-free responses.
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
## Navigate with Turbo Drive
|
|
11
10
|
|
|
12
11
|
Turbo is a continuation of the ideas from the previous [Turbolinks](https://github.com/turbolinks/turbolinks) framework, and the heart of that past approach lives on as Turbo Drive. When installed, Turbo automatically intercepts all clicks on `<a href>` links to the same domain. When you click an eligible link, Turbo prevents the browser from following it. Instead, Turbo changes the browser’s URL using the History API, requests the new page using `fetch`, and then renders the HTML response.
|
|
@@ -122,7 +121,6 @@ The `Turbo` instance is automatically assigned to `window.Turbo` upon import:
|
|
|
122
121
|
import "@hotwired/turbo-rails"
|
|
123
122
|
```
|
|
124
123
|
|
|
125
|
-
|
|
126
124
|
## Usage
|
|
127
125
|
|
|
128
126
|
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).
|
|
@@ -130,6 +128,17 @@ You can watch [the video introduction to Hotwire](https://hotwired.dev/#screenca
|
|
|
130
128
|
### RubyDoc Documentation
|
|
131
129
|
|
|
132
130
|
For the API documentation covering this gem's classes and packages, [visit the RubyDoc page](https://rubydoc.info/github/hotwired/turbo-rails/main).
|
|
131
|
+
Note that this documentation is updated automatically from the main branch, so it may contain features that are not released yet.
|
|
132
|
+
|
|
133
|
+
- [Turbo Drive Helpers](https://rubydoc.info/github/hotwired/turbo-rails/main/Turbo/DriveHelper)
|
|
134
|
+
- [Turbo Frames Helpers](https://rubydoc.info/github/hotwired/turbo-rails/main/Turbo/FramesHelper)
|
|
135
|
+
- [Turbo Streams View Helpers](https://rubydoc.info/github/hotwired/turbo-rails/main/Turbo/StreamsHelper)
|
|
136
|
+
- [Turbo Streams Broadcast Methods](https://rubydoc.info/github/hotwired/turbo-rails/main/Turbo/Broadcastable)
|
|
137
|
+
- [Turbo Streams Channel](https://rubydoc.info/github/hotwired/turbo-rails/main/Turbo/StreamsChannel)
|
|
138
|
+
- [Turbo Native Navigation](https://rubydoc.info/github/hotwired/turbo-rails/main/Turbo/Native/Navigation)
|
|
139
|
+
- [Turbo Test Assertions](https://rubydoc.info/github/hotwired/turbo-rails/main/Turbo/TestAssertions)
|
|
140
|
+
- [Turbo Integration Test Assertions](https://rubydoc.info/github/hotwired/turbo-rails/main/Turbo/TestAssertions/IntegrationTestAssertions)
|
|
141
|
+
- [Turbo Broadcastable Test Helper](https://rubydoc.info/github/hotwired/turbo-rails/main/Turbo/Broadcastable/TestHelper)
|
|
133
142
|
|
|
134
143
|
## Compatibility with Rails UJS
|
|
135
144
|
|
|
@@ -137,8 +146,7 @@ Turbo can coexist with Rails UJS, but you need to take a series of upgrade steps
|
|
|
137
146
|
|
|
138
147
|
## Testing
|
|
139
148
|
|
|
140
|
-
|
|
141
|
-
The [`Turbo::TestAssertions`](./lib/turbo/test_assertions.rb) concern provides Turbo Stream test helpers that assert the presence or absence of `<turbo-stream>` elements in a rendered fragment of HTML. `Turbo::TestAssertions` are automatically included in [`ActiveSupport::TestCase`](https://edgeapi.rubyonrails.org/classes/ActiveSupport/TestCase.html) and depend on the presence of [`rails-dom-testing`](https://github.com/rails/rails-dom-testing/) assertions.
|
|
149
|
+
The [`Turbo::TestAssertions`](./lib/turbo/test_assertions.rb) concern provides Turbo Stream test helpers that assert the presence or absence ofs s `<turbo-stream>` elements in a rendered fragment of HTML. `Turbo::TestAssertions` are automatically included in [`ActiveSaupport::TestCase`](https://edgeapi.rubyonrails.org/classes/ActiveSupport/TestCase.html) and depend on the presence of [`rails-dom-testing`](https://github.com/rails/rails-dom-testing/) assertions.
|
|
142
150
|
|
|
143
151
|
The [`Turbo::TestAssertions::IntegrationTestAssertions`](./lib/turbo/test_assertions/integration_test_assertions.rb) are built on top of `Turbo::TestAssertions`, and add support for passing a `status:` keyword. They are automatically included in [`ActionDispatch::IntegrationTest`](https://edgeguides.rubyonrails.org/testing.html#integration-testing).
|
|
144
152
|
|
|
@@ -148,7 +156,6 @@ The [`Turbo::Broadcastable::TestHelper`](./lib/turbo/broadcastable/test_helper.r
|
|
|
148
156
|
|
|
149
157
|
Run the tests with `./bin/test`.
|
|
150
158
|
|
|
151
|
-
|
|
152
159
|
## License
|
|
153
160
|
|
|
154
161
|
Turbo is released under the [MIT License](https://opensource.org/licenses/MIT).
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
Turbo 8.0.
|
|
2
|
+
Turbo 8.0.1
|
|
3
3
|
Copyright © 2024 37signals LLC
|
|
4
4
|
*/
|
|
5
5
|
(function(prototype) {
|
|
@@ -2011,10 +2011,10 @@ class Visit {
|
|
|
2011
2011
|
complete() {
|
|
2012
2012
|
if (this.state == VisitState.started) {
|
|
2013
2013
|
this.recordTimingMetric(TimingMetric.visitEnd);
|
|
2014
|
+
this.adapter.visitCompleted(this);
|
|
2014
2015
|
this.state = VisitState.completed;
|
|
2015
2016
|
this.followRedirect();
|
|
2016
2017
|
if (!this.followedRedirect) {
|
|
2017
|
-
this.adapter.visitCompleted(this);
|
|
2018
2018
|
this.delegate.visitCompleted(this);
|
|
2019
2019
|
}
|
|
2020
2020
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotwired/turbo-rails",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.1",
|
|
4
4
|
"description": "The speed of a single-page web application without having to write any JavaScript",
|
|
5
5
|
"module": "app/javascript/turbo/index.js",
|
|
6
6
|
"main": "app/assets/javascripts/turbo.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"release": "npm publish && git commit -am \"$npm_package_name v$npm_package_version\" && git push"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@hotwired/turbo": "^8.0.
|
|
16
|
+
"@hotwired/turbo": "^8.0.1",
|
|
17
17
|
"@rails/actioncable": "^7.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|