turbo-scroll 0.1.6 → 0.1.8
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 +35 -5
- data/Rakefile +6 -0
- data/lib/turbo-scroll/railtie.rb +9 -9
- data/lib/turbo-scroll/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 64a1e8a40c5c5405f4a2da1d9f71722fd31cee11ca9bf85e1fbed649a2255906
|
|
4
|
+
data.tar.gz: 7de0439d67298dd18d18d726ad6a1037dcabb6f00c9ae5f951337a225cc1dabf
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bcebfd89b9dc7c8078d33e59f9eb3021d71323574e2ddd73a8371ab8dae047c38cb18557ee5b9ef254bff3b2542397c9b19777ad34a50b3752ce66a98747d354
|
|
7
|
+
data.tar.gz: 6aa7308d6455e1d8f8ae3a4dc3927af69aa49ed9f14729178c6a32f78b35b9640a9b9e7da6a1526be6ada6d9cfd49074d3661e7a34d017bd3983ff5366e51610
|
data/README.md
CHANGED
|
@@ -15,7 +15,6 @@ provide the functionality you need for infinite scrolling and avoiding a count q
|
|
|
15
15
|
on each page request (Your main page might still do a count query but you won't
|
|
16
16
|
be repeating them when requesting next page data behind the scenes.)
|
|
17
17
|
|
|
18
|
-
|
|
19
18
|
Underlying it depends on ViewComponent and Slim but these are not forced upon the user.
|
|
20
19
|
|
|
21
20
|
## Usage
|
|
@@ -40,7 +39,6 @@ nest inside your initial infinite content. This will wrap the
|
|
|
40
39
|
content with an element with id #infinite that will be
|
|
41
40
|
used to append new content to for infinite scrolling.
|
|
42
41
|
|
|
43
|
-
|
|
44
42
|
```slim
|
|
45
43
|
= turbo_scroll_auto page: @articles.next_page_index
|
|
46
44
|
- @articles.each do |article|
|
|
@@ -160,7 +158,6 @@ which would go hand in hand with this partial for a record row
|
|
|
160
158
|
i.bi.bi-pencil
|
|
161
159
|
```
|
|
162
160
|
|
|
163
|
-
|
|
164
161
|
### Using a different DOM ID
|
|
165
162
|
|
|
166
163
|
In case you want or need to use a different DOM ID you
|
|
@@ -189,11 +186,44 @@ index.turbo_stream.slim
|
|
|
189
186
|
|
|
190
187
|
Install the gem and add to the application's Gemfile by executing:
|
|
191
188
|
|
|
192
|
-
|
|
189
|
+
bundle add turbo-scroll
|
|
193
190
|
|
|
194
191
|
If bundler is not being used to manage dependencies, install the gem by executing:
|
|
195
192
|
|
|
196
|
-
|
|
193
|
+
gem install turbo-scroll
|
|
194
|
+
|
|
195
|
+
## Compatibility testing
|
|
196
|
+
|
|
197
|
+
TurboScroll supports ViewComponent 3 and 4. ViewComponent 4 requires Ruby 3.2+
|
|
198
|
+
and Rails 7.1+; upgrading TurboScroll does not require upgrading ViewComponent.
|
|
199
|
+
|
|
200
|
+
When upgrading an older checkout to Ruby 4, refresh the development lockfile
|
|
201
|
+
before installing. Old lockfiles can pin Minitest 5, which excludes Ruby 4,
|
|
202
|
+
and older Rake releases that depend on removed standard-library gems:
|
|
203
|
+
|
|
204
|
+
```sh
|
|
205
|
+
VIEW_COMPONENT_VERSION=3.27.0 bundle update
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Run the Rails integration tests with `bundle exec rake test`. To select a
|
|
209
|
+
ViewComponent version, set `VIEW_COMPONENT_VERSION` when resolving dependencies
|
|
210
|
+
and running the tests:
|
|
211
|
+
|
|
212
|
+
```sh
|
|
213
|
+
VIEW_COMPONENT_VERSION=3.27.0 bundle update view_component
|
|
214
|
+
VIEW_COMPONENT_VERSION=3.27.0 bundle exec rake test
|
|
215
|
+
VIEW_COMPONENT_VERSION=4.20.0 bundle update view_component
|
|
216
|
+
VIEW_COMPONENT_VERSION=4.20.0 bundle exec rake test
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Set `EAGER_LOAD=true` when running the tests to also check eager-loaded boot
|
|
220
|
+
and rendering. If the test dependencies and both ViewComponent versions are
|
|
221
|
+
already installed, each version can be tested without changing a lockfile:
|
|
222
|
+
|
|
223
|
+
```sh
|
|
224
|
+
VIEW_COMPONENT_VERSION=3.27.0 ruby -Ilib test/compatibility_test.rb
|
|
225
|
+
VIEW_COMPONENT_VERSION=4.20.0 ruby -Ilib test/compatibility_test.rb
|
|
226
|
+
```
|
|
197
227
|
|
|
198
228
|
## License
|
|
199
229
|
|
data/Rakefile
CHANGED
data/lib/turbo-scroll/railtie.rb
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
module TurboScroll
|
|
2
2
|
class Railtie < ::Rails::Railtie
|
|
3
|
-
initializer "turbo-scrolls.load_components" do
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
end
|
|
3
|
+
initializer "turbo-scrolls.load_components", after: "view_component.set_configs" do
|
|
4
|
+
require "view_component/base"
|
|
5
|
+
require_relative "auto"
|
|
6
|
+
require_relative "auto_stream"
|
|
7
|
+
require_relative "more"
|
|
8
|
+
require_relative "more_stream"
|
|
9
|
+
require_relative "spin_loader"
|
|
11
10
|
end
|
|
11
|
+
|
|
12
12
|
initializer "turbo-scrolls.view_helpers" do |app|
|
|
13
13
|
ActiveSupport.on_load(:action_view) do
|
|
14
14
|
include TurboScroll::ViewHelpers
|
|
15
15
|
end
|
|
16
|
-
app.config.i18n.load_path += Dir[File.expand_path(File.join(File.dirname(__FILE__),
|
|
16
|
+
app.config.i18n.load_path += Dir[File.expand_path(File.join(File.dirname(__FILE__), "../locales", "*.yml")).to_s]
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
end
|
data/lib/turbo-scroll/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: turbo-scroll
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Koen handekyn
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-11-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: railties
|
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
120
120
|
- !ruby/object:Gem::Version
|
|
121
121
|
version: '0'
|
|
122
122
|
requirements: []
|
|
123
|
-
rubygems_version: 3.
|
|
123
|
+
rubygems_version: 3.4.10
|
|
124
124
|
signing_key:
|
|
125
125
|
specification_version: 4
|
|
126
126
|
summary: Modern infinite page scrolling for Rails.
|