view_component 2.17.1 → 2.19.1
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.
Potentially problematic release.
This version of view_component might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +132 -76
- data/README.md +153 -28
- data/app/controllers/view_components_controller.rb +26 -3
- data/app/views/view_components/preview.html.erb +5 -1
- data/lib/view_component/base.rb +21 -9
- data/lib/view_component/collection.rb +2 -0
- data/lib/view_component/engine.rb +2 -2
- data/lib/view_component/preview.rb +2 -14
- data/lib/view_component/previewable.rb +8 -0
- data/lib/view_component/test_helpers.rb +4 -0
- data/lib/view_component/version.rb +1 -1
- metadata +23 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ea6f3a009f297903de456f49af5f615c61c5624fb1deadcb6faa159372d4327d
|
4
|
+
data.tar.gz: dc5bb14f5e95e34e34aa82c1d004e93891947c1d98f0e70424ab61c2f99c401d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30afb969cf609a88bacbc8f3eda28bb62c29a3391e6c0b2779de4d5de5a801a28a9289e83d08bae213389949b0c445138d385dbe5df1123f594aca9e60a0ec13
|
7
|
+
data.tar.gz: be5e974f0efc4c41f60ec092ae14649cfec174f94e79270789610a14081d0ddc3866ab5f7deadf485596a4f44db6e402316d0f9ddffd3b31bd5f9284b9aab810
|
data/CHANGELOG.md
CHANGED
@@ -1,30 +1,86 @@
|
|
1
|
-
#
|
1
|
+
# CHANGELOG
|
2
2
|
|
3
|
-
|
3
|
+
## master
|
4
|
+
|
5
|
+
## 2.19.1
|
6
|
+
|
7
|
+
* Check if `Rails.application` is loaded.
|
8
|
+
|
9
|
+
*Gleydson Tavares*
|
10
|
+
|
11
|
+
* Add documentation for webpack configuration when using Stimulus controllers.
|
12
|
+
|
13
|
+
*Ciprian Redinciuc*
|
14
|
+
|
15
|
+
## 2.19.0
|
16
|
+
|
17
|
+
* Extend documentation for using Stimulus within sidecar directories.
|
18
|
+
|
19
|
+
*Ciprian Redinciuc*
|
20
|
+
|
21
|
+
* Subclassed components inherit templates from parent.
|
22
|
+
|
23
|
+
*Blake Williams*
|
24
|
+
|
25
|
+
* Fix uninitialized constant error from `with_collection` when `eager_load` is disabled.
|
26
|
+
|
27
|
+
*Josh Gross*
|
28
|
+
|
29
|
+
## 2.18.2
|
30
|
+
|
31
|
+
* Raise an error if controller or view context is accessed during initialize as they are only available in render.
|
32
|
+
|
33
|
+
*Julian Nadeau*
|
34
|
+
|
35
|
+
* Collate test coverage across CI builds, ensuring 100% test coverage.
|
36
|
+
|
37
|
+
*Joel Hawksley*
|
38
|
+
|
39
|
+
## 2.18.1
|
40
|
+
|
41
|
+
* Fix bug where previews didn't work when monkey patch was disabled.
|
42
|
+
|
43
|
+
*Mixer Gutierrez*
|
44
|
+
|
45
|
+
## 2.18.0
|
46
|
+
|
47
|
+
* Fix auto-loading of previews (changes no longer require a server restart)
|
48
|
+
|
49
|
+
*Matt Brictson*
|
50
|
+
|
51
|
+
* Add `default_preview_layout` configuration option to load custom app/views/layouts.
|
52
|
+
|
53
|
+
*Jared White, Juan Manuel Ramallo*
|
54
|
+
|
55
|
+
* Calculate virtual_path once for all instances of a component class to improve performance.
|
56
|
+
|
57
|
+
*Brad Parker*
|
58
|
+
|
59
|
+
## 2.17.1
|
4
60
|
|
5
61
|
* Fix bug where rendering Slot with empty block resulted in error.
|
6
62
|
|
7
63
|
*Joel Hawksley*
|
8
64
|
|
9
|
-
|
65
|
+
## 2.17.0
|
10
66
|
|
11
67
|
* Slots return stripped HTML, removing leading and trailing whitespace.
|
12
68
|
|
13
69
|
*Jason Long, Joel Hawksley*
|
14
70
|
|
15
|
-
|
71
|
+
## 2.16.0
|
16
72
|
|
17
73
|
* Add `--sidecar` option to the erb, haml and slim generators. Places the generated template in the sidecar directory.
|
18
74
|
|
19
75
|
*Michael van Rooijen*
|
20
76
|
|
21
|
-
|
77
|
+
## 2.15.0
|
22
78
|
|
23
79
|
* Add support for templates as ViewComponent::Preview examples.
|
24
80
|
|
25
81
|
*Juan Manuel Ramallo
|
26
82
|
|
27
|
-
|
83
|
+
## 2.14.1
|
28
84
|
|
29
85
|
* Allow using `render_inline` in test when the render monkey patch is disabled with `config.view_component.render_monkey_patch_enabled = false` in versions of Rails < 6.1.
|
30
86
|
|
@@ -34,14 +90,14 @@
|
|
34
90
|
|
35
91
|
Fixes:
|
36
92
|
|
37
|
-
```
|
93
|
+
```console
|
38
94
|
view_component/lib/view_component/slotable.rb:98: warning: Using the last argument as keyword parameters is deprecated; maybe ** should be added to the call
|
39
95
|
view_component/test/app/components/slots_component.rb:18: warning: The called method `initialize' is defined here
|
40
96
|
```
|
41
97
|
|
42
98
|
*Eileen M. Uchitelle*
|
43
99
|
|
44
|
-
|
100
|
+
## 2.14.0
|
45
101
|
|
46
102
|
* Add `config.preview_paths` to support multiple locations of component preview files. Deprecate `config.preview_path`.
|
47
103
|
|
@@ -51,25 +107,25 @@
|
|
51
107
|
|
52
108
|
*Richard Macklin*
|
53
109
|
|
54
|
-
|
110
|
+
## 2.13.0
|
55
111
|
|
56
112
|
* Add the ability to disable the render monkey patch with `config.view_component.render_monkey_patch_enabled`. In versions of Rails < 6.1, add `render_component` and `render_component_to_string` methods which can be used for rendering components instead of `render`.
|
57
113
|
|
58
114
|
*Johannes Engl*
|
59
115
|
|
60
|
-
|
116
|
+
## 2.12.0
|
61
117
|
|
62
118
|
* Implement Slots as potential successor to Content Areas.
|
63
119
|
|
64
120
|
*Jens Ljungblad, Brian Bugh, Jon Palmer, Joel Hawksley*
|
65
121
|
|
66
|
-
|
122
|
+
## 2.11.1
|
67
123
|
|
68
124
|
* Fix kwarg warnings in Ruby 2.7.
|
69
125
|
|
70
126
|
*Joel Hawksley*
|
71
127
|
|
72
|
-
|
128
|
+
## 2.11.0
|
73
129
|
|
74
130
|
* Ensure Rails configuration is available within components.
|
75
131
|
|
@@ -79,25 +135,25 @@
|
|
79
135
|
|
80
136
|
*Franco Sebregondi*
|
81
137
|
|
82
|
-
|
138
|
+
## 2.10.0
|
83
139
|
|
84
140
|
* Raise an `ArgumentError` with a helpful message when Ruby cannot parse a component class.
|
85
141
|
|
86
142
|
*Max Beizer*
|
87
143
|
|
88
|
-
|
144
|
+
## 2.9.0
|
89
145
|
|
90
146
|
* Cache components per-request in development, preventing unnecessary recompilation during a single request.
|
91
147
|
|
92
148
|
*Felipe Sateler*
|
93
149
|
|
94
|
-
|
150
|
+
## 2.8.0
|
95
151
|
|
96
152
|
* Add `before_render`, deprecating `before_render_check`.
|
97
153
|
|
98
154
|
*Joel Hawksley*
|
99
155
|
|
100
|
-
|
156
|
+
## 2.7.0
|
101
157
|
|
102
158
|
* Add `rendered_component` method to `ViewComponent::TestHelpers` which exposes the raw output of the rendered component.
|
103
159
|
|
@@ -107,7 +163,7 @@
|
|
107
163
|
|
108
164
|
*Jon Palmer*
|
109
165
|
|
110
|
-
|
166
|
+
## 2.6.0
|
111
167
|
|
112
168
|
* Add `config.view_component.preview_route` to set the endpoint for component previews. By default `/rails/view_components` is used.
|
113
169
|
|
@@ -117,13 +173,13 @@
|
|
117
173
|
|
118
174
|
*Joel Hawksley*
|
119
175
|
|
120
|
-
|
176
|
+
## 2.5.1
|
121
177
|
|
122
178
|
* Compile component before rendering collection.
|
123
179
|
|
124
180
|
*Rainer Borene*
|
125
181
|
|
126
|
-
|
182
|
+
## v2.5.0
|
127
183
|
|
128
184
|
* Add counter variables when rendering collections.
|
129
185
|
|
@@ -133,7 +189,7 @@
|
|
133
189
|
|
134
190
|
*Fabio Cantoni*
|
135
191
|
|
136
|
-
|
192
|
+
## v2.4.0
|
137
193
|
|
138
194
|
* Add `#render_to_string` support.
|
139
195
|
|
@@ -151,7 +207,7 @@
|
|
151
207
|
|
152
208
|
*Richard Macklin*
|
153
209
|
|
154
|
-
|
210
|
+
## v2.3.0
|
155
211
|
|
156
212
|
* Allow using inline render method(s) defined on a parent.
|
157
213
|
|
@@ -165,19 +221,19 @@
|
|
165
221
|
|
166
222
|
*Juan Manuel Ramallo*
|
167
223
|
|
168
|
-
|
224
|
+
## v2.2.2
|
169
225
|
|
170
226
|
* Add `Base.format` for better compatibility with `ActionView::Template`.
|
171
227
|
|
172
228
|
*Joel Hawksley*
|
173
229
|
|
174
|
-
|
230
|
+
## v2.2.1
|
175
231
|
|
176
232
|
* Fix bug where template could not be found if `inherited` was redefined.
|
177
233
|
|
178
234
|
*Joel Hawksley*
|
179
235
|
|
180
|
-
|
236
|
+
## v2.2.0
|
181
237
|
|
182
238
|
* Add support for `config.action_view.annotate_template_file_names` (coming in Rails 6.1).
|
183
239
|
|
@@ -187,25 +243,25 @@
|
|
187
243
|
|
188
244
|
*Vasiliy Ermolovich*
|
189
245
|
|
190
|
-
|
246
|
+
## v2.1.0
|
191
247
|
|
192
248
|
* Support rendering collections (e.g., `render(MyComponent.with_collection(@items))`).
|
193
249
|
|
194
250
|
*Tim Clem*
|
195
251
|
|
196
|
-
|
252
|
+
## v2.0.0
|
197
253
|
|
198
254
|
* Move to `ViewComponent` namespace, removing all references to `ActionView`.
|
199
255
|
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
256
|
+
* The gem name is now `view_component`.
|
257
|
+
* ViewComponent previews are now accessed at `/rails/view_components`.
|
258
|
+
* ViewComponents can _only_ be rendered with the instance syntax: `render(MyComponent.new)`. Support for all other syntaxes has been removed.
|
259
|
+
* ActiveModel::Validations have been removed. ViewComponent generators no longer include validations.
|
260
|
+
* In Rails 6.1, no monkey patching is used.
|
261
|
+
* `to_component_class` has been removed.
|
262
|
+
* All gem configuration is now in `config.view_component`.
|
207
263
|
|
208
|
-
|
264
|
+
## v1.17.0
|
209
265
|
|
210
266
|
* Support Ruby 2.4 in CI.
|
211
267
|
|
@@ -219,7 +275,7 @@
|
|
219
275
|
|
220
276
|
*Joel Hawksley*
|
221
277
|
|
222
|
-
|
278
|
+
## v1.16.0
|
223
279
|
|
224
280
|
* Add `refute_component_rendered` test helper.
|
225
281
|
|
@@ -233,7 +289,7 @@
|
|
233
289
|
|
234
290
|
*Rainer Borene*
|
235
291
|
|
236
|
-
|
292
|
+
## v1.15.0
|
237
293
|
|
238
294
|
* Re-introduce ActionView::Component::TestHelpers.
|
239
295
|
|
@@ -257,19 +313,19 @@
|
|
257
313
|
|
258
314
|
*Sean Doyle*
|
259
315
|
|
260
|
-
|
316
|
+
## v1.14.1
|
261
317
|
|
262
318
|
* Fix bug where generator created invalid test code.
|
263
319
|
|
264
320
|
*Joel Hawksley*
|
265
321
|
|
266
|
-
|
322
|
+
## v1.14.0
|
267
323
|
|
268
324
|
* Rename ActionView::Component::Base to ViewComponent::Base
|
269
325
|
|
270
326
|
*Joel Hawksley*
|
271
327
|
|
272
|
-
|
328
|
+
## v1.13.0
|
273
329
|
|
274
330
|
* Allow components to be rendered inside controllers.
|
275
331
|
|
@@ -279,7 +335,7 @@
|
|
279
335
|
|
280
336
|
*Blake Williams*
|
281
337
|
|
282
|
-
|
338
|
+
## v1.12.0
|
283
339
|
|
284
340
|
* Revert: Remove initializer requirement for Ruby 2.7+
|
285
341
|
|
@@ -293,13 +349,13 @@
|
|
293
349
|
|
294
350
|
*Joel Hawksley*
|
295
351
|
|
296
|
-
|
352
|
+
## v1.11.1
|
297
353
|
|
298
354
|
* Relax Capybara requirement.
|
299
355
|
|
300
356
|
*Joel Hawksley*
|
301
357
|
|
302
|
-
|
358
|
+
## v1.11.0
|
303
359
|
|
304
360
|
* Add support for Capybara matchers.
|
305
361
|
|
@@ -309,25 +365,25 @@
|
|
309
365
|
|
310
366
|
*Asger Behncke Jacobsen*
|
311
367
|
|
312
|
-
|
368
|
+
## v1.10.0
|
313
369
|
|
314
370
|
* Deprecate all `render` syntaxes except for `render(MyComponent.new(foo: :bar))`
|
315
371
|
|
316
372
|
*Joel Hawksley*
|
317
373
|
|
318
|
-
|
374
|
+
## v1.9.0
|
319
375
|
|
320
376
|
* Remove initializer requirement for Ruby 2.7+
|
321
377
|
|
322
378
|
*Dylan Clark*
|
323
379
|
|
324
|
-
|
380
|
+
## v1.8.1
|
325
381
|
|
326
382
|
* Run validation checks before calling `#render?`.
|
327
383
|
|
328
384
|
*Ash Wilson*
|
329
385
|
|
330
|
-
|
386
|
+
## v1.8.0
|
331
387
|
|
332
388
|
* Remove the unneeded ComponentExamplesController and simplify preview rendering.
|
333
389
|
|
@@ -353,7 +409,7 @@
|
|
353
409
|
|
354
410
|
*Sergey Malykh*
|
355
411
|
|
356
|
-
|
412
|
+
## v1.7.0
|
357
413
|
|
358
414
|
* Simplify validation of templates and compilation.
|
359
415
|
|
@@ -363,7 +419,7 @@
|
|
363
419
|
|
364
420
|
*Jon Palmer*
|
365
421
|
|
366
|
-
|
422
|
+
## v1.6.2
|
367
423
|
|
368
424
|
* Fix Uninitialized Constant error.
|
369
425
|
|
@@ -377,7 +433,7 @@
|
|
377
433
|
|
378
434
|
*Justin Coyne*
|
379
435
|
|
380
|
-
|
436
|
+
## v1.6.1
|
381
437
|
|
382
438
|
* Allow Previews to have no layout.
|
383
439
|
|
@@ -403,7 +459,7 @@
|
|
403
459
|
|
404
460
|
*Ryan Workman*
|
405
461
|
|
406
|
-
|
462
|
+
## v1.6.0
|
407
463
|
|
408
464
|
* Avoid dropping elements in the render_inline test helper.
|
409
465
|
|
@@ -433,7 +489,7 @@
|
|
433
489
|
|
434
490
|
*Vinicius Stock*
|
435
491
|
|
436
|
-
|
492
|
+
## v1.5.3
|
437
493
|
|
438
494
|
* Add support for RSpec to generators.
|
439
495
|
|
@@ -443,19 +499,19 @@
|
|
443
499
|
|
444
500
|
*Joel Hawksley*
|
445
501
|
|
446
|
-
|
502
|
+
## v1.5.2
|
447
503
|
|
448
504
|
* Disable eager loading initializer.
|
449
505
|
|
450
506
|
*Kasper Meyer*
|
451
507
|
|
452
|
-
|
508
|
+
## v1.5.1
|
453
509
|
|
454
510
|
* Update railties class to work with Rails 6.
|
455
511
|
|
456
512
|
*Juan Manuel Ramallo*
|
457
513
|
|
458
|
-
|
514
|
+
## v1.5.0
|
459
515
|
|
460
516
|
Note: `actionview-component` is now loaded by requiring `actionview/component`, not `actionview/component/base`.
|
461
517
|
|
@@ -475,7 +531,7 @@ Note: `actionview-component` is now loaded by requiring `actionview/component`,
|
|
475
531
|
|
476
532
|
*Juan Manuel Ramallo*
|
477
533
|
|
478
|
-
|
534
|
+
## v1.4.0
|
479
535
|
|
480
536
|
* Fix bug where components broke in application paths with periods.
|
481
537
|
|
@@ -497,7 +553,7 @@ Note: `actionview-component` is now loaded by requiring `actionview/component`,
|
|
497
553
|
|
498
554
|
*Elia Schito*
|
499
555
|
|
500
|
-
|
556
|
+
## v1.3.6
|
501
557
|
|
502
558
|
* Allow template file names without format.
|
503
559
|
|
@@ -507,7 +563,7 @@ Note: `actionview-component` is now loaded by requiring `actionview/component`,
|
|
507
563
|
|
508
564
|
*Juan Manuel Ramallo*
|
509
565
|
|
510
|
-
|
566
|
+
## v1.3.5
|
511
567
|
|
512
568
|
* Re-expose `controller` method.
|
513
569
|
|
@@ -521,7 +577,7 @@ Note: `actionview-component` is now loaded by requiring `actionview/component`,
|
|
521
577
|
|
522
578
|
*ars moriendi*
|
523
579
|
|
524
|
-
|
580
|
+
## v1.3.4
|
525
581
|
|
526
582
|
* Template errors surface correct file and line number.
|
527
583
|
|
@@ -531,57 +587,57 @@ Note: `actionview-component` is now loaded by requiring `actionview/component`,
|
|
531
587
|
|
532
588
|
*Joel Hawksley*
|
533
589
|
|
534
|
-
|
590
|
+
## v1.3.3
|
535
591
|
|
536
|
-
*
|
592
|
+
* Do not raise error when sidecar files that are not templates exist.
|
537
593
|
|
538
594
|
*Joel Hawksley*
|
539
595
|
|
540
|
-
|
596
|
+
## v1.3.2
|
541
597
|
|
542
|
-
*
|
598
|
+
* Support rendering views from inside component templates.
|
543
599
|
|
544
600
|
*Patrick Sinclair*
|
545
601
|
|
546
|
-
|
602
|
+
## v1.3.1
|
547
603
|
|
548
|
-
*
|
604
|
+
* Fix bug where rendering nested content caused an error.
|
549
605
|
|
550
606
|
*Joel Hawksley, Aaron Patterson*
|
551
607
|
|
552
|
-
|
608
|
+
## v1.3.0
|
553
609
|
|
554
|
-
*
|
610
|
+
* Components are rendered with enough controller context to support rendering of partials and forms.
|
555
611
|
|
556
612
|
*Patrick Sinclair, Joel Hawksley, Aaron Patterson*
|
557
613
|
|
558
|
-
|
614
|
+
## v1.2.1
|
559
615
|
|
560
|
-
*
|
616
|
+
* `actionview-component` is now tested against Ruby 2.3/2.4 and Rails 5.0.0.
|
561
617
|
|
562
|
-
|
618
|
+
## v1.2.0
|
563
619
|
|
564
|
-
*
|
620
|
+
* The `render_component` test helper has been renamed to `render_inline`. `render_component` has been deprecated and will be removed in v2.0.0.
|
565
621
|
|
566
622
|
*Joel Hawksley*
|
567
623
|
|
568
|
-
*
|
624
|
+
* Components are now rendered with `render MyComponent, foo: :bar` syntax. The existing `render MyComponent.new(foo: :bar)` syntax has been deprecated and will be removed in v2.0.0.
|
569
625
|
|
570
626
|
*Joel Hawksley*
|
571
627
|
|
572
|
-
|
628
|
+
## v1.1.0
|
573
629
|
|
574
|
-
*
|
630
|
+
* Components now inherit from ActionView::Component::Base
|
575
631
|
|
576
632
|
*Joel Hawksley*
|
577
633
|
|
578
|
-
|
634
|
+
## v1.0.1
|
579
635
|
|
580
|
-
*
|
636
|
+
* Always recompile component templates outside production.
|
581
637
|
|
582
638
|
*Joel Hawksley, John Hawthorn*
|
583
639
|
|
584
|
-
|
640
|
+
## v1.0.0
|
585
641
|
|
586
642
|
This release extracts the `ActionView::Component` library from the GitHub application.
|
587
643
|
|