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