view_component 2.49.1 → 3.23.2

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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/app/assets/vendor/prism.css +3 -195
  4. data/app/assets/vendor/prism.min.js +11 -11
  5. data/app/controllers/concerns/view_component/preview_actions.rb +108 -0
  6. data/app/controllers/view_components_controller.rb +1 -87
  7. data/app/controllers/view_components_system_test_controller.rb +30 -0
  8. data/app/helpers/preview_helper.rb +30 -12
  9. data/app/views/view_components/_preview_source.html.erb +3 -3
  10. data/app/views/view_components/preview.html.erb +2 -2
  11. data/docs/CHANGELOG.md +1653 -24
  12. data/lib/rails/generators/abstract_generator.rb +16 -10
  13. data/lib/rails/generators/component/component_generator.rb +8 -4
  14. data/lib/rails/generators/component/templates/component.rb.tt +3 -2
  15. data/lib/rails/generators/erb/component_generator.rb +1 -1
  16. data/lib/rails/generators/locale/component_generator.rb +4 -4
  17. data/lib/rails/generators/preview/component_generator.rb +17 -3
  18. data/lib/rails/generators/preview/templates/component_preview.rb.tt +5 -1
  19. data/lib/rails/generators/rspec/component_generator.rb +15 -3
  20. data/lib/rails/generators/rspec/templates/component_spec.rb.tt +3 -1
  21. data/lib/rails/generators/stimulus/component_generator.rb +8 -3
  22. data/lib/rails/generators/stimulus/templates/component_controller.ts.tt +9 -0
  23. data/lib/rails/generators/test_unit/templates/component_test.rb.tt +3 -1
  24. data/lib/view_component/base.rb +352 -196
  25. data/lib/view_component/capture_compatibility.rb +44 -0
  26. data/lib/view_component/collection.rb +28 -9
  27. data/lib/view_component/compiler.rb +162 -193
  28. data/lib/view_component/config.rb +225 -0
  29. data/lib/view_component/configurable.rb +17 -0
  30. data/lib/view_component/deprecation.rb +8 -0
  31. data/lib/view_component/engine.rb +74 -47
  32. data/lib/view_component/errors.rb +240 -0
  33. data/lib/view_component/inline_template.rb +55 -0
  34. data/lib/view_component/instrumentation.rb +10 -2
  35. data/lib/view_component/preview.rb +21 -19
  36. data/lib/view_component/rails/tasks/view_component.rake +11 -2
  37. data/lib/view_component/render_component_helper.rb +1 -0
  38. data/lib/view_component/render_component_to_string_helper.rb +1 -1
  39. data/lib/view_component/render_to_string_monkey_patch.rb +1 -1
  40. data/lib/view_component/rendering_component_helper.rb +1 -1
  41. data/lib/view_component/rendering_monkey_patch.rb +1 -1
  42. data/lib/view_component/slot.rb +119 -1
  43. data/lib/view_component/slotable.rb +393 -96
  44. data/lib/view_component/slotable_default.rb +20 -0
  45. data/lib/view_component/system_test_case.rb +13 -0
  46. data/lib/view_component/system_test_helpers.rb +27 -0
  47. data/lib/view_component/template.rb +134 -0
  48. data/lib/view_component/test_helpers.rb +208 -47
  49. data/lib/view_component/translatable.rb +51 -33
  50. data/lib/view_component/use_helpers.rb +42 -0
  51. data/lib/view_component/version.rb +5 -4
  52. data/lib/view_component/with_content_helper.rb +3 -8
  53. data/lib/view_component.rb +7 -12
  54. metadata +339 -57
  55. data/lib/rails/generators/component/USAGE +0 -13
  56. data/lib/view_component/content_areas.rb +0 -57
  57. data/lib/view_component/polymorphic_slots.rb +0 -73
  58. data/lib/view_component/preview_template_error.rb +0 -6
  59. data/lib/view_component/previewable.rb +0 -62
  60. data/lib/view_component/slot_v2.rb +0 -104
  61. data/lib/view_component/slotable_v2.rb +0 -307
  62. data/lib/view_component/template_error.rb +0 -9
  63. data/lib/yard/mattr_accessor_handler.rb +0 -19
data/docs/CHANGELOG.md CHANGED
@@ -1,15 +1,1640 @@
1
1
  ---
2
2
  layout: default
3
3
  title: Changelog
4
+ nav_order: 6
4
5
  ---
5
6
 
7
+ <!-- Add unreleased changes under the "main" heading. -->
8
+
6
9
  # Changelog
7
10
 
8
- ## main
11
+ ## main
12
+
13
+ ## 3.23.2
14
+
15
+ * Include .tt files in published gem. Fixes templates not being available when using generators.
16
+
17
+ *Florian Aßmann*
18
+
19
+ ## 3.23.1
20
+
21
+ * Restore Rake tasks in published gem.
22
+
23
+ *Franz Liedke*
24
+
25
+ ## 3.23.0
26
+
27
+ * Add docs about Slack channel in Ruby Central workspace. (Join us! #oss-view-component). Email joelhawksley@github.com for an invite.
28
+
29
+ *Joel Hawksley
30
+
31
+ * Do not include internal `DocsBuilderComponent` or `YARD::MattrAccessorHandler` in published gem.
32
+
33
+ *Joel Hawksley*
34
+
35
+ * Only lock to `concurrent-ruby` `1.3.4` for Rails 6.1.
36
+
37
+ *Joel Hawksley*
38
+
39
+ * Fix generation of ViewComponent documentation that was broken due to HTML safety issues.
40
+
41
+ *Simon Fish*
42
+
43
+ * Add documentation on how ViewComponent works.
44
+
45
+ *Joel Hawksley*
46
+
47
+ * Clarify that `config.use_deprecated_instrumentation_name` will be removed in v4.
48
+
49
+ *Joel Hawksley*
50
+
51
+ * Run RSpec tests in CI.
52
+
53
+ *Joel Hawksley*
54
+
55
+ ## 3.22.0
56
+
57
+ * Rewrite `ViewComponents at GitHub` documentation as more general `Best practices`.
58
+
59
+ *Phil Schalm*, *Joel Hawksley*
60
+
61
+ * Add unused mechanism for inheriting config from parent modules to enable future engine-local configuration.
62
+
63
+ *Simon Fish*
64
+
65
+ * Improve handling of malformed component edge case when mocking components in tests.
66
+
67
+ *Martin Meyerhoff*, *Joel Hawksley*
68
+
69
+ * Add Content Harmony & Learn To Be to list of companies using ViewComponent.
70
+
71
+ *Kane Jamison*
72
+
73
+ * Clarify error message about render-dependent logic.
74
+
75
+ Error messages about render-dependent logic were sometimes inaccurate, saying `during initialization` despite also being raised after a component had been initialized but before it was rendered.
76
+
77
+ *Joel Hawksley*
78
+
79
+ * Remove JS and CSS docs as they proved difficult to maintain and lacked consensus.
80
+
81
+ *Joel Hawksley*
82
+
83
+ * Do not prefix release tags with `v`, per recommendation from @bkuhlmann.
84
+
85
+ *Joel Hawksley*
86
+
87
+ * Add ruby 3.4 support to CI.
88
+
89
+ *Reegan Viljoen*
90
+
91
+ * Add HomeStyler AI to list of companies using ViewComponent.
92
+
93
+ *JP Balarini*
94
+
95
+ ## 3.21.0
96
+
97
+ * Updates testing docs to include an example of how to use with RSpec.
98
+
99
+ *Rylan Bowers*
100
+
101
+ * Add `--skip-suffix` option to component generator.
102
+
103
+ *KAWAKAMI Moeki*
104
+
105
+ * Add FreeATS to list of companies using ViewComponent.
106
+
107
+ *Ilia Liamshin*
108
+
109
+ * Ensure HTML output safety wrapper is used for all inline templates.
110
+
111
+ *Joel Hawksley*
112
+
113
+ * Expose `.identifier` method as part of public API.
114
+
115
+ *Joel Hawksley*
116
+
117
+ * Add rails 8 support to CI.
118
+
119
+ *Reegan Viljoen*
120
+
121
+ * Updates ActionText compatibility documentation to reference `rich_textarea_tag` for Rails 8.0 support.
122
+
123
+ *Alvin Crespo*
124
+
125
+ ## 3.20.0
126
+
127
+ * Allow rendering `with_collection` to accept an optional `spacer_component` to be rendered between each item.
128
+
129
+ *Nick Coyne*
130
+
131
+ * Remove OpenStruct from codebase.
132
+
133
+ *Oleksii Vasyliev*
134
+
135
+ ## 3.19.0
136
+
137
+ * Relax Active Support version constraint in gemspec.
138
+
139
+ *Simon Fish*
140
+
141
+ ## 3.18.0
142
+
143
+ * Enable components to use `@request` and `request` methods/ivars.
144
+
145
+ *Blake Williams*
146
+
147
+ * Fix bug where implicit locales in component filenames threw a `NameError`.
148
+
149
+ *Chloe Fons*
150
+
151
+ * Register ViewComponent tests directory for `rails stats`.
152
+
153
+ *Javier Aranda*
154
+
155
+ * Wrap entire compile step in a mutex to make it more resilient to race conditions.
156
+
157
+ *Blake Williams*
158
+
159
+ * Add [Niva]([niva.co](https://www.niva.co/)) to companies who use `ViewComponent`.
160
+
161
+ *Daniel Vu Dao*
162
+
163
+ * Fix `preview_paths` in docs.
164
+
165
+ *Javier Aranda*
166
+
167
+ ## 3.17.0
168
+
169
+ * Use struct instead openstruct in lib code.
170
+
171
+ *Oleksii Vasyliev*
172
+
173
+ * Fix bug where stimulus controller was not added to ERB when stimulus was activated by default.
174
+
175
+ *Denis Pasin*
176
+
177
+ * Add typescript support to stimulus generator.
178
+
179
+ *Denis Pasin*
180
+
181
+ * Fix the example of #vc_test_request in the API reference to use the correct method name.
182
+
183
+ *Alberto Rocha*
184
+
185
+ * Fix development mode race condition that caused an invalid duplicate template error.
186
+
187
+ *Blake Williams*
188
+
189
+ ## 3.16.0
190
+
191
+ * Add template information to multiple template error messages.
192
+
193
+ *Joel Hawksley*
194
+
195
+ * Add `ostruct` to gemspec file to suppress stdlib removal warning.
196
+
197
+ *Jonathan Underwood*
198
+
199
+ ## 3.15.1
200
+
201
+ * Re-add `@private`, undocumented `.identifier` method that was only meant for internal framework use but was used by some downstream consumers. This method will be removed in a coming minor release.
202
+
203
+ *Joel Hawksley*
204
+
205
+ ## 3.15.0
206
+
207
+ * Add basic internal testing for memory allocations.
208
+
209
+ *Joel Hawksley*
210
+
211
+ * Add support for request formats.
212
+
213
+ *Joel Hawksley*
214
+
215
+ * Add `rendered_json` test helper.
216
+
217
+ *Joel Hawksley*
218
+
219
+ * Add `with_format` test helper.
220
+
221
+ *Joel Hawksley*
222
+
223
+ * Warn if using Ruby < 3.2 or Rails < 7.1, which won't be supported by ViewComponent v4, to be released no earlier than April 1, 2025.
224
+
225
+ *Joel Hawksley*
226
+
227
+ * Add Kicksite to list of companies using ViewComponent.
228
+
229
+ *Adil Lari*
230
+
231
+ * Allow overridden slot methods to use `super`.
232
+
233
+ *Andrew Schwartz*
234
+
235
+ * Add Rails engine support to generators.
236
+
237
+ *Tomasz Kowalewski*
238
+
239
+ * Register stats directories with `Rails::CodeStatistics.register_directory` to support `rails stats` in Rails 8.
240
+
241
+ *Petrik de Heus*
242
+
243
+ * Fixed type declaration for `ViewComponent::TestHelpers.with_controller_class` parameter.
244
+
245
+ *Graham Rogers*
246
+
247
+ ## 3.14.0
248
+
249
+ * Defer to built-in caching for language environment setup, rather than manually using `actions/cache` in CI.
250
+
251
+ *Simon Fish*
252
+
253
+ * Add test coverage for use of `turbo_stream` helpers in components when `capture_compatibility_patch_enabled` is `true`.
254
+
255
+ *Simon Fish*
256
+
257
+ * Add experimental `SlotableDefault` module, allowing components to define a `default_SLOTNAME` method to provide a default value for slots.
258
+
259
+ *Joel Hawksley*
260
+
261
+ * Add documentation on rendering ViewComponents outside of the view context.
262
+
263
+ *Joel Hawksley*
264
+
265
+ * Look for preview files that end in `preview.rb` rather than `_preview.rb` to allow previews to exist in sidecar directory with test files.
266
+
267
+ *Seth Herr*
268
+
269
+ * Add `assert_component_rendered` test helper.
270
+
271
+ *Reegan Viljoen*
272
+
273
+ * Add `prefix:` option to `use_helpers`.
274
+
275
+ *Reegan Viljoen*
276
+
277
+ * Add support for Rails 7.2.
278
+
279
+ *Reegan Viljoen*
280
+
281
+ ## 3.13.0
282
+
283
+ * Add ruby head and YJIT to CI.
284
+
285
+ *Reegan Viljoen*
286
+
287
+ * Fixed a bug where inline templates where unable to remove trailing whitespace without throwing an error.
288
+
289
+ *Reegan Viljoen*
290
+
291
+ * Fixed CI for Rails main.
292
+
293
+ *Reegan Viljoen*
294
+
295
+ * Add `from:` option to `use_helpers` to allow for more flexible helper inclusion from modules.
296
+
297
+ *Reegan Viljoen*
298
+
299
+ * Fixed ruby head matcher issue.
300
+
301
+ *Reegan Viljoen*
302
+
303
+ * Fix a bug where component previews would crash with "undefined local variable or method `preview_source`."
304
+
305
+ *Henning Koch*
306
+
307
+ ## 3.12.1
308
+
309
+ * Ensure content is rendered correctly for forwarded slots.
310
+
311
+ *Cameron Dutro*
312
+
313
+ ## 3.12.0
314
+
315
+ * Remove offline links from resources.
316
+
317
+ *Paulo Henrique Meneses*
318
+
319
+ * Fix templates not being correctly populated when caller location label has a prefix.
320
+
321
+ On the upstream version of Ruby, method owners are now included in backtraces as prefixes. This caused the call stack filtering to not work as intended and thus `source_location` to be incorrect for child ViewComponents, consequently not populating templates correctly.
322
+
323
+ *Allan Pires, Jason Kim*
324
+
325
+ * Use component path for generating RSpec files.
326
+
327
+ When generating new RSpec files for components, the generator will use the `view_component_path` value in the config to decide where to put the new spec file. For instance, if the `view_component_path` option has been changed to `app/views/components`, the generator will put the spec file in `spec/views/components`. **If the `view_component_path` doesn't start with `app/`, then the generator will fall back to `spec/components/`.**
328
+
329
+ This feature is enabled via the `config.view_component.generate.use_component_path_for_rspec_tests` option, defaulting to `false`. The default will change to `true` in ViewComponent v4.
330
+
331
+ *William Mathewson*
332
+
333
+ ## 3.11.0
334
+
335
+ * Fix running non-integration tests under Rails main.
336
+
337
+ *Cameron Dutro*
338
+
339
+ * Better name and link for Avo.
340
+
341
+ *Adrian Marin*
342
+
343
+ * Document using rack-mini-profiler with ViewComponent.
344
+
345
+ *Thomas Carr*
346
+
347
+ * Move dependencies to gemspec.
348
+
349
+ *Joel Hawksley*
350
+
351
+ * Include ViewComponent::UseHelpers by default.
352
+
353
+ *Reegan Viljoen*
354
+
355
+ * Bump `puma` in Gemfile.lock.
356
+
357
+ *Cameron Dutro*
358
+
359
+ * Add Keenly to users list.
360
+
361
+ *Vinoth*
362
+
363
+ ## 3.10.0
364
+
365
+ * Fix html escaping in `#call` for non-strings.
366
+
367
+ *Reegan Viljoen, Cameron Dutro*
368
+
369
+ * Add `output_preamble` to match `output_postamble`, using the same safety checks.
370
+
371
+ *Kali Donovan, Michael Daross*
372
+
373
+ * Exclude html escaping of I18n reserved keys with `I18n::RESERVED_KEYS` rather than `I18n.reserved_keys_pattern`.
374
+
375
+ *Nick Coyne*
376
+
377
+ * Update CI configuration to use `Appraisal`.
378
+
379
+ *Hans Lemuet, Simon Fish*
380
+
381
+ ## 3.9.0
382
+
383
+ * Don’t break `rails stats` if ViewComponent path is missing.
384
+
385
+ *Claudio Baccigalupo*
386
+
387
+ * Add deprecation warnings for EOL ruby and Rails versions and patches associated with them.
388
+
389
+ *Reegan Viljoen*
390
+
391
+ * Add support for Ruby 3.3.
392
+
393
+ *Reegan Viljoen*
394
+
395
+ * Allow translations to be inherited and overridden in subclasses.
396
+
397
+ *Elia Schito*
398
+
399
+ * Resolve console warnings when running test suite.
400
+
401
+ *Joel Hawksley*
402
+
403
+ * Fix spelling in a local variable.
404
+
405
+ *Olle Jonsson*
406
+
407
+ * Avoid duplicating rendered string when `output_postamble` is blank.
408
+
409
+ *Mitchell Henke*
410
+
411
+ * Ensure HTML output safety.
412
+
413
+ *Cameron Dutro*
414
+
415
+ ## 3.8.0
416
+
417
+ * Use correct value for the `config.action_dispatch.show_exceptions` config option for edge Rails.
418
+
419
+ *Cameron Dutro*
420
+
421
+ * Remove unsupported versions of Rails & Ruby from CI matrix.
422
+
423
+ *Reegan Viljoen*
424
+
425
+ * Raise error when uncountable slot names are used in `renders_many`
426
+
427
+ *Hugo Chantelauze*
428
+ *Reegan Viljoen*
429
+
430
+ * Replace usage of `String#ends_with?` with `String#end_with?` to reduce the dependency on ActiveSupport core extensions.
431
+
432
+ *halo*
433
+
434
+ * Don't add ActionDispatch::Static middleware unless `public_file_server.enabled`.
435
+
436
+ *Daniel Gonzalez*
437
+ *Reegan Viljoen*
438
+
439
+ * Resolve an issue where slots starting with `call` would cause a `NameError`
440
+
441
+ *Blake Williams*
442
+
443
+ * Add `use_helper` API.
444
+
445
+ *Reegan Viljoen*
446
+
447
+ * Fix bug where the `Rails` module wasn't being searched from the root namespace.
448
+
449
+ *Zenéixe*
450
+
451
+ * Fix bug where `#with_request_url`, set the incorrect `request.fullpath`.
452
+
453
+ *Nachiket Pusalkar*
454
+
455
+ * Allow setting method when using the `with_request_url` test helper.
456
+
457
+ *Andrew Duthie*
458
+
459
+ ## 3.7.0
460
+
461
+ * Support Rails 7.1 in CI.
462
+
463
+ *Reegan Viljoen*
464
+ *Cameron Dutro*
465
+
466
+ * Document the capture compatibility patch on the Known issues page.
467
+
468
+ *Simon Fish*
469
+
470
+ * Add Simundia to list of companies using ViewComponent.
471
+
472
+ *Alexandre Ignjatovic*
473
+
474
+ * Reduce UnboundMethod objects by memoizing initialize_parameters.
475
+
476
+ *Rainer Borene*
477
+
478
+ * Improve docs about inline templates interpolation.
479
+
480
+ *Hans Lemuet*
481
+
482
+ * Update generators.md to clarify the way of changing `config.view_component.view_component_path`.
483
+
484
+ *Shozo Hatta*
485
+
486
+ * Attempt to fix Ferrum timeout errors by creating driver with unique name.
487
+
488
+ *Cameron Dutro*
489
+
490
+ ## 3.6.0
491
+
492
+ * Refer to `helpers` in `NameError` message in development and test environments.
493
+
494
+ *Simon Fish*
495
+
496
+ * Fix API documentation and revert unnecessary change in `preview.rb`.
497
+
498
+ *Richard Macklin*
499
+
500
+ * Initialize ViewComponent::Config with defaults before framework load.
501
+
502
+ *Simon Fish*
503
+
504
+ * Add 3.2 to the list of Ruby CI versions
505
+
506
+ *Igor Drozdov*
507
+
508
+ * Stop running PVC's `docs:preview` rake task in CI, as the old docsite has been removed.
509
+
510
+ *Cameron Dutro*
511
+
512
+ * Minor testing documentation improvement.
513
+
514
+ *Travis Gaff*
515
+
516
+ * Add SearchApi to users list.
517
+
518
+ *Sebastjan Prachovskij*
519
+
520
+ * Fix `#with_request_url` to ensure `request.query_parameters` is an instance of ActiveSupport::HashWithIndifferentAccess.
521
+
522
+ *milk1000cc*
523
+
524
+ * Add PeopleForce to list of companies using ViewComponent.
525
+
526
+ *Volodymyr Khandiuk*
527
+
528
+ ## 3.5.0
529
+
530
+ * Add Skroutz to users list.
531
+
532
+ *Chris Nitsas*
533
+
534
+ * Improve implementation of `#render_parent` so it respects variants and deep inheritance hierarchies.
535
+
536
+ *Cameron Dutro*
537
+
538
+ * Add CharlieHR to users list.
539
+
540
+ *Alex Balhatchet*
541
+
542
+ ## 3.4.0
543
+
544
+ * Avoid including Rails `url_helpers` into `Preview` class when they're not defined.
545
+
546
+ *Richard Macklin*
547
+
548
+ * Allow instrumentation to be automatically included in Server-Timing headers generated by Rails. To enable this set the config `config.use_deprecated_instrumentation_name = false`. The old key `!render.view_component` is deprecated: update ActiveSupport::Notification subscriptions to `render.view_component`.
549
+
550
+ *Travis Gaff*
551
+
552
+ ## 3.3.0
553
+
554
+ * Include InlineTemplate by default in Base. **Note:** It's no longer necessary to include `ViewComponent::InlineTemplate` to use inline templates.
555
+
556
+ *Joel Hawksley*
557
+
558
+ * Allow Setting host when using the `with_request_url` test helper.
559
+
560
+ *Daniel Alfaro*
561
+
562
+ * Resolve ambiguous preview paths when using components without the Component suffix.
563
+
564
+ *Reed Law*
565
+
566
+ ## 3.2.0
567
+
568
+ * Fix viewcomponent.org Axe violations.
569
+
570
+ *Joel Hawksley*
571
+
572
+ * Fix example of RSpec configuration in docs
573
+
574
+ *Pasha Kalashnikov*
575
+
576
+ * Add URL helpers to previews
577
+
578
+ *Reegan Viljoen*
579
+
580
+ ## 3.1.0
581
+
582
+ * Check `defined?(Rails) && Rails.application` before using `ViewComponent::Base.config.view_component_path`.
583
+
584
+ *Donapieppo*
585
+
586
+ * Allow customization of polymorphic slot setters.
587
+
588
+ *Cameron Dutro*
589
+
590
+ * Fix duplication in configuration docs.
591
+
592
+ *Tom Chen*
593
+
594
+ * Fix helpers not reloading in development.
595
+
596
+ *Jonathan del Strother*
597
+
598
+ * Add `SECURITY.md`.
599
+
600
+ *Joel Hawksley*
601
+
602
+ * Add Ophelos to list of companies using ViewComponent.
603
+
604
+ *Graham Rogers*
605
+
606
+ * Add FlightLogger to list of companies using ViewComponent.
607
+
608
+ *Joseph Carpenter*
609
+
610
+ * Fix coverage reports overwriting each other when running locally.
611
+
612
+ *Jonathan del Strother*
613
+
614
+ * Add @reeganviljoen to triage team.
615
+
616
+ *Reegan Viljoen*
617
+
618
+ ### v3.0.0
619
+
620
+ 1,000+ days and 100+ releases later, the 200+ contributors to ViewComponent are proud to ship v3.0.0!
621
+
622
+ We're so grateful for all the work of community members to get us to this release. Whether it’s filing bug reports, designing APIs in long-winded discussion threads, or writing code itself, ViewComponent is built by the community, for the community. We couldn’t be more proud of what we’re building together :heart:
623
+
624
+ This release makes the following breaking changes, many of which have long been deprecated:
625
+
626
+ * BREAKING: Remove deprecated slots setter methods. Use `with_SLOT_NAME` instead.
627
+
628
+ *Joel Hawksley*
629
+
630
+ For example:
631
+
632
+ ```diff
633
+ <%= render BlogComponent.new do |component| %>
634
+ - <% component.header do %>
635
+ + <% component.with_header do %>
636
+ <%= link_to "My blog", root_path %>
637
+ <% end %>
638
+ <% end %>
639
+ ```
640
+
641
+ * BREAKING: Remove deprecated SlotsV1 in favor of current SlotsV2.
642
+
643
+ *Joel Hawksley*
644
+
645
+ * BREAKING: Remove deprecated `content_areas` feature. Use Slots instead.
646
+
647
+ *Joel Hawksley*
648
+
649
+ * BREAKING: Remove deprecated support for loading ViewComponent engine manually. Make sure `require "view_component/engine"` is removed from `Gemfile`.
650
+
651
+ *Joel Hawksley*
652
+
653
+ * BREAKING: Remove deprecated `generate_*` methods. Use `generate.*` instead.
654
+
655
+ *Joel Hawksley*
656
+
657
+ * BREAKING: Remove deprecated `with_variant` method.
658
+
659
+ *Joel Hawksley*
660
+
661
+ * BREAKING: Remove deprecated `rendered_component` in favor of `rendered_content`.
662
+
663
+ *Joel Hawksley*
664
+
665
+ * BREAKING: Remove deprecated `config.preview_path` in favor of `config.preview_paths`.
666
+
667
+ *Joel Hawksley*
668
+
669
+ * BREAKING: Support Ruby 2.7+ instead of 2.4+
670
+
671
+ *Joel Hawksley*
672
+
673
+ * BREAKING: Remove deprecated `before_render_check`.
674
+
675
+ *Joel Hawksley*
676
+
677
+ * BREAKING: Change counter variable to start iterating from `0` instead of `1`.
678
+
679
+ *Frank S*
680
+
681
+ * BREAKING: `#SLOT_NAME` getter no longer accepts arguments. This change was missed as part of the earlier deprecation in `3.0.0.rc1`.
682
+
683
+ *Joel Hawksley*
684
+
685
+ * BREAKING: Raise `TranslateCalledBeforeRenderError`, `ControllerCalledBeforeRenderError`, or `HelpersCalledBeforeRenderError` instead of `ViewContextCalledBeforeRenderError`.
686
+
687
+ *Joel Hawksley*
688
+
689
+ * BREAKING: Raise `SlotPredicateNameError`, `RedefinedSlotError`, `ReservedSingularSlotNameError`, `ContentSlotNameError`, `InvalidSlotDefinitionError`, `ReservedPluralSlotNameError`, `ContentAlreadySetForPolymorphicSlotErrror`, `SystemTestControllerOnlyAllowedInTestError`, `SystemTestControllerNefariousPathError`, `NoMatchingTemplatesForPreviewError`, `MultipleMatchingTemplatesForPreviewError`, `DuplicateContentError`, `EmptyOrInvalidInitializerError`, `MissingCollectionArgumentError`, `ReservedParameterError`, `InvalidCollectionArgumentError`, `MultipleInlineTemplatesError`, `MissingPreviewTemplateError`, `DuplicateSlotContentError` or `NilWithContentError` instead of generic error classes.
690
+
691
+ *Joel Hawksley*
692
+
693
+ * BREAKING: Rename `SlotV2` to `Slot` and `SlotableV2` to `Slotable`.
694
+
695
+ *Joel Hawksley*
696
+
697
+ * BREAKING: Incorporate `PolymorphicSlots` into `Slotable`. To migrate, remove any references to `PolymorphicSlots` as they are no longer necessary.
698
+
699
+ *Joel Hawksley*
700
+
701
+ * BREAKING: Rename private TestHelpers#controller, #build_controller, #request, and #preview_class to avoid conflicts. Note: While these methods were undocumented and marked as private, they were accessible in tests. As such, we're considering this to be a breaking change.
702
+
703
+ *Joel Hawksley*
704
+
705
+ * Add support for CSP nonces inside of components.
706
+
707
+ *Reegan Viljoen*
708
+
709
+ ### v3.0.0.rc6
710
+
711
+ Run into an issue with this release candidate? [Let us know](https://github.com/ViewComponent/view_component/issues/1629). We hope to release v3.0.0 in the near future!
712
+
713
+ * BREAKING: `#SLOT_NAME` getter no longer accepts arguments. This change was missed as part of the earlier deprecation in `3.0.0.rc1`.
714
+
715
+ *Joel Hawksley*
716
+
717
+ * BREAKING: Raise `TranslateCalledBeforeRenderError`, `ControllerCalledBeforeRenderError`, or `HelpersCalledBeforeRenderError` instead of `ViewContextCalledBeforeRenderError`.
718
+
719
+ *Joel Hawksley*
720
+
721
+ * BREAKING: Raise `SlotPredicateNameError`, `RedefinedSlotError`, `ReservedSingularSlotNameError`, `ContentSlotNameError`, `InvalidSlotDefinitionError`, `ReservedPluralSlotNameError`, `ContentAlreadySetForPolymorphicSlotErrror`, `SystemTestControllerOnlyAllowedInTestError`, `SystemTestControllerNefariousPathError`, `NoMatchingTemplatesForPreviewError`, `MultipleMatchingTemplatesForPreviewError`, `DuplicateContentError`, `EmptyOrInvalidInitializerError`, `MissingCollectionArgumentError`, `ReservedParameterError`, `InvalidCollectionArgumentError`, `MultipleInlineTemplatesError`, `MissingPreviewTemplateError`, `DuplicateSlotContentError` or `NilWithContentError` instead of generic error classes.
722
+
723
+ *Joel Hawksley*
724
+
725
+ * Fix bug where `content?` and `with_content` didn't work reliably with slots.
726
+
727
+ *Derek Kniffin, Joel Hawksley*
728
+
729
+ * Add `with_SLOT_NAME_content` helper.
730
+
731
+ *Will Cosgrove*
732
+
733
+ * Allow ActiveRecord objects to be passed to `renders_many`.
734
+
735
+ *Leigh Halliday*
736
+
737
+ * Fix broken links in documentation.
738
+
739
+ *Ellen Keal*
740
+
741
+ * Run `standardrb` against markdown in docs.
742
+
743
+ *Joel Hawksley*
744
+
745
+ * Allow `.with_content` to be redefined by components.
746
+
747
+ *Joel Hawksley*
748
+
749
+ * Run `standardrb` against markdown in docs.
750
+
751
+ *Joel Hawksley*
752
+
753
+ * Raise error if translations are used in initializer.
754
+
755
+ *Joel Hawksley*
756
+
757
+ ## v3.0.0.rc5
758
+
759
+ Run into an issue with this release candidate? [Let us know](https://github.com/ViewComponent/view_component/issues/1629).
760
+
761
+ * Fix bug where `mkdir_p` failed due to incorrect permissions.
762
+
763
+ *Joel Hawksley*
764
+
765
+ * Check for inline `erb_template` calls when deciding whether to compile a component's superclass.
766
+
767
+ *Justin Kenyon*
768
+
769
+ * Protect against `SystemStackError` if `CaptureCompatibility` module is included more than once.
770
+
771
+ *Cameron Dutro*
772
+
773
+ ## v3.0.0.rc4
774
+
775
+ Run into an issue with this release candidate? [Let us know](https://github.com/ViewComponent/view_component/issues/1629).
776
+
777
+ * Add `TestHelpers#vc_test_request`.
778
+
779
+ *Joel Hawksley*
780
+
781
+ ## v3.0.0.rc3
782
+
783
+ Run into an issue with this release candidate? [Let us know](https://github.com/ViewComponent/view_component/issues/1629).
784
+
785
+ * Fix typos in generator docs.
786
+
787
+ *Sascha Karnatz*
788
+
789
+ * Add `TestHelpers#vc_test_controller`.
790
+
791
+ *Joel Hawksley*
792
+
793
+ * Document `config.view_component.capture_compatibility_patch_enabled` as option for the known incompatibilities with Rails form helpers.
794
+
795
+ *Tobias L. Maier*
796
+
797
+ * Add support for experimental inline templates.
798
+
799
+ *Blake Williams*
800
+
801
+ * Expose `translate` and `t` I18n methods on component classes.
802
+
803
+ *Elia Schito*
804
+
805
+ * Protect against Arbitrary File Read edge case in `ViewComponentsSystemTestController`.
806
+
807
+ *Nick Malcolm*
808
+
809
+ ## v3.0.0.rc2
810
+
811
+ Run into an issue with this release? [Let us know](https://github.com/ViewComponent/view_component/issues/1629).
812
+
813
+ * BREAKING: Rename `SlotV2` to `Slot` and `SlotableV2` to `Slotable`.
814
+
815
+ *Joel Hawksley*
816
+
817
+ * BREAKING: Incorporate `PolymorphicSlots` into `Slotable`. To migrate, remove any references to `PolymorphicSlots` as they are no longer necessary.
818
+
819
+ *Joel Hawksley*
820
+
821
+ * BREAKING: Rename private TestHelpers#controller, #build_controller, #request, and #preview_class to avoid conflicts. Note: While these methods were undocumented and marked as private, they were accessible in tests. As such, we're considering this to be a breaking change.
822
+
823
+ *Joel Hawksley*
824
+
825
+ * Avoid loading ActionView::Base during Rails initialization. Originally submitted in #1528.
826
+
827
+ *Jonathan del Strother*
828
+
829
+ * Improve documentation of known incompatibilities with Rails form helpers.
830
+
831
+ *Tobias L. Maier*
832
+
833
+ * Remove dependency on environment task from `view_component:statsetup`.
834
+
835
+ *Svetlin Simonyan*
836
+
837
+ * Add experimental `config.view_component.capture_compatibility_patch_enabled` option resolving rendering issues related to forms, capture, turbo frames, etc.
838
+
839
+ *Blake Williams*
840
+
841
+ * Add `#content?` method that indicates if content has been passed to component.
842
+
843
+ *Joel Hawksley*
844
+
845
+ * Added example of a custom preview controller.
846
+
847
+ *Graham Rogers*
848
+
849
+ * Add Krystal to list of companies using ViewComponent.
850
+
851
+ *Matt Bearman*
852
+
853
+ * Add Mon Ami to list of companies using ViewComponent.
854
+
855
+ *Ethan Lee-Tyson*
856
+
857
+ ## 3.0.0.rc1
858
+
859
+ 1,000+ days and 100+ releases later, the 200+ contributors to ViewComponent are proud to ship v3.0.0!
860
+
861
+ We're so grateful for all the work of community members to get us to this release. Whether it’s filing bug reports, designing APIs in long-winded discussion threads, or writing code itself, ViewComponent is built by the community, for the community. We couldn’t be more proud of what we’re building together :heart:
862
+
863
+ This release makes the following breaking changes, many of which have long been deprecated:
864
+
865
+ * BREAKING: Remove deprecated slots setter methods. Use `with_SLOT_NAME` instead.
866
+
867
+ *Joel Hawksley*
868
+
869
+ * BREAKING: Remove deprecated SlotsV1 in favor of current SlotsV2.
870
+
871
+ *Joel Hawksley*
872
+
873
+ * BREAKING: Remove deprecated `content_areas` feature. Use Slots instead.
874
+
875
+ *Joel Hawksley*
876
+
877
+ * BREAKING: Remove deprecated support for loading ViewComponent engine manually. Make sure `require "view_component/engine"` is removed from `Gemfile`.
878
+
879
+ *Joel Hawksley*
880
+
881
+ * BREAKING: Remove deprecated `generate_*` methods. Use `generate.*` instead.
882
+
883
+ *Joel Hawksley*
884
+
885
+ * BREAKING: Remove deprecated `with_variant` method.
886
+
887
+ *Joel Hawksley*
888
+
889
+ * BREAKING: Remove deprecated `rendered_component` in favor of `rendered_content`.
890
+
891
+ *Joel Hawksley*
892
+
893
+ * BREAKING: Remove deprecated `config.preview_path` in favor of `config.preview_paths`.
894
+
895
+ *Joel Hawksley*
896
+
897
+ * BREAKING: Support Ruby 2.7+ instead of 2.4+
898
+
899
+ *Joel Hawksley*
900
+
901
+ * BREAKING: Remove deprecated `before_render_check`.
902
+
903
+ *Joel Hawksley*
904
+
905
+ * BREAKING: Change counter variable to start iterating from `0` instead of `1`.
906
+
907
+ *Frank S*
908
+
909
+ Run into an issue with this release? [Let us know](https://github.com/ViewComponent/view_component/issues/1629).
910
+
911
+ ## 2.82.0
912
+
913
+ * Revert "Avoid loading ActionView::Base during initialization (#1528)"
914
+
915
+ *Jon Rohan*
916
+
917
+ * Fix tests using `with_rendered_component_path` with custom layouts.
918
+
919
+ *Ian Hollander*
920
+
921
+ ## 2.81.0
922
+
923
+ * Adjust the way response objects are set on the preview controller to work around a recent change in Rails main.
924
+
925
+ *Cameron Dutro*
926
+
927
+ * Fix typo in "Generate a Stimulus controller" documentation.
928
+
929
+ *Ben Trewern*
930
+
931
+ * Modify the `render_in_view_context` test helper to forward its args to the block.
932
+
933
+ *Cameron Dutro*
934
+
935
+ ## 2.80.0
936
+
937
+ * Move system test endpoint out of the unrelated previews controller.
938
+
939
+ *Edwin Mak*
940
+
941
+ * Display Ruby 2.7 deprecation notice only once, when starting the application.
942
+
943
+ *Henrik Hauge Bjørnskov*
944
+
945
+ * Require Rails 5.2+ in gemspec and update documentation.
946
+
947
+ *Drew Bragg*
948
+
949
+ * Add documentation for using `with_rendered_component_path` with RSpec.
950
+
951
+ *Edwin Mak*
952
+
953
+ ## 2.79.0
954
+
955
+ * Add ability to pass explicit `preview_path` to preview generator.
956
+
957
+ *Erinna Chen*
958
+
959
+ * Add `with_rendered_component_path` helper for writing component system tests.
960
+
961
+ *Edwin Mak*
962
+
963
+ * Include gem name and deprecation horizon in every deprecation message.
964
+
965
+ *Jan Klimo*
966
+
967
+ ## 2.78.0
968
+
969
+ * Support variants with dots in their names.
970
+
971
+ *Javi Martín*
972
+
973
+ ## 2.77.0
974
+
975
+ * Support variants with dashes in their names.
976
+
977
+ *Javi Martín*
978
+
979
+ ## 2.76.0
980
+
981
+ * `Component.with_collection` supports components that accept splatted keyword arguments.
982
+
983
+ *Zee Spencer*
984
+
985
+ * Remove `config.view_component.use_consistent_rendering_lifecycle` since it is no longer planned for 3.0.
986
+
987
+ *Blake Williams*
988
+
989
+ * Prevent polymorphic slots from calculating `content` when setting a slot.
990
+
991
+ *Blake Williams*
992
+
993
+ * Add ability to pass in the preview class to `render_preview`.
994
+
995
+ *Jon Rohan*
996
+
997
+ * Fix issue causing PVC tests to fail in CI.
998
+
999
+ *Cameron Dutro*
1000
+
1001
+ * Fix YARD docs build task.
1002
+
1003
+ *Hans Lemuet*
1004
+
1005
+ * Add Startup Jobs to list of companies using ViewComponent.
1006
+
1007
+ *Marc Köhlbrugge*
1008
+
1009
+ * Run PVC's accessibility tests in a single process to avoid resource contention in CI.
1010
+
1011
+ *Cameron Dutro*
1012
+
1013
+ ## 2.75.0
1014
+
1015
+ * Avoid loading ActionView::Base during Rails initialization.
1016
+
1017
+ *Jonathan del Strother*
1018
+
1019
+ <!-- vale off -->
1020
+ * Mention lambda slots rendering returned values lazily in the guide.
1021
+
1022
+ *Graham Rogers*
1023
+ <!-- vale on -->
1024
+
1025
+ * Add "ViewComponent In The Wild" articles to resources.
1026
+
1027
+ *Alexander Baygeldin*
1028
+
1029
+ ## 2.74.1
1030
+
1031
+ * Add more users of ViewComponent to docs.
1032
+
1033
+ *Joel Hawksley*
1034
+
1035
+ * Add a known issue for usage with `turbo_frame_tag` to the documentation.
1036
+
1037
+ *Vlad Radulescu*
1038
+
1039
+ * Add note about system testing components with previews.
1040
+
1041
+ *Joel Hawksley*
1042
+
1043
+ * Remove locking mechanisms from the compiler.
1044
+
1045
+ *Cameron Dutro*
1046
+
1047
+ ## 2.74.0
1048
+
1049
+ * Add Avo to list of companies using ViewComponent.
1050
+
1051
+ *Adrian Marin*
1052
+
1053
+ * Promote experimental `_output_postamble` method to public API as `output_postamble`.
1054
+
1055
+ *Joel Hawksley*
1056
+
1057
+ * Promote experimental `_sidecar_files` method to public API as `sidecar_files`.
1058
+
1059
+ *Joel Hawksley*
1060
+
1061
+ * Fix `show_previews` regression introduced in 2.73.0.
1062
+
1063
+ *Andy Baranov*
1064
+
1065
+ * `with_request_url` test helper supports router constraints (such as Devise).
1066
+
1067
+ *Aotokitsuruya*
1068
+
1069
+ ## 2.73.0
1070
+
1071
+ * Remove experimental `_after_compile` lifecycle method.
1072
+
1073
+ *Joel Hawksley*
1074
+
1075
+ * Fix capitalization of JavaScript in docs.
1076
+
1077
+ *Erinna Chen*
1078
+
1079
+ * Add PrintReleaf to list of companies using ViewComponent.
1080
+
1081
+ *Ry Kulp*
1082
+
1083
+ * Simplify CI configuration to a single build per Ruby/Rails version.
1084
+
1085
+ *Joel Hawksley*
1086
+
1087
+ * Correctly document `generate.sidecar` config option.
1088
+
1089
+ *Ruben Smit*
1090
+
1091
+ * Add Yobbers to list of companies using ViewComponent.
1092
+
1093
+ *Anton Prins*
1094
+
1095
+ ## 2.72.0
1096
+
1097
+ * Deprecate support for Ruby < 2.7 for removal in v3.0.0.
1098
+
1099
+ *Joel Hawksley*
1100
+
1101
+ * Add `changelog_uri` to gemspec.
1102
+
1103
+ *Joel Hawksley*
1104
+
1105
+ * Link to `CHANGELOG.md` instead of symlink.
1106
+
1107
+ *Joel Hawksley.
1108
+
1109
+ * Add Aluuno to list of companies using ViewComponent.
1110
+
1111
+ *Daniel Naves de Carvalho*
1112
+
1113
+ * Add `source_code_uri` to gemspec.
1114
+
1115
+ *Yoshiyuki Hirano*
1116
+
1117
+ * Update link to benchmark script in docs.
1118
+
1119
+ *Daniel Diekmeier*
1120
+
1121
+ * Add special exception message for `renders_one :content` explaining that content passed as a block will be assigned to the `content` accessor without having to create an explicit slot.
1122
+
1123
+ *Daniel Diekmeier*
1124
+
1125
+ ## 2.71.0
1126
+
1127
+ **ViewComponent has moved to a new organization: [https://github.com/viewcomponent/view_component](https://github.com/viewcomponent/view_component). See [https://github.com/viewcomponent/view_component/issues/1424](https://github.com/viewcomponent/view_component/issues/1424) for more details.**
1128
+
1129
+ ## 2.70.0
1130
+
1131
+ * `render_preview` can pass parameters to preview.
1132
+
1133
+ *Joel Hawksley*
1134
+
1135
+ * Fix docs typos.
1136
+
1137
+ *Joel Hawksley*
1138
+
1139
+ * Add architectural decisions to documentation and rename sidebar sections.
1140
+
1141
+ *Joel Hawksley*
1142
+
1143
+ * Clarify documentation on testability of Rails views.
1144
+
1145
+ *Joel Hawksley*
1146
+
1147
+ * Add Arrows to list of companies using ViewComponent.
1148
+
1149
+ *Matt Swanson*
1150
+
1151
+ * Add WIP to list of companies using ViewComponent.
1152
+
1153
+ *Marc Köhlbrugge*
1154
+
1155
+ * Update slots documentation to include how to reference slots.
1156
+
1157
+ *Brittany Ellich*
1158
+
1159
+ * Add Clio to list of companies using ViewComponent.
1160
+
1161
+ *Mike Buckley*
1162
+
1163
+ ## 2.69.0
1164
+
1165
+ * Add missing `require` to fix `pvc` build.
1166
+
1167
+ *Joel Hawksley*
1168
+
1169
+ * Add `config.view_component.use_consistent_rendering_lifecycle` to ensure side-effects in `content` are consistently evaluated before components are rendered. This change effectively means that `content` is evaluated for every component render where `render?` returns true. As a result, code that's passed to a component via a block/content will now always be evaluated, before `#call`, which can reveal bugs in existing components. This configuration option defaults to `false` but will be enabled in 3.0 and the old behavior will be removed.
1170
+
1171
+ *Blake Williams*
1172
+
1173
+ * Update Prism to version 1.28.0.
1174
+
1175
+ *Thomas Hutterer*
1176
+
1177
+ * Corrects the deprecation warning for named slots to show the file and line where the slot is called.
1178
+
1179
+ *River Bailey*
1180
+
1181
+ ## 2.68.0
1182
+
1183
+ * Update `gemspec` author to be ViewComponent team.
1184
+
1185
+ *Joel Hawksley*
1186
+
1187
+ * Fix bug where `ViewComponent::Compiler` wasn't required.
1188
+
1189
+ *Joel Hawksley*
1190
+
1191
+ ## 2.67.0
1192
+
1193
+ * Use ViewComponent::Base.config as the internal endpoint for config.
1194
+
1195
+ *Simon Fish*
1196
+
1197
+ * Fix bug where `#with_request_url`, when used with query string, set the incorrect `request.path` and `request.fullpath`.
1198
+
1199
+ *Franz Liedke*
1200
+
1201
+ * Add link to [ViewComponentAttributes](https://github.com/amba-Health/view_component_attributes) in Resources section of docs.
1202
+
1203
+ *Romaric Pascal*
1204
+
1205
+ * `render_preview` test helper is available by default. It is no longer necessary to include `ViewComponent::RenderPreviewHelper`.
1206
+
1207
+ *Joel Hawksley*
1208
+
1209
+ ## 2.66.0
1210
+
1211
+ * Add missing `generate.sidecar`, `generate.stimulus_controller`, `generate.locale`, `generate.distinct_locale_files`, `generate.preview` config options to `config.view_component`.
1212
+
1213
+ *Simon Fish*
1214
+
1215
+ ## 2.65.0
1216
+
1217
+ * Raise `ArgumentError` when conflicting Slots are defined.
1218
+
1219
+ Before this change it was possible to define Slots with conflicting names, for example:
1220
+
1221
+ ```ruby
1222
+ class MyComponent < ViewComponent::Base
1223
+ renders_one :item
1224
+ renders_many :items
1225
+ end
1226
+ ```
1227
+
1228
+ *Joel Hawksley*
1229
+
1230
+ ## 2.64.0
1231
+
1232
+ * Add `warn_on_deprecated_slot_setter` flag to opt-in to deprecation warning.
1233
+
1234
+ In [v2.54.0](https://viewcomponent.org/CHANGELOG.html#2540), the Slots API was updated to require the `with_*` prefix for setting Slots. The non-`with_*` setters will be deprecated in a coming version and removed in `v3.0`.
1235
+
1236
+ To enable the coming deprecation warning, add `warn_on_deprecated_slot_setter`:
1237
+
1238
+ ```ruby
1239
+ class DeprecatedSlotsSetterComponent < ViewComponent::Base
1240
+ warn_on_deprecated_slot_setter
1241
+ end
1242
+ ```
1243
+
1244
+ *Joel Hawksley*
1245
+
1246
+ * Add [`m`](https://rubygems.org/gems/m) to development environment.
1247
+
1248
+ *Joel Hawksley*
1249
+
1250
+ * Fix potential deadlock scenario in the compiler's development mode.
1251
+
1252
+ *Blake Williams*
1253
+
1254
+ ## 2.63.0
1255
+
1256
+ * Fixed typo in `renders_many` documentation.
1257
+
1258
+ *Graham Rogers*
1259
+
1260
+ * Add documentation about working with `turbo-rails`.
1261
+
1262
+ *Matheus Poli Camilo*
1263
+
1264
+ * Fix issue causing helper methods to not be available in nested components when the render monkey patch is disabled and `render_component` is used.
1265
+
1266
+ *Daniel Scheffknecht*
1267
+
1268
+ ## 2.62.0
1269
+
1270
+ * Remove the experimental global output buffer feature.
1271
+ * Restore functionality that used to attempt to compile templates on each call to `#render_in`.
1272
+ * Un-pin `rails` `main` dependency.
1273
+
1274
+ *Cameron Dutro*
1275
+
1276
+ * Add blank space between "in" and "ViewComponent" in a deprecation warning.
1277
+
1278
+ *Vikram Dighe*
1279
+
1280
+ * Add HappyCo to list of companies using ViewComponent.
1281
+
1282
+ *Josh Clayton*
1283
+
1284
+ * Add predicate method support to polymorphic slots.
1285
+
1286
+ *Graham Rogers*
1287
+
1288
+ ## 2.61.1
1289
+
1290
+ * Revert `Expose Capybara DSL methods directly inside tests.` This change unintentionally broke other Capybara methods and thus introduced a regression. We aren't confident that we can fail forward so we have decided to revert this change.
1291
+
1292
+ *Joel Hawksley, Blake Williams*
1293
+
1294
+ * Revert change making content evaluation consistent.
1295
+
1296
+ *Blake Williams*
1297
+
1298
+ * Pin `rails` `main` dependency due to incompatibility with Global Output Buffer.
1299
+
1300
+ *Joel Hawksley*
1301
+
1302
+ ## 2.61.0
1303
+
1304
+ * Ensure side-effects in `content` are consistently evaluated before components are rendered. This change effectively means that `content` is evaluated for every component render where `render?` returns true. As a result, code that is passed to a component via a block/content will now always be evaluated, before `#call`, which can reveal bugs in existing components.
1305
+
1306
+ *Blake Williams*
1307
+
1308
+ ## 2.60.0
1309
+
1310
+ * Add support for `render_preview` in RSpec tests.
1311
+
1312
+ *Thomas Hutterer*
1313
+
1314
+ ## 2.59.0
1315
+
1316
+ * Expose Capybara DSL methods directly inside tests.
1317
+
1318
+ The following Capybara methods are now available directly without having to use the `page` method:
1319
+
1320
+ * [`all`](https://rubydoc.info/github/teamcapybara/capybara/Capybara%2FNode%2FFinders:all)
1321
+ * [`first`](https://rubydoc.info/github/teamcapybara/capybara/Capybara%2FNode%2FFinders:first)
1322
+ * [`text`](https://rubydoc.info/github/teamcapybara/capybara/Capybara%2FNode%2FSimple:text)
1323
+ * [`find`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FFinders:find)
1324
+ * [`find_all`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FFinders:find_all)
1325
+ * [`find_button`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FFinders:find_button)
1326
+ * [`find_by_id`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FFinders:find_by_id)
1327
+ * [`find_field`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FFinders:find_field)
1328
+ * [`find_link`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FFinders:find_link)
1329
+ * [`has_content?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_content%3F)
1330
+ * [`has_text?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_text%3F)
1331
+ * [`has_css?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_css%3F)
1332
+ * [`has_no_content?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_content%3F)
1333
+ * [`has_no_text?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_text%3F)
1334
+ * [`has_no_css?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_css%3F)
1335
+ * [`has_no_xpath?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_xpath%3F)
1336
+ * [`has_xpath?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_xpath%3F)
1337
+ * [`has_link?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_link%3F)
1338
+ * [`has_no_link?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_link%3F)
1339
+ * [`has_button?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_button%3F)
1340
+ * [`has_no_button?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_button%3F)
1341
+ * [`has_field?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_field%3F)
1342
+ * [`has_no_field?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_field%3F)
1343
+ * [`has_checked_field?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_checked_field%3F)
1344
+ * [`has_unchecked_field?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_unchecked_field%3F)
1345
+ * [`has_no_table?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_table%3F)
1346
+ * [`has_table?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_table%3F)
1347
+ * [`has_select?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_select%3F)
1348
+ * [`has_no_select?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_select%3F)
1349
+ * [`has_selector?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_selector%3F)
1350
+ * [`has_no_selector?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_selector%3F)
1351
+ * [`has_no_checked_field?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_checked_field%3F)
1352
+ * [`has_no_unchecked_field?`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FNode%2FMatchers:has_no_unchecked_field%3F)
1353
+
1354
+ * Add support for `within*` Capybara DLS methods:
1355
+
1356
+ * [`within`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FSession:within)
1357
+ * [`within_element`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FSession:within)
1358
+ * [`within_fieldset`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FSession:within_fieldset)
1359
+ * [`within_table`](https://rubydoc.info/github/teamcapybara/capybara/master/Capybara%2FSession:within_table)
1360
+
1361
+ *Jacob Carlborg*
1362
+
1363
+ ## 2.58.0
1364
+
1365
+ * Switch to `standardrb`.
1366
+
1367
+ *Joel Hawksley*
1368
+
1369
+ * Add BootrAils article to resources.
1370
+
1371
+ *Joel Hawksley*
1372
+
1373
+ * Add @boardfish and @spone as maintainers.
1374
+
1375
+ *Joel Hawksley, Cameron Dutro, Blake Williams*
1376
+
1377
+ * Re-compile updated, inherited templates when class caching is disabled.
1378
+
1379
+ *Patrick Arnett*
1380
+
1381
+ * Add the latest version to the docs index.
1382
+ * Improve the docs: add the versions various features were introduced in.
1383
+
1384
+ *Hans Lemuet*
1385
+
1386
+ * Update docs to reflect lack of block content support in controllers.
1387
+
1388
+ *Joel Hawksley*
1389
+
1390
+ * Prevent adding duplicates to `autoload_paths`.
1391
+
1392
+ *Thomas Hutterer*
1393
+
1394
+ * Add FreeAgent to list of companies using ViewComponent.
1395
+
1396
+ *Simon Fish*
1397
+
1398
+ * Include polymorphic slots in `ViewComponent::Base` by default.
1399
+
1400
+ *Cameron Dutro*
1401
+
1402
+ * Add per-component config option for stripping newlines from templates before compilation.
1403
+
1404
+ *Cameron Dutro*
1405
+
1406
+ * Add link to article by Matouš Borák.
1407
+
1408
+ *Joel Hawksley*
1409
+
1410
+ ## 2.57.1
1411
+
1412
+ * Fix issue causing `NoMethodError`s when calling helper methods from components rendered as part of a collection.
1413
+ * Fix syntax error in the ERB example in the polymorphic slots docs.
1414
+
1415
+ *Cameron Dutro*
1416
+
1417
+ ## 2.57.0
1418
+
1419
+ * Add missing `require` for `Translatable` module in `Base`.
1420
+
1421
+ *Hans Lemuet*
1422
+
1423
+ * Allow anything that responds to `#render_in` to be rendered in the parent component's view context.
1424
+
1425
+ *Cameron Dutro*
1426
+
1427
+ * Fix script/release so it honors semver.
1428
+
1429
+ *Cameron Dutro*
1430
+
1431
+ ## 2.56.2
1432
+
1433
+ * Restore removed `rendered_component`, marking it for deprecation in v3.0.0.
1434
+
1435
+ *Tyson Gach, Richard Macklin, Joel Hawksley*
1436
+
1437
+ ## 2.56.1
1438
+
1439
+ * Rename private accessor `rendered_component` to `rendered_content`.
1440
+
1441
+ *Yoshiyuki Hirano, Simon Dawson*
1442
+
1443
+ ## 2.56.0
1444
+
1445
+ * Introduce experimental `render_preview` test helper. Note: `@rendered_component` in `TestHelpers` has been renamed to `@rendered_content`.
1446
+
1447
+ *Joel Hawksley*
1448
+
1449
+ * Move framework tests into sandbox application.
1450
+
1451
+ *Joel Hawksley*
1452
+
1453
+ * Add G2 to list of companies that use ViewComponent.
1454
+
1455
+ *Jack Shuff*
1456
+
1457
+ * Add Within3 to list of companies that use ViewComponent.
1458
+
1459
+ *Drew Bragg*
1460
+
1461
+ * Add Mission Met to list of companies that use ViewComponent.
1462
+
1463
+ *Nick Smith*
1464
+
1465
+ * Fix `#with_request_url` test helper not parsing nested query parameters into nested hashes.
1466
+
1467
+ *Richard Marbach*
1468
+
1469
+ ## 2.55.0
1470
+
1471
+ * Add `render_parent` convenience method to avoid confusion between `<%= super %>` and `<% super %>` in template code.
1472
+
1473
+ *Cameron Dutro*
1474
+
1475
+ * Add note about discouraging inheritance.
1476
+
1477
+ *Joel Hawksley*
1478
+
1479
+ * Clean up grammar in documentation.
1480
+
1481
+ *Joel Hawksley*
1482
+
1483
+ * The ViewComponent team at GitHub is hiring! We're looking for a Rails engineer with accessibility experience: [https://boards.greenhouse.io/github/jobs/4020166](https://boards.greenhouse.io/github/jobs/4020166). Reach out to joelhawksley@github.com with any questions!
1484
+
1485
+ * The ViewComponent team is hosting a happy hour at RailsConf. Join us for snacks, drinks, and stickers: [https://www.eventbrite.com/e/viewcomponent-happy-hour-tickets-304168585427](https://www.eventbrite.com/e/viewcomponent-happy-hour-tickets-304168585427)
1486
+
1487
+ ## 2.54.1
1488
+
1489
+ * Update docs dependencies.
1490
+
1491
+ *Joel Hawksley*
1492
+
1493
+ * Resolve warning in slots API.
1494
+ * Raise in the test environment when ViewComponent code emits a warning.
1495
+
1496
+ *Blake Williams*
1497
+
1498
+ ## 2.54.0
1499
+
1500
+ * Add `with_*` slot API for defining slots. Note: we plan to deprecate the non `with_*` API for slots in an upcoming release.
1501
+
1502
+ *Blake Williams*
1503
+
1504
+ * Add QuickNode to list of companies that use ViewComponent.
1505
+
1506
+ *Luc Castera*
1507
+
1508
+ * Include the `Translatable` module by default.
1509
+
1510
+ *Elia Schito*
1511
+
1512
+ * Update docs dependencies.
1513
+
1514
+ *Joel Hawksley*
1515
+
1516
+ ## 2.53.0
1517
+
1518
+ * Add support for relative I18n scopes to translations.
1519
+
1520
+ *Elia Schito*
1521
+
1522
+ * Update CI configuration to use latest Rails 7.0.
1523
+
1524
+ *Hans Lemuet*
1525
+
1526
+ * Document how to use blocks with lambda slots.
1527
+
1528
+ *Sam Partington*
1529
+
1530
+ * Skip Rails 5.2 in local test environment if using incompatible Ruby version.
1531
+
1532
+ *Cameron Dutro, Blake Williams, Joel Hawksley*
1533
+
1534
+ * Improve landing page documentation.
1535
+
1536
+ *Jason Swett*
1537
+
1538
+ * Add Bearer to list of companies that use ViewComponent.
1539
+
1540
+ *Yaroslav Shmarov*
1541
+
1542
+ * Add articles to resources page.
1543
+
1544
+ *Joel Hawksley*
1545
+
1546
+ * Enable rendering arbitrary block contents in the view context in tests.
1547
+
1548
+ *Cameron Dutro*
1549
+
1550
+ ## 2.52.0
1551
+
1552
+ * Add ADR for separate slot getter/setter API.
1553
+
1554
+ *Blake Williams*
1555
+
1556
+ * Add the option to use a "global" output buffer so `form_for` and friends can be used with view components.
1557
+
1558
+ *Cameron Dutro, Blake Williams*
1559
+
1560
+ * Fix fragment caching in partials when global output buffer is enabled.
1561
+ * Fix template inheritance when eager loading is disabled.
1562
+
1563
+ *Cameron Dutro*
1564
+
1565
+ ## 2.51.0
1566
+
1567
+ * Update the docs only when releasing a new version.
1568
+
1569
+ *Hans Lemuet*
1570
+
1571
+ * Alphabetize companies using ViewComponent and add Brightline to the list.
1572
+
1573
+ *Jack Schuss*
1574
+
1575
+ * Add CMYK value for ViewComponent Red color on logo page.
1576
+
1577
+ *Dylan Smith*
1578
+
1579
+ * Improve performance by moving template compilation from `#render_in` to `#render_template_for`.
1580
+
1581
+ *Cameron Dutro*
1582
+
1583
+ ## 2.50.0
1584
+
1585
+ * Add tests for `layout` usage when rendering via controller.
1586
+
1587
+ *Felipe Sateler*
1588
+
1589
+ * Support returning Arrays from i18n files, and support marking them as HTML-safe translations.
1590
+
1591
+ *foca*
1592
+
1593
+ * Add Cometeer and Framework to users list.
1594
+
1595
+ *Elia Schito*
1596
+
1597
+ * Update Microsoft Vale styles.
1598
+
1599
+ *Simon Fish*
1600
+
1601
+ * Fix example in testing guide for how to setup default Rails tests.
1602
+
1603
+ *Steven Hansen*
1604
+
1605
+ * Update benchmark script to render multiple components/partials instead of a single instance per-run.
1606
+
1607
+ *Blake Williams*
1608
+
1609
+ * Add predicate methods `#{slot_name}?` to slots.
1610
+
1611
+ *Hans Lemuet*
1612
+
1613
+ * Use a dedicated deprecation instance, silence it while testing.
1614
+
1615
+ *Max Beizer, Hans Lemuet, Elia Schito*
1616
+
1617
+ * Fix Ruby warnings.
1618
+
1619
+ *Hans Lemuet*
1620
+
1621
+ * Place all generator options under `config.generate` namespace.
1622
+
1623
+ *Simon Fish*
1624
+
1625
+ * Allow preview generator to use provided component attributes.
1626
+ * Add config option `config.view_component.generate.preview` to enable project-wide preview generation.
1627
+ * Ensure all generated `.rb` files include `# frozen_string_literal: true` statement.
1628
+
1629
+ *Bob Maerten*
1630
+
1631
+ * Add Shogun to users list.
1632
+
1633
+ *Bernie Chiu*
9
1634
 
10
1635
  ## 2.49.1
11
1636
 
12
- * Patch XSS vulnerability in `Translatable` module caused by improperly escaped interpolation arguments.
1637
+ * Patch XSS vulnerability in `ViewComponent::Translatable` module caused by improperly escaped interpolation arguments.
13
1638
 
14
1639
  *Cameron Dutro*
15
1640
 
@@ -39,10 +1664,14 @@ title: Changelog
39
1664
 
40
1665
  *Joel Hawksley*
41
1666
 
42
- * Add Ruby 3.1 and Rails 7.0 to CI
1667
+ * Add Ruby 3.1 and Rails 7.0 to CI.
43
1668
 
44
1669
  *Peter Goldstein*
45
1670
 
1671
+ * Move preview logic to module for easier app integration.
1672
+
1673
+ *Sammy Henningsson*
1674
+
46
1675
  ## 2.48.0
47
1676
 
48
1677
  * Correct path in example test command in Contributing docs.
@@ -63,7 +1692,7 @@ title: Changelog
63
1692
 
64
1693
  * Add generators to support `tailwindcss-rails`.
65
1694
 
66
- *Dino Maric*, *Hans Lemuet*
1695
+ *Dino Maric, Hans Lemuet*
67
1696
 
68
1697
  * Add a namespaced component example to docs.
69
1698
 
@@ -244,7 +1873,7 @@ title: Changelog
244
1873
 
245
1874
  * Rename internal accessor to use private naming.
246
1875
 
247
- *Joel Hawksley*, *Blake Williams*, *Cameron Dutro*
1876
+ *Joel Hawksley, Blake Williams, Cameron Dutro*
248
1877
 
249
1878
  * Add Github repo link to docs website header.
250
1879
 
@@ -312,7 +1941,7 @@ title: Changelog
312
1941
 
313
1942
  * Add support for `image_path` helper in previews.
314
1943
 
315
- *Tobias Ahlin*, *Joel Hawksley*
1944
+ *Tobias Ahlin, Joel Hawksley*
316
1945
 
317
1946
  * Add section to docs listing users of ViewComponent. Please submit a PR to add your team to the list!
318
1947
 
@@ -350,7 +1979,7 @@ title: Changelog
350
1979
 
351
1980
  * Fix bug where `helpers` would instantiate and use a new `view_context` in each component.
352
1981
 
353
- *Blake Williams*, *Ian C. Anderson*
1982
+ *Blake Williams, Ian C. Anderson*
354
1983
 
355
1984
  * Implement polymorphic slots as experimental feature. See the Slots documentation to learn more.
356
1985
 
@@ -377,7 +2006,7 @@ title: Changelog
377
2006
 
378
2007
  * Fix bug where `with_collection_parameter` didn't inherit from parent component.
379
2008
 
380
- *Will Drexler*, *Christian Campoli*
2009
+ *Will Drexler, Christian Campoli*
381
2010
 
382
2011
  * Allow query parameters in `with_request_url` test helper.
383
2012
 
@@ -417,7 +2046,7 @@ title: Changelog
417
2046
 
418
2047
  * Clarify documentation of `with_variant` as an override of Action Pack.
419
2048
 
420
- *Blake Williams*, *Cameron Dutro*, *Joel Hawksley*
2049
+ *Blake Williams, Cameron Dutro, Joel Hawksley*
421
2050
 
422
2051
  * Update docs page to be called Javascript and CSS, rename Building ViewComponents to Guide.
423
2052
 
@@ -442,7 +2071,7 @@ title: Changelog
442
2071
 
443
2072
  * Clarify slots example in docs to reduce naming confusion.
444
2073
 
445
- *Joel Hawksley*, *Blake Williams*
2074
+ *Joel Hawksley, Blake Williams*
446
2075
 
447
2076
  * Fix error in documentation for `render_many` passthrough slots.
448
2077
 
@@ -619,6 +2248,12 @@ title: Changelog
619
2248
 
620
2249
  *Joel Hawksley*
621
2250
 
2251
+ ## 2.31.2
2252
+
2253
+ * Patch XSS vulnerability in `ViewComponent::Translatable` module caused by improperly escaped interpolation arguments.
2254
+
2255
+ *Cameron Dutro*
2256
+
622
2257
  ## 2.31.1
623
2258
 
624
2259
  * Fix `DEPRECATION WARNING: before_render_check` when compiling `ViewComponent::Base`
@@ -663,12 +2298,6 @@ _Note: This release includes an underlying change to Slots that may affect incor
663
2298
 
664
2299
  *Joel Hawksley*
665
2300
 
666
- ## 2.29.1
667
-
668
- * Patch XSS vulnerability in `ViewComponent::Translatable` module caused by improperly escaped interpolation arguments.
669
-
670
- *Cameron Dutro*
671
-
672
2301
  ## 2.29.0
673
2302
 
674
2303
  * Allow Slot lambdas to share data from the parent component and allow chaining on the returned component.
@@ -904,7 +2533,7 @@ _Note: This release includes an underlying change to Slots that may affect incor
904
2533
 
905
2534
  * Add support for templates as ViewComponent::Preview examples.
906
2535
 
907
- *Juan Manuel Ramallo
2536
+ *Juan Manuel Ramallo*
908
2537
 
909
2538
  ## 2.14.1
910
2539
 
@@ -1281,11 +2910,11 @@ _Note: This release includes an underlying change to Slots that may affect incor
1281
2910
 
1282
2911
  *Rainer Borene*
1283
2912
 
2913
+ <!-- vale off -->
1284
2914
  * Fix edge case issue with extracting variants from less conventional source_locations.
1285
2915
 
1286
- <!-- vale proselint.GenderBias = NO -->
1287
2916
  *Ryan Workman*
1288
- <!-- vale proselint.GenderBias = YES -->
2917
+ <!-- vale on -->
1289
2918
 
1290
2919
  ## v1.6.0
1291
2920
 
@@ -1303,7 +2932,7 @@ _Note: This release includes an underlying change to Slots that may affect incor
1303
2932
 
1304
2933
  * Template-less variants fall back to default template.
1305
2934
 
1306
- *Asger Behncke Jacobsen*, *Cesario Uy*
2935
+ *Asger Behncke Jacobsen, Cesario Uy*
1307
2936
 
1308
2937
  * Generated tests use new naming convention.
1309
2938
 
@@ -1319,11 +2948,11 @@ _Note: This release includes an underlying change to Slots that may affect incor
1319
2948
 
1320
2949
  ## v1.5.3
1321
2950
 
2951
+ <!-- vale off -->
1322
2952
  * Add support for RSpec to generators.
1323
2953
 
1324
- <!-- vale proselint.GenderBias = NO -->
1325
2954
  *Dylan Clark, Ryan Workman*
1326
- <!-- vale proselint.GenderBias = YES -->
2955
+ <!-- vale on -->
1327
2956
 
1328
2957
  * Require controllers as part of setting autoload paths.
1329
2958
 
@@ -1345,11 +2974,11 @@ _Note: This release includes an underlying change to Slots that may affect incor
1345
2974
 
1346
2975
  Note: `actionview-component` is now loaded by requiring `actionview/component`, not `actionview/component/base`.
1347
2976
 
2977
+ <!-- vale off -->
1348
2978
  * Fix issue with generating component method signatures.
1349
2979
 
1350
- <!-- vale proselint.GenderBias = NO -->
1351
2980
  *Ryan Workman, Dylan Clark*
1352
- <!-- vale proselint.GenderBias = YES -->
2981
+ <!-- vale off -->
1353
2982
 
1354
2983
  * Create component generator.
1355
2984