view_component 3.25.0 → 3.26.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 17958e9ab2fbfbce6d2d397332fb0683315d805bb2ca94920a570fcf544c43e8
4
- data.tar.gz: 76b1b5f122715ac0086e78b8010dc5f03e9fad57180ce444c68f556b148d1a59
3
+ metadata.gz: 7646c2f512d91517ac31ba0f2f039ef7c486ce4e5eec74d1fe5ca742a24f48b5
4
+ data.tar.gz: 548a7e762a5e2b2970a79d7debba10747adffe62c1a946eb12eb689d0bbb04de
5
5
  SHA512:
6
- metadata.gz: 1ef7030f4690849614463924c9f10953609ef1a74508718cbe5d5f5049256ffcc51c67671a1b95a770bd96c0cd0b3b1f0f438bf56c3ba2265b252d1072f3faad
7
- data.tar.gz: b54825e954ceef4e0f45bbc71cc59f92689275f02da9707e46c3fb30b30eb280b9e01b0b3585b3e6996da92dd5ce2c822d9dd839373e8a89660203a665a0ebb3
6
+ metadata.gz: c880684d390ecb0c5a8b62ed329fe2883623bea9e61371666ba5e7aa1eca31f92af9d2e6558a728e195cd756a3390b4154cb024b1d613fd47a111f7b5452f60f
7
+ data.tar.gz: be6a18ae9ed76ed5c2f71641e43b56fb32d67f8655f044d15f02e36da168539155e2de84e1ee6f2e1f195247832e1b6e11fc9d5bc75b1d02ec3cf92bfa8ce266
@@ -23,7 +23,7 @@ module PreviewHelper
23
23
  end
24
24
 
25
25
  def find_template_data_for_preview_source(lookup_context:, template_identifier:)
26
- template = lookup_context.find_template(template_identifier)
26
+ template = find_template_for_preview_source(lookup_context, template_identifier)
27
27
 
28
28
  if Rails.version.to_f >= 6.1 || template.source.present?
29
29
  {
@@ -61,6 +61,14 @@ module PreviewHelper
61
61
 
62
62
  private
63
63
 
64
+ def find_template_for_preview_source(lookup_context, template_identifier)
65
+ if lookup_context.respond_to?(:find_template)
66
+ lookup_context.find_template(template_identifier)
67
+ else
68
+ lookup_context.find(template_identifier)
69
+ end
70
+ end
71
+
64
72
  def prism_language_name_by_template(template:)
65
73
  language = template.identifier.split(".").last
66
74
 
data/docs/CHANGELOG.md CHANGED
@@ -10,6 +10,16 @@ nav_order: 6
10
10
 
11
11
  ## main
12
12
 
13
+ ## 3.26.0
14
+
15
+ * Fix rendering partials from components rendered as a collection when the original view context is explicitly stashed as `nil`.
16
+
17
+ *Justin Coyne, Joel Hawksley*
18
+
19
+ * Restore compatibility with Rails main after `ActionView::Template.template_handler_extensions` and `ActionView::LookupContext#find_template` were removed.
20
+
21
+ *Joel Hawksley*
22
+
13
23
  ## 3.25.0
14
24
 
15
25
  * Support Rails `render_in` options signature. Rails [#50623](https://github.com/rails/rails/pull/50623) changed the `render_in` signature from `render_in(view_context, &block)` to `render_in(view_context, **options, &block)`. `ViewComponent::Base#render_in`, `ViewComponent::Collection#render_in`, and `ViewComponent::Instrumentation#render_in` now accept `**options`, restoring compatibility with Rails main and silencing the deprecation warning.
@@ -88,7 +88,7 @@ module ViewComponent
88
88
  @view_context = view_context
89
89
  self.__vc_original_view_context =
90
90
  if instance_variable_defined?(:@__vc_pending_original_view_context)
91
- remove_instance_variable(:@__vc_pending_original_view_context)
91
+ remove_instance_variable(:@__vc_pending_original_view_context) || view_context
92
92
  else
93
93
  view_context
94
94
  end
@@ -170,7 +170,7 @@ module ViewComponent
170
170
  @templates ||=
171
171
  begin
172
172
  templates = @component.sidecar_files(
173
- ActionView::Template.template_handler_extensions
173
+ template_handler_extensions
174
174
  ).map do |path|
175
175
  # Extract format and variant from template filename
176
176
  this_format, variant =
@@ -225,5 +225,13 @@ module ViewComponent
225
225
  templates
226
226
  end
227
227
  end
228
+
229
+ def template_handler_extensions
230
+ if ActionView::Template.respond_to?(:template_handler_extensions)
231
+ ActionView::Template.template_handler_extensions
232
+ else
233
+ ActionView::Template::Handlers.extensions.map(&:to_s)
234
+ end
235
+ end
228
236
  end
229
237
  end
@@ -3,7 +3,7 @@
3
3
  module ViewComponent
4
4
  module VERSION
5
5
  MAJOR = 3
6
- MINOR = 25
6
+ MINOR = 26
7
7
  PATCH = 0
8
8
  PRE = nil
9
9
 
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: view_component
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.25.0
4
+ version: 3.26.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ViewComponent Team
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2026-06-05 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -450,8 +449,118 @@ dependencies:
450
449
  - - "~>"
451
450
  - !ruby/object:Gem::Version
452
451
  version: 0.0.1
453
- description:
454
- email:
452
+ - !ruby/object:Gem::Dependency
453
+ name: net-imap
454
+ requirement: !ruby/object:Gem::Requirement
455
+ requirements:
456
+ - - ">="
457
+ - !ruby/object:Gem::Version
458
+ version: '0'
459
+ type: :development
460
+ prerelease: false
461
+ version_requirements: !ruby/object:Gem::Requirement
462
+ requirements:
463
+ - - ">="
464
+ - !ruby/object:Gem::Version
465
+ version: '0'
466
+ - !ruby/object:Gem::Dependency
467
+ name: net-pop
468
+ requirement: !ruby/object:Gem::Requirement
469
+ requirements:
470
+ - - ">="
471
+ - !ruby/object:Gem::Version
472
+ version: '0'
473
+ type: :development
474
+ prerelease: false
475
+ version_requirements: !ruby/object:Gem::Requirement
476
+ requirements:
477
+ - - ">="
478
+ - !ruby/object:Gem::Version
479
+ version: '0'
480
+ - !ruby/object:Gem::Dependency
481
+ name: net-smtp
482
+ requirement: !ruby/object:Gem::Requirement
483
+ requirements:
484
+ - - ">="
485
+ - !ruby/object:Gem::Version
486
+ version: '0'
487
+ type: :development
488
+ prerelease: false
489
+ version_requirements: !ruby/object:Gem::Requirement
490
+ requirements:
491
+ - - ">="
492
+ - !ruby/object:Gem::Version
493
+ version: '0'
494
+ - !ruby/object:Gem::Dependency
495
+ name: base64
496
+ requirement: !ruby/object:Gem::Requirement
497
+ requirements:
498
+ - - ">="
499
+ - !ruby/object:Gem::Version
500
+ version: '0'
501
+ type: :development
502
+ prerelease: false
503
+ version_requirements: !ruby/object:Gem::Requirement
504
+ requirements:
505
+ - - ">="
506
+ - !ruby/object:Gem::Version
507
+ version: '0'
508
+ - !ruby/object:Gem::Dependency
509
+ name: bigdecimal
510
+ requirement: !ruby/object:Gem::Requirement
511
+ requirements:
512
+ - - ">="
513
+ - !ruby/object:Gem::Version
514
+ version: '0'
515
+ type: :development
516
+ prerelease: false
517
+ version_requirements: !ruby/object:Gem::Requirement
518
+ requirements:
519
+ - - ">="
520
+ - !ruby/object:Gem::Version
521
+ version: '0'
522
+ - !ruby/object:Gem::Dependency
523
+ name: drb
524
+ requirement: !ruby/object:Gem::Requirement
525
+ requirements:
526
+ - - ">="
527
+ - !ruby/object:Gem::Version
528
+ version: '0'
529
+ type: :development
530
+ prerelease: false
531
+ version_requirements: !ruby/object:Gem::Requirement
532
+ requirements:
533
+ - - ">="
534
+ - !ruby/object:Gem::Version
535
+ version: '0'
536
+ - !ruby/object:Gem::Dependency
537
+ name: mutex_m
538
+ requirement: !ruby/object:Gem::Requirement
539
+ requirements:
540
+ - - ">="
541
+ - !ruby/object:Gem::Version
542
+ version: '0'
543
+ type: :development
544
+ prerelease: false
545
+ version_requirements: !ruby/object:Gem::Requirement
546
+ requirements:
547
+ - - ">="
548
+ - !ruby/object:Gem::Version
549
+ version: '0'
550
+ - !ruby/object:Gem::Dependency
551
+ name: propshaft
552
+ requirement: !ruby/object:Gem::Requirement
553
+ requirements:
554
+ - - "~>"
555
+ - !ruby/object:Gem::Version
556
+ version: 1.1.0
557
+ type: :development
558
+ prerelease: false
559
+ version_requirements: !ruby/object:Gem::Requirement
560
+ requirements:
561
+ - - "~>"
562
+ - !ruby/object:Gem::Version
563
+ version: 1.1.0
455
564
  executables: []
456
565
  extensions: []
457
566
  extra_rdoc_files: []
@@ -532,7 +641,6 @@ metadata:
532
641
  allowed_push_host: https://rubygems.org
533
642
  source_code_uri: https://github.com/viewcomponent/view_component
534
643
  changelog_uri: https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md
535
- post_install_message:
536
644
  rdoc_options: []
537
645
  require_paths:
538
646
  - lib
@@ -547,8 +655,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
547
655
  - !ruby/object:Gem::Version
548
656
  version: '0'
549
657
  requirements: []
550
- rubygems_version: 3.0.3.1
551
- signing_key:
658
+ rubygems_version: 3.6.9
552
659
  specification_version: 4
553
660
  summary: A framework for building reusable, testable & encapsulated view components
554
661
  in Ruby on Rails.