hotwire-livereload 1.4.1 → 2.1.0
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 +4 -4
- data/README.md +7 -27
- data/app/assets/javascripts/hotwire-livereload.js +467 -590
- data/app/javascript/hotwire-livereload.js +2 -13
- data/lib/hotwire/livereload/cable_server.rb +11 -0
- data/lib/hotwire/livereload/engine.rb +48 -84
- data/lib/hotwire/livereload/middleware.rb +56 -0
- data/lib/hotwire/livereload/version.rb +1 -1
- data/lib/hotwire/livereload.rb +63 -0
- data/lib/tasks/livereload_tasks.rake +0 -5
- metadata +8 -8
- data/app/helpers/hotwire/livereload/livereload_tags_helper.rb +0 -11
- data/lib/install/install.rb +0 -30
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 32c853234470c5fcf11dbe7dbdb120c4133dfb84e0b743342ec718d01a7586b2
|
|
4
|
+
data.tar.gz: 20d9fdce2ab0b38d14a2e81fd49f9d851cf647038a1682d7434b6e8db4af12b9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e89d3cb99f78f212719b6bb8c8a1c2c21dd6456b3ace2064a954fba1f7d644cd4bc4afc323a0c2d569ad5f0758f5ba9ceb34d96ec39d58c7ac98c2ca711f2629
|
|
7
|
+
data.tar.gz: 92dc37c2f41c563a9067b40973d88946e32b43e051f7ad62cb2ba930eb794329d26e0d9505081830cc38c5a705d74cb8baecf191b6ab2fb807e9e374f7c7acba
|
data/README.md
CHANGED
|
@@ -4,22 +4,21 @@ Automatically reload Hotwire Turbo when app files are modified.
|
|
|
4
4
|
|
|
5
5
|
https://user-images.githubusercontent.com/839922/148676469-0acfa036-832e-4b40-aa05-1fdd945baa1f.mp4
|
|
6
6
|
|
|
7
|
-
## Dependencies
|
|
8
|
-
|
|
9
|
-
* [Redis](https://redis.io/)
|
|
10
|
-
|
|
11
7
|
## Getting started
|
|
12
8
|
|
|
13
9
|
Add `hotwire-livereload` to your Gemfile:
|
|
14
|
-
```
|
|
10
|
+
```bash
|
|
15
11
|
bundle add hotwire-livereload --group development
|
|
16
12
|
```
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
```
|
|
20
|
-
|
|
14
|
+
In your layout, make sure you don't `turbo-track` your JS/CSS in development:
|
|
15
|
+
```diff
|
|
16
|
+
+ <%= stylesheet_link_tag "application", "data-turbo-track": Rails.env.production? ? "reload" : "" %>
|
|
17
|
+
- <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
|
21
18
|
```
|
|
22
19
|
|
|
20
|
+
## Configuration
|
|
21
|
+
|
|
23
22
|
Folders watched by default:
|
|
24
23
|
- `app/views`
|
|
25
24
|
- `app/helpers`
|
|
@@ -32,14 +31,6 @@ Folders watched by default:
|
|
|
32
31
|
|
|
33
32
|
The gem detects if you use [`jsbundling-rails`](https://github.com/rails/jsbundling-rails) or [`cssbundling-rails`](https://github.com/rails/cssbundling-rails) and watches for changes in their output folder `app/assets/builds` automatically.
|
|
34
33
|
|
|
35
|
-
In your layout, make sure you don't `turbo-track` your JS/CSS in development:
|
|
36
|
-
```diff
|
|
37
|
-
+ <%= stylesheet_link_tag "application", "data-turbo-track": Rails.env.production? ? "reload" : "" %>
|
|
38
|
-
- <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
## Configuration
|
|
42
|
-
|
|
43
34
|
### Listen paths
|
|
44
35
|
|
|
45
36
|
You can watch for changes in additional folders by adding them to `listen_paths`:
|
|
@@ -101,17 +92,6 @@ Rails.application.configure do
|
|
|
101
92
|
end
|
|
102
93
|
```
|
|
103
94
|
|
|
104
|
-
In that case you need to place `hotwire_livereload_tags` helper in your layout *after* the `<%= action_cable_meta_tag %>`.
|
|
105
|
-
|
|
106
|
-
```diff
|
|
107
|
-
<head>
|
|
108
|
-
...
|
|
109
|
-
<%= action_cable_meta_tag %>
|
|
110
|
-
+ <%= hotwire_livereload_tags if Rails.env.development? %>
|
|
111
|
-
...
|
|
112
|
-
</head>
|
|
113
|
-
```
|
|
114
|
-
|
|
115
95
|
### Listen options
|
|
116
96
|
|
|
117
97
|
[Listen gem](https://github.com/guard/listen), which is used for file system monitoring, accepts [options](https://github.com/guard/listen?tab=readme-ov-file#options) like enabling a fallback mechanism called "polling" to detect file changes.
|