hotwire-livereload 1.4.0 → 2.0.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 +11 -27
- data/app/assets/javascripts/hotwire-livereload.js +466 -582
- data/app/javascript/hotwire-livereload.js +1 -2
- 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 +62 -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: 2b5dd2e4b13e486c62e47c32d92d240af12c04d7f983644e9484a90caf30d11e
|
4
|
+
data.tar.gz: ac774b56a8de9e8f25f0dbf126d3a0b100e1159f8053ae39fd9d9469fdff47a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13981c03a4c39b8f7ad8e3fb65dbafa038ad7dae8511d42951fcb2d81769f7c5d16be3626466bf5c371fcec365fcb6b1c9e2681d7e98f56c30f237f9473c51ed
|
7
|
+
data.tar.gz: e44f93cebac1228be1fdbc3966a8decc6b6ca4954e85c380b355a88a93deba38b656fc7cc4db5a3b568ff679f8958308fbc85f8c31f096977294f0176bd1fb72
|
data/README.md
CHANGED
@@ -4,22 +4,25 @@ 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
|
```
|
15
|
-
|
11
|
+
group :development do
|
12
|
+
gem "hotwire-livereload", github: "kirillplatonov/hotwire-livereload"
|
13
|
+
end
|
16
14
|
```
|
17
15
|
|
18
|
-
Run
|
19
|
-
|
20
|
-
|
16
|
+
Run `bundle install` and restart your server.
|
17
|
+
|
18
|
+
In your layout, make sure you don't `turbo-track` your JS/CSS in development:
|
19
|
+
```diff
|
20
|
+
+ <%= stylesheet_link_tag "application", "data-turbo-track": Rails.env.production? ? "reload" : "" %>
|
21
|
+
- <%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
|
21
22
|
```
|
22
23
|
|
24
|
+
## Configuration
|
25
|
+
|
23
26
|
Folders watched by default:
|
24
27
|
- `app/views`
|
25
28
|
- `app/helpers`
|
@@ -32,14 +35,6 @@ Folders watched by default:
|
|
32
35
|
|
33
36
|
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
37
|
|
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
38
|
### Listen paths
|
44
39
|
|
45
40
|
You can watch for changes in additional folders by adding them to `listen_paths`:
|
@@ -101,17 +96,6 @@ Rails.application.configure do
|
|
101
96
|
end
|
102
97
|
```
|
103
98
|
|
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
99
|
### Listen options
|
116
100
|
|
117
101
|
[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.
|