turbo-scroll 0.1.7 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8b83933f7e20d2c652a9c79a4c398f10500021703704a0c1b40e37c50f7500f4
4
- data.tar.gz: e1259d89dc7e1fdea2223ae9fb5bdcfd8b9447f60a67ab60936c62a2ae83f9c2
3
+ metadata.gz: 64a1e8a40c5c5405f4a2da1d9f71722fd31cee11ca9bf85e1fbed649a2255906
4
+ data.tar.gz: 7de0439d67298dd18d18d726ad6a1037dcabb6f00c9ae5f951337a225cc1dabf
5
5
  SHA512:
6
- metadata.gz: 5617fc74b11bbe4386748fb107960100f5ff8c78d9b671f40a6880eaf917dc062f39265f2811c7569b4b36d16c8d39dc7b2aee99cfb784e0e98bd22c2bc6c7bd
7
- data.tar.gz: 07b35bd7481d1b8475bb79d0c41f2d473758d7da08f9e6072522ba4ba67f26b057adda246beab59a64cb8bb50e42fb2694e22a89cdefbbd0a8137af6d4a98cb3
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
- $ bundle add turbo-scroll
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
- $ gem install turbo-scroll
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
@@ -1,5 +1,11 @@
1
1
  require "bundler/setup"
2
2
 
3
3
  require "bundler/gem_tasks"
4
+ require "rake/testtask"
5
+
6
+ Rake::TestTask.new do |test|
7
+ test.libs << "test"
8
+ test.pattern = "test/**/*_test.rb"
9
+ end
4
10
 
5
11
  task default: %i[rubocop]
@@ -1,25 +1,12 @@
1
1
  module TurboScroll
2
2
  class Railtie < ::Rails::Railtie
3
- config.before_initialize do
4
- module ::ViewComponent
5
- class Base < ActionView::Base
6
- class << self
7
- def config
8
- @config ||= ViewComponent::Config.defaults
9
- end
10
- end
11
- end
12
- end
13
- end
14
-
15
- initializer "turbo-scrolls.load_components" do
16
- ActiveSupport.on_load(:action_view) do
17
- require_relative "auto"
18
- require_relative "auto_stream"
19
- require_relative "more"
20
- require_relative "more_stream"
21
- require_relative "spin_loader"
22
- 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"
23
10
  end
24
11
 
25
12
  initializer "turbo-scrolls.view_helpers" do |app|
@@ -1,3 +1,3 @@
1
1
  module TurboScroll
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
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.7
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: 2023-04-26 00:00:00.000000000 Z
11
+ date: 2026-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties